gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 13:47:59 28 4
gpt4 key购买 nike

我的安装程序有问题,只有在计算机上存在以前的版本时才会发生。使用 WiX 工具集创建的安装程序。
如果以前的版本存在,我的安装程序会成功卸载它,但会提前结束。如果再次启动安装没有问题。如果没有成功安装以前的版本。

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

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: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.

任何帮助表示赞赏。任何想法在我的情况下在日志文件中寻找什么。

最佳答案

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

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

!!!我应该使用条件 NOT Installed 仅在安装时运行此操作,而不是在卸载期间运行。像这样
 <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes"/>
<InstallExecuteSequence>
<Custom Action="LaunchApplication" After="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>

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

关于如果安装了以前的版本,WIX 安装程序会卸载但不会安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21242963/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com