作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发一个 Wix 项目,需要询问用户在卸载时是否要删除数据库。我在 Wix 项目的 UI 中添加了对话框和控件。当我单击 MSI 时,会显示自定义的卸载对话框,但当我通过“程序和功能”中的“卸载”单击它时却不会。
我需要做什么才能从程序和功能卸载中显示相同的自定义卸载对话框?
最佳答案
或者,您可以通过自定义操作使用一个很好的功能,告诉 session 显示各种对话框类型:
Record record = new Record();
record.FormatString = string.Format("Would you like to remove program-generated data?");
MessageResult value = session.Message(InstallMessage.User | (InstallMessage)MessageBoxButtons.YesNo, record);
if (value == MessageResult.Yes)
{
// Remove program-generated data
}
请参阅此处,了解我想出此解决方案的位置:http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/UI-on-uninstall-td7593560.html#a7593572
请参阅此处了解您可以提供的各种对话框:https://msdn.microsoft.com/en-us/library/windows/desktop/aa371672(v=vs.85).aspx
要仅在卸载时使用此自定义操作,请按如下方式安排:
<CustomAction Id="ShowDialog" BinaryKey='CustomActionsBinary' DllEntry='ShowDialogRemoveFiles'
Execute='immediate' Return='check' Impersonate='no'/>
<Binary Id='CustomActionsBinary' SourceFile='CustomActions.CA.dll'/>
<InstallExecuteSequence>
<Custom Action='ShowDialog' Before='InstallFinalize'>REMOVE</Custom>
</InstallExecuteSequence>
关于wix - 如何在程序和功能中自定义卸载对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39377461/
我是一名优秀的程序员,十分优秀!