Application Uninstall
I have an application that has, under programs, an install and uninstall exe. I can deploy the application fine, it work as expected. When I assign an uninstall, and remove the install assignment to the collection, the device attempts to run my uninstall
string (CustomUninstall.exe) and I get an immediate failure and there isn't much logged on the device. AppEnforce.log has nothing, AppDiscover.log says the uninstall will use contentID_xxxxxxxx but nothing about a failure.
My question is, I assume SCCM is running my command line, but from which directory? Why isn't anything logged? The EXE doesn't live on the device (except in CCMCache).
The way I believe we are going to handle this is to place the exe on the file system in a known location, and use the start in text field to tell sccm where to from the uninstall exe from. But I am interested in what is actually going on here in terms
of where is the uninstall exe running from?
September 2nd, 2015 11:43am
The program will be run from the cache where SCCM as download the software the same with the install. unless you specifies something else.
So for example if you are running CustomUninstall.exe it as to be in the source at the location you specified.
If you have that uninstall copied in c:\temp you would need to set the startin to c:\temp
The reason why you don't have log is probably because the command was not found. So this is why it stop right away.
-
Edited by
Frederick Dicaire
15 hours 56 minutes ago
-
Marked as answer by
mrasmussen
12 hours 45 minutes ago
September 2nd, 2015 11:54am
If you are using an application with an uninstall string, the process is very similar to the install: the process looks along list list of possible packages (in order) until it selects one that meets all listed requirements then checks to see
if the package is downloaded to the client (which it will then download if it's missing). Finally it runs the command line from said ccmcache directory.
the "common trick" is to use a batch file with "%~dp0" to define the "current path" as needed as you're never 100% certain where the uninstall is running from, just like with installs. I would never hard-code a path into
an install nor uninstall string.
-
Edited by
Justin.King
15 hours 51 minutes ago
September 2nd, 2015 12:01pm
That is the behavior I am seeing. What is strange is if I delete the cache, I just get an immediate failure. I would expect the uninstall to behave like the install and download the content if it doesn't exist in cache.
September 2nd, 2015 12:01pm
Are you deleting the cache via the client with the remove cache button or just going into the ccmcache directory and deleting it? For the later I've seen delays before the client "catches up". I assume there's some client logic that
gets wonky if you try to bypass it.
September 2nd, 2015 12:11pm
You are 100 % sure there are no other install's going out to this device via another collection?
I would of thought as soon as appdiscovery detects the application, once the application has been redownloaded if required then appenforce should show the process. I haven't done much with uninstalls, only ever tested it once recently. It did work fine though.
September 2nd, 2015 12:17pm
We deleted the cache directly as a test case. We then ran the uninstall, nothing was downloaded and the uninstall failed. I would have thought it would download the content again and run the uninstall.
September 2nd, 2015 1:48pm
Deleting anything from ccmcache manually will throw the ConfigMgr agent off because it believes the source is still there. If you tried to run it a second time after the initial failure, it will correct itself but ultimately, you shouldn't be deleting
cache contents
September 2nd, 2015 2:06pm
Thanks for the help, Jason, you were spot on, it did succeed after a second retry, which is strange because on an install, if I delete the cache, I see the client downloading without failing, different on an uninstall for whatever reason.
September 2nd, 2015 3:06pm