WIX installer uninstalls but not installs if previ

2019-07-01 22:45发布

I'm having a problem with installer which happens only if previous version exist on the computer. Installer created using WiX-toolset. If previous version exists, my installer uninstalls it successfully but then ends prematurely. If started again installs with no problems. If no previous version installs successfully.

Log file ends with following lines Product: xxxxx -- Installation failed.

MSI (c) (AC:3C) [22:53:59:388]: Windows Installer installed the product. Product Name: xxxxx. Product Version: 1.2.0.0. Product Language: 1033. Manufacturer: xxxxx xxx. Installation success or error status: 1603.

MSI (c) (AC:3C) [22:53:59:389]: Grabbed execution mutex.
MSI (c) (AC:3C) [22:53:59:389]: Cleaning up uninstalled install packages, if any exist
MSI (c) (AC:3C) [22:53:59:393]: MainEngineThread is returning 1603
MSI (c) (AC:80) [22:53:59:400]: RESTART MANAGER: Previously shut down applications have      been restarted.
MSI (c) (AC:80) [22:53:59:401]: RESTART MANAGER: Session closed.

The log files is huge. There are some suspicious lines like

DEBUG: Error 2911:  Could not remove the folder C:\Config.Msi\.
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2911. The arguments are: C:\Config.Msi\, , 

There are no such directory.

Looking into log file I have a feeling that installer doesn't start after uninstallation instead it is trying to start application, which is set for automatic run after installation. This returns error 1603

MSI (s) (2C:08) [22:53:51:928]: PROPERTY CHANGE: Deleting UpdateStarted property. Its current value is '1'.
Action ended 22:53:51: InstallFinalize. Return value 1.
MSI (s) (2C:08) [22:53:51:929]: Doing action: LaunchApplication
MSI (s) (2C:08) [22:53:51:929]: Note: 1: 2205 2:  3: ActionText 
Action 22:53:51: LaunchApplication. 
Action start 22:53:51: LaunchApplication.
MSI (s) (2C:F8) [22:53:51:931]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI87DC.tmp, Entrypoint: WixShellExec
MSI (s) (2C:DC) [22:53:51:931]: Generating random cookie.
MSI (s) (2C:DC) [22:53:51:932]: Created Custom Action Server with PID 8100 (0x1FA4).
MSI (s) (2C:00) [22:53:51:947]: Running as a service.
MSI (s) (2C:00) [22:53:51:948]: Hello, I'm your 32bit Impersonated custom action server.
WixShellExec:  Error 0x80070002: ShellExec failed with return code 2
WixShellExec:  Error 0x80070002: failed to launch target
CustomAction LaunchApplication returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 22:53:51: LaunchApplication. Return value 3.
Action ended 22:53:51: INSTALL. Return value 3.

Any help is appreciated. Any ideas what to look for in log file in my case.

标签: wix
1条回答
三岁会撩人
2楼-- · 2019-07-01 23:32

I think I found what is happening. In my previous installer I used a custom action to run program after installation like this

  <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes"/>
  <InstallExecuteSequence>
  <Custom Action="LaunchApplication" After="InstallFinalize"/>
  </InstallExecuteSequence>

!!! I should use condition NOT Installed to run this action only on installation, but not during uninstallation. Like this

 <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes"/>
 <InstallExecuteSequence>
  <Custom Action="LaunchApplication" After="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>

If I used it in my previous version I would not have this problem now.

查看更多
登录 后发表回答