这不是一个完整的答案。我必须添加作为答案,因为
格式要求。
UPDATE: 看了这个,又没时间了。This really is no answer at all, but just lobbing it to you in case it can help you research it yourself
.
注册表持久化: 我想你已经尝试过坚持了ALLUSERS
和/或注册表中的安装范围并在更新的 MSI 中读回它?我没看那个。为此,您必须在软件包的第一个版本中执行此操作,并在以后保持它。
MSI API 自动化:这里有一个小技巧,可以找到盒子上以前安装的产品(这基本上运行类似的东西"FindRelatedProducts"
在 MSI 文件内):
微星内部:
Set upgrades = Session.installer.RelatedProducts("INSERT-UPGRADE-CODE")
For Each u In upgrades
scope = Session.installer.ProductInfo(u,"AssignmentType")
MsgBox CStr(scope)
Next
单机,直接运行脚本(首先安装指定升级代码的MSI):
Set installer = CreateObject("WindowsInstaller.Installer")
Set upgrades = installer.RelatedProducts("INSERT-UPGRADE-CODE")
For Each u In upgrades
MsgBox "Product Code: " & u & vbNewLine & "Installation Context: " & installer.ProductInfo(u,"AssignmentType")
Next
MsgBox "Done"
我本想在 GUI 序列中做类似的事情,但又没时间了:
If scope = 1 Then
Session.Property("ALLUSERS") = "1"
Session.Property("MSIINSTALLPERUSER") = ""
Session.Property("WixAppFolder") = "WixPerMachineFolder"
Else
Session.Property("ALLUSERS") = "2"
Session.Property("MSIINSTALLPERUSER") = "1"
Session.Property("WixAppFolder") = "WixPerUserFolder"
End If
WiX 片段:
<Binary Id='Scope.vbs' SourceFile='Debugging Custom Actions\Scope.vbs' />
<CustomAction Id='Scope.vbs' VBScriptCall='' BinaryKey='Scope.vbs' Execute='immediate' Return='ignore'/>
<..>
<InstallUISequence>
<Custom Action='Scope.vbs' Before='CostInitialize' />
</InstallUISequence>
我本来想看看这个,但是没时间了。本质上WIX_UPGRADE_DETECTED
将在正在安装的新安装程序中进行设置。请参阅此答案了解更多信息 https://stackoverflow.com/a/51090120/129130。您可以使用该属性来确定是隐藏还是显示按钮。我简单地测试了一下,它确实有效,但在 WiX 中实现它更困难。我认为你需要覆盖整个对话框。
在 MSI 表中,它会是这样的(Orca 屏幕截图 -MSI 查看器工具 https://stackoverflow.com/a/48482546/129130):
-
这是关于 MSI 和 Burn GUI 问题的解答 https://stackoverflow.com/questions/52654935/changing-text-color-to-wix-dialogs/52674815#52674815(请检查第 2 部分:
Change Default Dialogs - Advanced Dialogs
).
添加更多链接:
- 从 MSI 中删除默认对话框 https://stackoverflow.com/questions/52446750/removing-default-dialogs-from-msi/52451051#52451051
- Wix,以前版本存在时的自定义对话框 https://stackoverflow.com/questions/33690724/wix-custom-dialog-when-previous-version-exists/52765526#52765526
- 使用 Wix 工具集的 UI 中的后退/下一步按钮 https://stackoverflow.com/questions/56757662/back-next-button-in-ui-using-wix-toolset/56761784#56761784
- http://neilsleightholm.blogspot.com/2008/08/customized-uis-for-wix.html http://neilsleightholm.blogspot.com/2008/08/customised-uis-for-wix.html