如何让安装程序在 ARP 中隐藏“取消”按钮?
当用户单击 ARP 中的“删除”时,我需要能够隐藏或禁用安装程序中的“取消”按钮。有什么办法可以做到这一点吗?如果有的话,怎么做? (将 /qb! 命令行选项添加到 UninstallString 注册表值中不起作用。我尝试过。请不要提供特定于 IDE 的答案,除非它们与 Wise Windows Installer 编辑器有关。)
编辑: Christopher Painter 的答案确实有效,但它并不是 100% 的解决方案。不幸的是,InstallFinalize 操作再次显示“取消”按钮,即使我在其之后再次调用自定义操作,该按钮仍然可见足够长的时间,以便用户能够单击它。 (我通过在自定义操作期间出现一个消息框来验证这一点,这样我就可以看到它何时被调用。)一旦我隐藏“取消”按钮,我希望(不,需要)它保持隐藏状态。时期。有什么办法可以实现这一目标吗?
I need to be able to hide or disable the Cancel button in my installer when the user clicks on Remove in the ARP. Is there any way to go about doing that, and if so, how? (Adding the /qb! command line option into the UninstallString registry value doesn't work. I tried. No IDE-specific answers, please, unless they pertain to Wise Windows Installer Editor.)
Edit: While Christopher Painter's answer does to the trick, it's not a 100% solution. Unfortunately, the InstallFinalize action shows the Cancel button again, and even when I put another call to my custom action right after it, the button is still visible for a long enough time for the user to be able to click it. (I verified this by having a message box come up during my custom action so I could see when it was being called.) Once I hide the Cancel button, I want--no, need--it to stay hidden. Period. Is there any way that I can achieve that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当产品是 MSI 时,ARP 会忽略 UninstallString 注册表值。我相信您能够做到这一点的唯一方法是通过自定义操作。
顺便说一句,我想知道为什么你需要这样做。我猜你有一个不支持回滚的自定义操作?我宁愿解决这个问题并继续给予用户改变主意的能力。
在安装过程中隐藏取消按钮
The UninstallString registry value is ignored by ARP when the Product is an MSI. I believe the only way you'll be able to do it is via a Custom Action.
As an aside, I'm wondering why you need to do this. I'm guessing you have a custom action that doesn't support rollback? I'd rather fix that problem and continue to give the user the ability to change their mind.
Hiding the Cancel Button During an Installation