[wix-users] How to run executable custom action on uninstall

Angus Comber anguscomber at gmail.com
Tue Jul 28 04:21:53 PDT 2020


I want to run a custom action to perform some system reverting actions
using custom action  CA_RemoveServerInstall like this:

    <Binary Id="RollbackServerInstallCA"
     SourceFile="installer_files/rollback-server.exe" />

    <CustomAction
        Id="CA_RemoveServerInstall"
        BinaryKey="RollbackServerInstallCA"
        Impersonate="no"
        ExeCommand="[INSTALLFOLDER] "Cuba Web Server""
        Execute="deferred"
        Return="ignore" />

    <InstallExecuteSequence>
      <Custom Action="CA_RollbackServerInstall" After="InstallFiles">Not
Installed</Custom>
      <Custom Action="CA_ServerConfig" After="CA_RollbackServerInstall">NOT
Installed</Custom>
      <Custom Action="CA_ServerInstall" After="CA_ServerConfig">NOT
Installed</Custom>
      <Custom Action="CA_StartServer" After="CA_ServerInstall">NOT
Installed</Custom>
      <Custom Action="CA_RemoveServerInstall"
After="InstallInitialize">Remove="ALL"</Custom>
    </InstallExecuteSequence>

But when I uninstall via Add/Remove programs I see a The Following
applications should be closed before continuing the install: Cuba Web
Server indicating that the custom action has not run yet.

And if I try to uninstall like this:

msiexec /x example11.msi /l*v uninstall.txt

then I get a Windows Installer dialog:
Another version of this product is already installed. Installation of this
version cannot continue. To configure or remove the existing version of
this product, use Add/Remove Programs on the Control Panel.

And the log shows:
MSI (s) (A0:F0) [12:18:13:215]: Note: 1: 1729

MSI (s) (A0:F0) [12:18:13:215]: Product: Example1 -- Configuration failed.



MSI (s) (A0:F0) [12:18:13:216]: Windows Installer reconfigured the product.
Product Name: Example1. Product Version: 1.0.0.0. Product Language: 1033.
Manufacturer: Itel Office Software Ltd. Reconfiguration success or error
status: 1638.



MSI (s) (A0:F0) [12:18:13:216]: MainEngineThread is returning 1638

MSI (s) (A0:A8) [12:18:13:217]: Calling SRSetRestorePoint API.
dwRestorePtType: 13, dwEventType: 103, llSequenceNumber: 811,
szDescription: "".

MSI (s) (A0:A8) [12:18:13:217]: The call to SRSetRestorePoint API
succeeded. Returned status: 0.

Another version of this product is already installed. Installation of this
version cannot continue. To configure or remove the existing version of
this product, use Add/Remove Programs on the Control Panel.

{6337C51E-6D21-4904-800C-CB7CEA4F33E1}

I need the custom action to run before any of the files are removed.  Is
the problem that the files are being removed before the custom action
runs?  Something else?


More information about the wix-users mailing list