在 WIX 项目中包含修改后的 FilesInUse 对话框
我有一个修改过的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以通过以下方式使用自定义 FilesInUse 对话框:
您只需使用标签将此对话框引用到您的自定义安装对话框中
所有提到的标签都是 ICE20 对话框要求
希望这会有所帮助。祝你今天过得愉快。
You could use a custom FilesInUse Dialog in the following manner:
You just have to reference this Dialog into your Custom InstallDialog with the tag
All the tags mentioned are part of the ICE20 Dialog Requierements
Hope this helps. Have a nice day.
好吧,我只是花了一些时间试图弄清楚如何解决这个问题。
尽管建议的线程中有一些很好的参考,但我认为
FilesInUse
对话框的自定义更加具体,因此我决定为该问题编写一个更具体的解决方案。看,问题是
MSI
自动使用FilesInUse
对话框,因此如果您尝试以某种方式更改它,您会收到诸如FilesInUse
not 之类的错误如果您从其他文件引用自定义对话框,则存在于对话框表中或表中重复的FilesInUse
对话框。我发现有效的解决方案根本不是对 Wix 的
FilesInUse
对话框使用DialogRef
,而是在主 UI 文件中创建自定义对话框(我通常会在其中放置DialogRef
为FilesInUse
)并将其命名为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 theFilesInUse
dialog automatically, so if you try to change it somehow, you get errors such asFilesInUse
not existing in Dialog table or duplicateFilesInUse
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'sFilesInUse
dialog at all, but to make my custom dialog in main UI file (Where I would normally putDialogRef
toFilesInUse
) and name itFilesInUse
.Hope this helps other people having the same problem.
还有一个问题是,当在“程序和功能”中单击“卸载”时,不会显示自定义 FilesInUse 对话框,因为卸载是在 UILevel 3 下运行的,因此只会显示内置的 FilesInUse。
要解决此问题,请将其包含在您的product.wxs中:
然后,当用户按程序和功能中的更改(或修改)按钮时,维护对话框将有一个可用于卸载的删除按钮,并且将显示自定义对话框。 Visual Studio 等产品只有一个“更改/修改”按钮。
另一件事是,如果卸载键没有修改路径设置,应用程序和功能 (Windows 10) 将禁用修改按钮。它应该设置为
您的引导程序将需要执行此操作。不确定 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:
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
Your bootstrapper will need to do this. Not sure if the MSI can set it.
如果在命令行上构建: 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.
请参阅此处的相关问题和答案: WiX 替换对话框
用户 Yan Sklyarenko 于 2011 年 3 月 25 日回答:
用户 Bob Arnson 于 2011 年 3 月 25 日回复:
See the related question and answers here: WiX replace dialog
User Yan Sklyarenko answered on Mar 25 '11:
User Bob Arnson answered on Mar 25 '11: