在 WIX 项目中包含修改后的 FilesInUse 对话框

发布于 2024-10-02 10:21:37 字数 340 浏览 0 评论 0原文

我有一个修改过的 FilesInUse 对话框。仅将其包含在项目中并更改 UI 中的引用并没有帮助 - 在构建安装项目时,我收到“ICE20:标准对话框:在对话框表中找不到'FilesInUse'”错误。

浏览网络我发现了一个建议 - 禁止 ICE20 的 ICE 验证。好吧,使用这样的设置构建项目工作正常,msi 也工作正常,但我不确定这是否是解决问题的好方法。

另一个建议是修改 FilesInUse 并从引用中删除 WixUIExtension,但据我所知,这样我最终会将所有需要的对话框文件复制到我的项目中。我想避免这种情况。

那么,如何才能将我的自定义 FilesInUse 正确包含在 WIX 项目中呢?

I have a modified FilesInUse dialog. Just including it in project and changing reference in UI does not help - I get "ICE20: Standard Dialog: 'FilesInUse' not found in Dialog table" error when building installation project.

Browsing the Net I've found one advice - to supress ICE validation for ICE20. Well, building the project with such settings works fine, and the msi also works fine, but I'm not sure that's a good solution to the problem.

Another advice was to modify FilesInUse and remove WixUIExtension from references, but as far as I know this way I'll end up with copying all the needed dialog files to my project. This I'd like to avoid.

