WiX: Force Launch Uninstall Using CustomAction

I am writing a new major update to our product. In my installer, I start by looking for the configuration settings of the previous version, and then I want to delete the previous version.

I found several tutorials telling me how to make MSI suitable for such updates.

However, the previous one was not MSI.
This was not in line with best practices.

However, the registry HKLM \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall {GUID} indicates UninstallString.

Using RegistrySearch, I can easily find the command below, which I store in UNINSTALL_CMD.

RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\PROFES~1\RunTime\10\01\Intel32\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{GUID}\setup.exe" -l0x9 -removeonly 4: 

I can not get the CustomAction freeze needed for the actual uninstall.

  <CustomAction Id="ca.UninstPrev" Property="UNINSTALL_CMD" ExeCommand="" /> 

MSI Logs say:
Information 1721. There is a problem with this Windows Installer package. The program required to complete this installation failed to start. Contact your support staff or package provider. Action: ca.UninstallPrevious, location: RunDll32 C: \ PROGRA ~ 1 \ COMMON ~ 1 \ INSTAL ~ 1 \ PROFES ~ 1 \ RunTime \ 10 \ 01 \ Intel32 \ Ctor.dll, LaunchSetup "C: \ Program Files \ InstallShield Installation Information {GUID} \ setup.exe "-l0x9 -removeonly, command:

Does anyone see what I'm doing wrong here?

respectfully
Leif

+4
source share
2 answers

I have been repackaging applications for several years on Continental Airlines, where I did SMS, pushing into 18,000 forest locations. I often had an outdated application in the wild that was not installed using MSI, which I needed to redistribute using MSI, and as soon as this was done, I supported major updates in the future.

These previously deployed applications typically had very broken and erroneous uninstallers. Instead of calling them, I would use SMS to query the forest to get all deployed versions. Then I placed these old packages in the integration lab and worked out what each installer did, and wrote my own aggregate β€œforced cleanup,” which was able to wipe different versions of the application from the machine.

I performed this custom action before CostInitialize, so that when the new MSI did this, it would not affect the crap that was no longer on the machine. This worked for me because I was pushing packages as a System, and I did not have to worry about problems with raising. If you want to be fully compatible with UAC, you will want to run this custom code from the prereq package and either ask it to run it manually, or connect it to the bootloader to run before your MSI.

+5
source

After a good night's sleep, I found my mistake. If you really read http://wix.sourceforge.net/manual-wix3/wix_xsd_customaction.htm , the answer was there.

I tried to create my own type 50 action, run an executable file already installed on the system.

The property indicates the full path to the executable file to run.

ExeCommand indicates the command line arguments for this executable file above.

And it's my fault that I put the full exe + command line in the Property field.

/ l

+2
source

Source: https://habr.com/ru/post/1307839/


All Articles