UPDATE: In Add / Remove Programs
. Maybe try Modify
instead of Remove
- if available. This will run the uninstall in GUI mode, instead of in silent mode which is what is used when you select Remove
.
Impersonation: In silent mode the properties you depend on might not be set (if they are set in the GUI normally), or you could fail to connect to the database because msiexec.exe
(the Windows Installer Engine) runs in system context. I believe one, or both of these issues to be at least part of your problem. Is it a remote database?
Maybe first try to set Impersonate
to yes
, like this (don't run in system context, impersonate launching user):
<CustomAction Id="CleanupServer" BinaryKey="CA" DllEntry="CleanupServer"
Execute="deferred" Return="ignore" Impersonate="yes" />
Alternatively maybe try to run it non-deferred (immediate and unelevated), and maybe set it to run only once:
<CustomAction Id="CleanupServer" BinaryKey="CA" DllEntry="CleanupServer"
Execute="firstSequence" Return="ignore" />
Just suggestions to try, I haven't tested.
Global Logging: First things first, enable global logging on the machine and get yourself a log file that way - please see section: "Globally for all setups on a machine". Essentially just add this section to the registry (but check the link for more details and context):
[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer]
"Logging"="voicewarmup"
"Debug"=dword:00000007
Suggested Steps:
- Add the registry values in question, as described above (
Debug
and Logging
)
- Run the install and then the uninstall from ARP
- Find the log file - with a random name - in the %TEMP% folder
- Windows Key + tap R type
%TEMP%
and press Enter
- Sort by modify date / time. Your file should show up on top
- Let us see the log. Upload to Github, Dropbox, GDisk, or someplace else.
There is also a section on how to interpret log files - in case you want to have a look first yourself. Essentially, search for the custom action names, relevant property values and skim the immediate "surroundings" of the entries you find. Logging is verbose indeed, but helpful.
Persist / Read Back Property Values: Here is an answer showing persisting of properties and how you can read them back with AppSearch. Remember to test such features well in all installation modes (install
, uninstall
, modify
, remove
, major upgrade
, silent and interactively
- there are usually surprises).