So, what can be done to include my custom FilesInUse in WIX project correctly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(5

忆伤 2024-10-09 10:21:37

您可以通过以下方式使用自定义 FilesInUse 对话框:

<Fragment>
<UI>
  <Dialog Id="FilesInUse" Width="370" Height="270" Title="Your product name">
    <Control Id="Retry" Type="PushButton" X="304" Y ="243" Width="56" Height="17" Text="Retry" Default="yes" Cancel="yes">
      <Publish Event="EndDialog" Value="Retry">1</Publish>
    </Control>
    <Control Id="Ignore" Type="PushButton" X="235" Y ="243" Width="56" Height="17" Text="Ignore">
      <Publish Event="EndDialog" Value="Ignore">1</Publish>
    </Control>
    <Control Id="Exit" Type="PushButton" X="235" Y ="243" Width="56" Height="17" Text="Exit">
      <Publish Event="EndDialog" Value="Exit">1</Publish>
    </Control>
    <Control Id ="InUseFiles" Type="ListBox" Width="300" Height="150" X="30" Y ="60" Property="FileInUseProcess" Sorted="yes" TabSkip="yes" />
  </Dialog>
</UI>
</Fragment>

您只需使用标签将此对话框引用到您的自定义安装对话框中

<DialogRef Id="FilesInUse" />

所有提到的标签都是 ICE20 对话框要求

希望这会有所帮助。祝你今天过得愉快。

You could use a custom FilesInUse Dialog in the following manner:

<Fragment>
<UI>
  <Dialog Id="FilesInUse" Width="370" Height="270" Title="Your product name">
    <Control Id="Retry" Type="PushButton" X="304" Y ="243" Width="56" Height="17" Text="Retry" Default="yes" Cancel="yes">
      <Publish Event="EndDialog" Value="Retry">1</Publish>
    </Control>
    <Control Id="Ignore" Type="PushButton" X="235" Y ="243" Width="56" Height="17" Text="Ignore">
      <Publish Event="EndDialog" Value="Ignore">1</Publish>
    </Control>
    <Control Id="Exit" Type="PushButton" X="235" Y ="243" Width="56" Height="17" Text="Exit">
      <Publish Event="EndDialog" Value="Exit">1</Publish>
    </Control>
    <Control Id ="InUseFiles" Type="ListBox" Width="300" Height="150" X="30" Y ="60" Property="FileInUseProcess" Sorted="yes" TabSkip="yes" />
  </Dialog>
</UI>
</Fragment>

You just have to reference this Dialog into your Custom InstallDialog with the tag

<DialogRef Id="FilesInUse" />

All the tags mentioned are part of the ICE20 Dialog Requierements

Hope this helps. Have a nice day.

夜深人未静 2024-10-09 10:21:37

好吧,我只是花了一些时间试图弄清楚如何解决这个问题。

尽管建议的线程中有一些很好的参考,但我认为 FilesInUse 对话框的自定义更加具体,因此我决定为该问题编写一个更具体的解决方案。

看,问题是 MSI 自动使用 FilesInUse 对话框,因此如果您尝试以某种方式更改它,您会收到诸如 FilesInUse not 之类的错误如果您从其他文件引用自定义对话框,则存在于对话框表中或表中重复的 FilesInUse 对话框。

我发现有效的解决方案根本不是对 Wix 的 FilesInUse 对话框使用 DialogRef ,而是在主 UI 文件中创建自定义对话框(我通常会在其中放置 DialogRefFilesInUse)并将其命名为 FilesInUse

希望这可以帮助其他遇到同样问题的人。

OK, I just spent some time trying to figure out how to solve this problem.

Though there are some good references in suggested thread, I think the FilesInUse dialog is a bit more specific to customize, so I decided to write a more concrete solution to the problem.

See, the problem is that MSI uses the FilesInUse dialog automatically, so if you try to change it somehow, you get errors such as FilesInUse not existing in Dialog table or duplicate FilesInUse dialog in table if you are referencing your custom dialog from other files.

The solution I found working was not to use DialogRef to Wix's FilesInUse dialog at all, but to make my custom dialog in main UI file (Where I would normally put DialogRef to FilesInUse) and name it FilesInUse.

Hope this helps other people having the same problem.

三生池水覆流年 2024-10-09 10:21:37

还有一个问题是,当在“程序和功能”中单击“卸载”时,不会显示自定义 FilesInUse 对话框,因为卸载是在 UILevel 3 下运行的,因此只会显示内置的 FilesInUse。

要解决此问题,请将其包含在您的product.wxs中:

<Property Id="ARPNOREMOVE" Value="1" />

然后,当用户按程序和功能中的更改(或修改)按钮时,维护对话框将有一个可用于卸载的删除按钮,并且将显示自定义对话框。 Visual Studio 等产品只有一个“更改/修改”按钮。

另一件事是,如果卸载键没有修改路径设置,应用程序和功能 (Windows 10) 将禁用修改按钮。它应该设置为

MsiExec.exe /I{<yourproductcode>}

您的引导程序将需要执行此操作。不确定 MSI 是否可以设置它。

One more wrinkle is that the custom FilesInUse dialog will not be displayed when clicking Uninstall in Programs and Features since the uninstall is run with UILevel 3, so only the built-in FilesInUse will be displayed.

To work around that include this in your product.wxs:

<Property Id="ARPNOREMOVE" Value="1" />

Then when users press the Change (or Modify) button in Programs and Features, the Maintenance dialog will have a Remove button they can use to uninstall, and that will show custom dialogs. Products like Visual Studio only have a Change/Modify button.

One more thing is that Apps and Features (Windows 10) will disable the Modify button if the Uninstall key doesn't have a ModifyPath setting. It should be set to

MsiExec.exe /I{<yourproductcode>}

Your bootstrapper will need to do this. Not sure if the MSI can set it.

酒废 2024-10-09 10:21:37

如果在命令行上构建: light.exe -sice:ICE20...

如果在 Visual Studio 中工作:右键单击您的安装项目,选择“属性”,选择屏幕左侧的“工具设置”,将“ICE20”添加到“抑制特定 ICE 验证:”编辑框。

If building on the command line: light.exe -sice:ICE20...

If working in Visual Studio: Right click your setup project, select "Properties", Select "Tool settings" on left side of screen, Add "ICE20" to the "Suppress Specific ICE validation:" edit box.

小鸟爱天空丶 2024-10-09 10:21:37

请参阅此处的相关问题和答案: WiX 替换对话框

用户 Yan Sklyarenko 于 2011 年 3 月 25 日回答:

几篇文章可以帮助您:

WiX
教程

尼尔·斯利霍姆的
文章

您应该在那里找到您的案例所需的所有信息。

用户 Bob Arnson 于 2011 年 3 月 25 日回复:

请参阅主题中的“更改内置对话框集的 UI 顺序”
WiX.chm 中的“自定义内置 WixUI 对话框集”。

See the related question and answers here: WiX replace dialog

User Yan Sklyarenko answered on Mar 25 '11:

Couple of articles to help you:

WiX
Tutorial

Neil Sleightholm's
article

You should find all the info you need for your case there.

User Bob Arnson answered on Mar 25 '11:

See "Changing the UI sequence of a built-in dialog set" in the topic
"Customizing Built-in WixUI Dialog Sets" in WiX.chm.

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