取消 MSI,而不显示“安装已中断”对话

发布于 2024-09-11 01:22:31 字数 985 浏览 3 评论 0原文

我想知道是否可以使用欢迎屏幕上的“取消”按钮完全退出安装程序,而不显示最终的“安装中断”对话框。当用户还没有开始安装时,我认为这是多余的。

如果用户取消已经开始的安装,我仍然希望显示该对话框,但如果安装尚未开始(如果点击了“取消”按钮,就会出现这种情况)欢迎屏幕)。

我尝试过各种方法,但对 Windows Installer 如何理解解决方案缺乏正确的理解。

更新:开始工作了!我最终结合使用了这两个建议——我希望我能给你们两个答案,但我会把它给雷,因为他的代表最低。但我会给他们俩投票。以下是我的做法(我仍然对它的工作原理感到惊讶):

我按照 ray 的建议使用了 Publish 元素,但我没有调用一个事件(没有名为“Finish”的事件),而是设置了一个属性,“AbortInstall”到 1

<Publish Dialog="SimpleDlg"
                    Control="Cancel"
                    Property="AbortInstall"
                    Value="1">1</Publish>

我在 Wix/Fragment/UI 下的自定义设置文件 WixUI_Simple.wxs 中执行了此操作

然后,在 UserExit.wxs 内我修改了 InstallUISequence,如下所示:

<InstallUISequence>
            <Show Dialog="Simple_UserExit"
                    OnExit="cancel">NOT AbortInstall = 1</Show>
        </InstallUISequence>

...这是克里斯托弗提出的想法。

谢谢你们俩!

I am wondering if it is possible to have the "Cancel" button on my welcome screen completely quit the installer without showing the final "Installation interrupted" dialog. I consider this redundant when the user hasn't even begun the installation yet.

I still want the dialog to be shown if the user cancels an installation that has already been started, but not if the installation hasn't been started (which is the case if the Cancel button is hit on the welcome screen).

I have tried various things but I lack a proper understanding of how Windows Installer works to fathom a solution.

Update: Got it to work! I ended up using a combination of the two suggestions--I wish I could give you both the answer, but I'll give it to ray as he has the lowest rep. But I'll upvote them both. Here's how I did it (I'm still surprised it works):

I used the Publish element as ray suggested, but instead of invoking an event (there's no event called "Finish"), I set a property, "AbortInstall" to 1:

<Publish Dialog="SimpleDlg"
                    Control="Cancel"
                    Property="AbortInstall"
                    Value="1">1</Publish>

I did this in my custom set file WixUI_Simple.wxs under Wix/Fragment/UI

Then, inside UserExit.wxs I modified the InstallUISequence as follows:

<InstallUISequence>
            <Show Dialog="Simple_UserExit"
                    OnExit="cancel">NOT AbortInstall = 1</Show>
        </InstallUISequence>

...which is the idea suggested by Christopher.

Thanks to you both!

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

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

发布评论

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

评论(3

迷雾森÷林ヴ 2024-09-18 01:22:31

查看您的 InstallUISequence 表:

http://msdn .microsoft.com/en-us/library/aa369543(VS.85).aspx

请注意带有 -1、-2 和 -3 序列的特殊对话框。请注意,您还可以在对话框中添加条件。只需一点创意,您就可以使用属性作为标志来确定您的安装是否真正开始并阻止或显示有问题的对话框。

Take a look at your InstallUISequence table:

http://msdn.microsoft.com/en-us/library/aa369543(VS.85).aspx

Notice the special dialogs with a sequence of -1, -2 and -3. Notice that you can also put a condition on the dialogs. With a little creatavity you can use a property as a flag to determine whether your install ever really began and prevent or show the dialog in question.

热血少△年 2024-09-18 01:22:31

我还没有测试过这个,所以它可能一点也不起作用,但那又怎么样。

您可能可以为“取消”按钮控件上的“WelcomeDlg”创建一个“发布”元素,如下所示:

<Publish Dialog="WelcomeDlg" Control="Cancel" Event="Finish" Value="Exit">1</Publish>

让我知道它是如何进行的:)

I haven't tested this so it might not work in the slightest, but what the hell.

You probably can create a Publish element for the WelcomeDlg on the Cancel button control like so:

<Publish Dialog="WelcomeDlg" Control="Cancel" Event="Finish" Value="Exit">1</Publish>

Let me know how it goes :)

表情可笑 2024-09-18 01:22:31

仅供参考有趣。
如何在

<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return">1</Publish>
<Publish Dialog="MyNewDlg" Control="Ok" Event="EndDialog" Value="Return" Order="1">1</Publish>

标签下插入:

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

<InstallUISequence>
  <Show Dialog="MyNewDlg" After="SomeAction">Installed</Show>
  <Show Dialog="ExitDialog" OnExit="success">NOT ExitSuccess = 1</Show>
</InstallUISequence>

就这样。

Just FYI & fun.
How to hide Exit dialog in :
In your custom WixUI_xxxxx.wxs under <UI> tag place

<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return">1</Publish>
<Publish Dialog="MyNewDlg" Control="Ok" Event="EndDialog" Value="Return" Order="1">1</Publish>

Under <Product> tag insert:

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

And

<InstallUISequence>
  <Show Dialog="MyNewDlg" After="SomeAction">Installed</Show>
  <Show Dialog="ExitDialog" OnExit="success">NOT ExitSuccess = 1</Show>
</InstallUISequence>

That's all.

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