我正在创建一个带有基本目录安装和单个后安装自定义操作的msi安装程序。该安装程序应支持重新安装所有版本范围(新版、旧版、相同版本)。
几乎一切都正常工作,除了重新安装相同的msi时。当执行与当前安装的相同的msiexec(但可能有其他msiexec命令行属性)时,安装程序启动并退出,但不执行任何操作,并且在日志中不显示错误。
升级和降级功能正常(当指定'AllowDowngrades="yes"'时)。当我使用与当前安装的相同版本构建新的msi时,重新安装也会正确进行。我还尝试设置AllowSameVersionUpgrades而不是AllowDowngrades,但没有成功。
有关如何配置我的wxs以允许重新安装相同的msi文件的任何提示?目前我的MajorUpgrade看起来像这样:
<MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="yes" Disallow="no" DowngradeErrorMessage="Not allowed to downgrade." IgnoreRemoveFailure="yes" MigrateFeatures="yes" />
在msiexec输出中,我看到普通重新安装和相同的msi安装失败之间的差异是,安装程序开始提到“FindRelatedProducts。返回值0”:
Action 14:12:52: INSTALL.
Action start 14:12:52: INSTALL.
Action 14:12:52: FindRelatedProducts. Searching for related applications
Action start 14:12:52: FindRelatedProducts.
Action ended 14:12:52: FindRelatedProducts. Return value 0.
Action 14:12:52: AppSearch. Searching for installed applications
Action start 14:12:52: AppSearch.
AppSearch: Property: NETFRAMEWORK45, Signature: NetFramework45
Action ended 14:12:52: AppSearch. Return value 1.
Action 14:12:52: LaunchConditions. Evaluating launch conditions
Action start 14:12:52: LaunchConditions.
Action ended 14:12:52: LaunchConditions. Return value 1.
Action 14:12:52: ValidateProductID.
Action start 14:12:52: ValidateProductID.
Action ended 14:12:52: ValidateProductID. Return value 1.
Action 14:12:52: CostInitialize. Computing space requirements
虽然成功的升级/降级 msiexec 日志看起来像这样:
Action 18:27:21: INSTALL.
Action start 18:27:21: INSTALL.
Action 18:27:21: FindRelatedProducts. Searching for related applications
Action start 18:27:21: FindRelatedProducts.
FindRelatedProducts: Found application: {014FD491-292B-4BFC-BCFB-87121C11BCE9}
Action ended 18:27:21: FindRelatedProducts. Return value 1.
Action 18:27:21: AppSearch. Searching for installed applications
Action start 18:27:21: AppSearch.
AppSearch: Property: NETFRAMEWORK45, Signature: NetFramework45
Action ended 18:27:21: AppSearch. Return value 1.
Action 18:27:21: LaunchConditions. Evaluating launch conditions
Action start 18:27:21: LaunchConditions.
Action ended 18:27:21: LaunchConditions. Return value 1.
Action 18:27:21: ValidateProductID.
Action start 18:27:21: ValidateProductID.
Action ended 18:27:21: ValidateProductID. Return value 1.
我对Wix不太熟悉,所以非常欢迎您提供有关如何修复此问题或我可以尝试什么的任何提示。注意:我不希望同时安装多个相同的msi/程序,但我希望在再次执行相同的msi时强制进行完整的重新安装,而无需手动先执行卸载操作。这是为了通过msiexec cli属性和自定义操作重新配置软件。