Search code examples
wixinstallshieldbootstrapperwix3.10

How to silently uninstall InstallShield.exe which is bundled inside a wix bundle?


I am working on custom managed bootstrapper application in wix. My installer installs .Netframework461(if needed), redist_x86 and msipackage of my application.

My new requirement is along with the above components I need to install an InstallShied exe. I could silently install the installshield exe, but uninstallation of installshield is not happening with my installer.

The code I have added in wix bundle file is given below:

<PackageGroup Id ="InstallShield">
  <ExePackage Id="InstallShield" DisplayName="InstallShield" InstallCommand="/s /v/qn" UninstallCommand="/x /s /v/qn" PerMachine="yes" Vital="yes" Permanent="no" SourceFile="setup.exe" Compressed="yes"/>
</PackageGroup>

Another interestting part is that I could install and uinstall the same InstallShield exe silently using the same commands used in the code in command prompt.

Both my installer and command prompt is in run as administrator mode.

Also on more research I get to know after silent install it erases exe details so it does not get the installshield exe for uninstallation. I don't know it is right observation or not. The error shown in my log file is shown below.

enter image description here

I got one solution like to generate a response file for installation. The command I found is given below.

Setup.exe /s /f1"[SETUPSUPPORTDIR]\Setup.iss"

But my question is how can I silently uninstall with respect to the above response file. What is the correct uninstallcommand for this?


Solution

  • You have no DetectCondition on your ExePackage so there is no way for the bootstrapper to determine whether or not the executable is installed when installing or uninstalling.

    A condition that determines if the package is present on the target system. This condition can use built-in variables and variables returned by searches. This condition is necessary because Windows doesn't provide a method to detect the presence of an ExePackage. Burn uses this condition to determine how to treat this package during a bundle action; for example, if this condition is false or omitted and the bundle is being installed, Burn will install this package.

    Usually you do a detect condition by having a RegistrySearch look for a specific registry key or location that exists when your product is installed and you either set a variable to its value or true or false on whether it exists or not. Then your detect condition can easily be evaluated based on the variable's value and you bootstrapper will know to try an uninstall or install the product.