如果之前安装了版本,WIX安装程序可以卸载但无法安装新版本。

4

我在使用WiX工具集创建的安装程序时遇到了问题,只有在计算机上存在以前的版本时才会出现该问题。

如果有先前的版本存在,我的安装程序可以成功卸载它,但是随后会过早终止。如果再次启动,则可以顺利安装。如果没有先前的版本,则可以成功安装。

日志文件以以下行结尾: 产品: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.

非常感谢您的帮助。请问在我的情况下,日志文件中应该查找哪些内容呢?


很有趣能够看到你的 <InstallExecuteSequence>RemoveExistingProducts和你的 LaunchApplication 自定义操作是如何被安排的),以及自定义操作本身的 <CustomAction> - wimh
1个回答

3

我觉得我找到了问题所在。在之前的安装程序中,我使用了自定义操作,在安装后运行程序,像这样:

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

我应该使用条件未安装,以便仅在安装时运行此操作,而不是在卸载过程中运行。像这样:

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

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接