Wix 属性未从 WXI () 保留到 WXS ()
我希望你能帮助我解决以下 WIX 问题:
在我的 main.wxs 中,我初始化“MYPROPERTY”,然后在 ui.wxi 中,我打开一个带有复选框的对话框(从我的 MYPROPERTY 中选中/启用)已在 .wxs 中设置)。我可以通过取消选中该复选框来验证它是否会翻转该值,因为我根据 MYPROPERTY 值启用/禁用“下一步”按钮 - 顺便说一句,我有多个复选框。
问题是,如果我在运行生成的 .msi 时取消选中 UI 中的复选框,则无论选中还是取消选中该复选框,都会运行自定义操作(就好像“MYPROPERTY”始终为 1,请参阅 中的条件)。如何使设置 MYPROPERTY 值的复选框实际保留到自定义操作?
任何帮助表示赞赏。谢谢。
MAIN.WXS:
<Property Id='MYPROPERTY'>1</Property>
<?include ./ui.wxi ?>
...
<InstallExecuteSequence>
<Custom Action="MyCustomAction" After="InstallFiles">
(NOT Installed) AND (MYPROPERTY = 1)
</Custom>
...
ui.wxi:
<UI Id='xxx'>
...
<Dialog
Id="Choose"
Title="My Setup">
<Control
Id="MyCheckBox"
Type="CheckBox"
CheckBoxValue="1"
Property="MYPROPERTY"
/>
...
I hope you can help me with the following WIX issue:
In my main.wxs, I initialize "MYPROPERTY" that then in ui.wxi, I put up a dialog box with a checkbox (that is checked/enabled from the MYPROPERTY that I've setup in the .wxs). I can verify that by unchecking the checkbox, it does flip the value because I enable/disable the "Next" button depending on the MYPROPERTY value - I have more than one checkbox BTW.
The problem is that if I uncheck the checkbox in the UI when running the .msi produced, the Custom Action is ran no matter if the checkbox is checked or unchecked (as if the "MYPROPERTY" is always 1, see the condition in ). How do I make the checkbox that sets the MYPROPERTY value to actually persist to the the Custom Action?
Any help is appreciated. Thanks.
MAIN.WXS:
<Property Id='MYPROPERTY'>1</Property>
<?include ./ui.wxi ?>
...
<InstallExecuteSequence>
<Custom Action="MyCustomAction" After="InstallFiles">
(NOT Installed) AND (MYPROPERTY = 1)
</Custom>
...
ui.wxi:
<UI Id='xxx'>
...
<Dialog
Id="Choose"
Title="My Setup">
<Control
Id="MyCheckBox"
Type="CheckBox"
CheckBoxValue="1"
Property="MYPROPERTY"
/>
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您定义了公共财产,但未确保其安全。如果您以管理员身份使用 Windows XP,则该功能可以工作,但如果您以标准用户身份使用 Windows XP,执行广告/托管/提升安装,或者在启用了 UAC 的 Windows Vista 上,则该功能将无法工作,因为您还必须添加安全属性属性以将其标记为 SecureCustomProperty。
SecureCustomProperties 属性
You have defined a public property but not made it secure. If you were on Windows XP as an administrator it would work but if you were on Windows XP as a standard user perfoming an advertised / managed / elevated install or on Windows Vista with UAC enabled it would not work because you must also add the Secure attribute to the property to mark it as a SecureCustomProperty.
SecureCustomProperties Property