WIX MSI:我想向用户显示一条消息;“产品已安装”;如果用户再次运行安装程序
我正在创建一个MSI安装程序,在测试过程中,如果我第一次运行安装程序,安装程序会按预期工作。但当我不小心运行安装程序时,它卸载了我的文件 因此,为此,我修改了条件并在操作的条件中添加了Remove=“All” 这很好,但我想向用户显示一条消息,该产品已经安装 为此,我添加了以下代码:WIX MSI:我想向用户显示一条消息;“产品已安装”;如果用户再次运行安装程序,wix,windows-installer,custom-action,wix3.5,Wix,Windows Installer,Custom Action,Wix3.5,我正在创建一个MSI安装程序,在测试过程中,如果我第一次运行安装程序,安装程序会按预期工作。但当我不小心运行安装程序时,它卸载了我的文件 因此,为此,我修改了条件并在操作的条件中添加了Remove=“All” 这很好,但我想向用户显示一条消息,该产品已经安装 为此,我添加了以下代码: <Upgrade Id='<<Upgrade Code>>'> <UpgradeVersion OnlyDetect='yes' Property='SELFFOUND
<Upgrade Id='<<Upgrade Code>>'>
<UpgradeVersion OnlyDetect='yes' Property='SELFFOUND'
Minimum='1.0.1' IncludeMinimum='yes' Maximum='1.0.1' IncludeMaximum='yes' />
<UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND'
Minimum='1.0.1' IncludeMinimum='no' />
</Upgrade>
<CustomAction Id='AlreadyUpdated' Error='[ProductName] is already installed.' />
.....
.....
.....
.....
.....
<InstallExecuteSequence>
<Custom Action='AlreadyUpdated' After='FindRelatedProducts'>SELFFOUND</Custom>
</InstallExecuteSequence>
及
AlreadyUpdated自定义操作中的条件也不满足
MSI (s) (18:14) [06:18:05:737]: Doing action: PublishProduct
MSI (s) (18:14) [06:18:05:737]: Note: 1: 2205 2: 3: ActionText
Action 6:18:05: PublishProduct. Publishing product information
Action start 6:18:05: PublishProduct.
PublishProduct:
MSI (s) (18:14) [06:18:05:752]: Re-publishing product - installing new package with existing product code.
Action ended 6:18:05: PublishProduct. Return value 1.
MSI (s) (18:14) [06:18:05:752]: Skipping action: AlreadyUpdated (condition is false)
有没有办法达到这个要求?我做错什么了吗
自定义操作复杂性:首先介绍一下自定义操作及其复杂性。请阅读此处的第一段:
错误条件:这基本上意味着您的条件不正确,因此自定义操作在安装模式下运行,而不应该在安装模式下运行。当您尝试使用复杂条件(或任何相关条件)时,有许多安装模式需要测试:
1。新安装
,2。修理
,3。修改
,4。自修复
,5。打补丁
,6。卸载
,7。主要升级调用卸载
,等等
在您的情况下,一些自定义操作在维护运行时以及在新安装/首次安装期间运行。这是一个非常普遍的问题。解决方案是通过改进设置来消除自定义操作,或者改进条件,使其在任何安装模式下都能实际工作。很明显
条件调试:条件很难得到正确的结果。我喜欢使用消息框测试它们。下面的部分显示了如何执行此操作:-然后以不同的模式运行安装程序并查找对话框。当它们显示时,自定义操作上的条件为true
复杂条件:
以下是关于为什么旧的自定义操作用于新设置的答案:
- 还有一个答案列出了不同安装模式下常见属性的一些值:
- Installshield有此PDF常见条件(其中一些是Installshield特定的):
升级ProductCode
和WIX\u升级
。请阅读:-这些怪癖会影响在主要升级场景中自定义操作的运行次数。这对人们来说有一些非常令人惊讶的影响。使用您的消息框调试
链接:
SELFFOUND
应该使自定义操作仅在框上有现有的旧版本时运行?我想这就是我读这篇文章时你想要的。我想。我认为不建议实施。只是更多的可能出错。
MSI (s) (18:14) [06:18:05:500]: Running ExecuteSequence
MSI (s) (18:14) [06:18:05:500]: Doing action: FindRelatedProducts
MSI (s) (18:14) [06:18:05:500]: Note: 1: 2205 2: 3: ActionText
Action 6:18:05: FindRelatedProducts. Searching for related applications
Action start 6:18:05: FindRelatedProducts.
MSI (s) (18:14) [06:18:05:507]: Skipping FindRelatedProducts action: already done on client side
Action ended 6:18:05: FindRelatedProducts. Return value 0.
MSI (s) (18:14) [06:18:05:737]: Doing action: PublishProduct
MSI (s) (18:14) [06:18:05:737]: Note: 1: 2205 2: 3: ActionText
Action 6:18:05: PublishProduct. Publishing product information
Action start 6:18:05: PublishProduct.
PublishProduct:
MSI (s) (18:14) [06:18:05:752]: Re-publishing product - installing new package with existing product code.
Action ended 6:18:05: PublishProduct. Return value 1.
MSI (s) (18:14) [06:18:05:752]: Skipping action: AlreadyUpdated (condition is false)