Question

 <ExePackage Id="PackageID1" DisplayName="xxx" Compressed="yes"
              SourceFile="..\xxx\MyExe.exe" Vital="yes"
              InstallCommand="parameters to the exe"
              UninstallCommand="parameters to the exe"/>

When I trigger the Uninstall action:

this.Engine.Detect();
this.Engine.Plan(LaunchAction.Uninstall);
this.Engine.Apply(System.IntPtr.Zero);

The exePackage does not get invoked. However, during Install, it enters the exe package with the right parameters.

Am I missing something here?

Was it helpful?

Solution

You need a DetectCondition attribute on your ExePackage element. The DetectCondition is how the Burn engine determines if the package is installed on the machine or not. Without a DetectCondition the engine will think the package is never installed so it will never need to be uninstalled. Since all executables are different you have to provide your own DetectCondition. Usually the XxxSearch elements in the util namespace are helpful to detect if your executable is installed.

Note: you can see the 'plan' in the log file and it should show the PackageID1 package being detected as 'Absent' even though it is installed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top