Wix 属性未从 WXI () 保留到 WXS ()

发布于 2024-09-16 01:57:04 字数 907 浏览 2 评论 0原文

我希望你能帮助我解决以下 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

失去的东西太少 2024-09-23 01:57:04

您定义了公共财产,但未确保其安全。如果您以管理员身份使用 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文