如果安装了以前的版本,WIX安装程序将卸载但不安装

时间:2014-01-20 19:56:00

标签: wix

我遇到安装程序问题,只有在计算机上存在以前的版本时才会出现问题。使用WiX-toolset创建安装程序。 如果存在以前的版本,我的安装程序会成功卸载它,但会过早结束。如果再次启动安装没有问题。如果以前的版本没有成功安装。

日志文件以以下行结束  产品:xxxxx - 安装失败。

MSI(c)(AC:3C)[22:53:59:388]:Windows Installer安装了该产品。产品名称:xxxxx。产品版本:1.2.0.0。产品语言:1033。制造商:xxxxx xxx。安装成功或错误状态: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.

日志文件很大。有一些可疑的行像

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\, , 

没有这样的目录。

查看日志文件我感觉安装程序在卸载后没有启动,而是尝试启动应用程序,该应用程序设置为安装后自动运行。这将返回错误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.

感谢任何帮助。在我的情况下,任何想法在日志文件中寻找什么。

1 个答案:

答案 0 :(得分:2)

我想我发现了正在发生的事情。在我之前的安装程序中,我使用自定义操作在安装后运行程序,如此

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

!!!我应该使用condition NOT Installed 仅在安装时运行此操作,而不是在卸载期间运行。喜欢这个

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

如果我在之前的版本中使用它,我现在就不会遇到这个问题。