如果安装了以前的版本,WIX 安装程序会卸载但不会安装 [英] WIX installer uninstalls but not installs if previous version is installed
问题描述
我在安装程序时遇到问题,只有在计算机上存在以前的版本时才会出现此问题.使用 WiX 工具集创建的安装程序.如果以前的版本存在,我的安装程序会成功卸载它,但会提前结束.如果再次启动安装没有问题.如果之前的版本没有成功安装.
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.
日志文件以以下几行结尾产品:xxxxx -- 安装失败.
Log file ends with following lines Product: xxxxx -- Installation failed.
MSI (c) (AC:3C) [22:53:59:388]:Windows Installer 安装了产品.产品名称:xxxxxx.产品版本:1.2.0.0.产品语言:1033.制造商:xxxxx xxx.安装成功或错误状态:1603.
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\, ,
没有这样的目录.
查看日志文件,我感觉安装程序在卸载后没有启动,而是尝试启动应用程序,该应用程序设置为安装后自动运行.这将返回错误 1603
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.
推荐答案
我想我找到了正在发生的事情.在我以前的安装程序中,我使用自定义操作在安装后运行程序,如下所示
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>
!!!我应该使用条件 NOT Installed 仅在安装时运行此操作,而不是在卸载期间运行.像这样
!!! 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.
这篇关于如果安装了以前的版本,WIX 安装程序会卸载但不会安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!