当用户单击Win表单中的Cancel时,取消安装 [英] Canceling Installation when user click cancel in win form

查看:80
本文介绍了当用户单击Win表单中的Cancel时,取消安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我已经开发了安装程序安装项目.在安装过程中,我将Windows应用程序用作自定义操作.在这里,我将显示取消"按钮.如果用户单击取消"按钮或关闭表单,则设置也不应继续.意味着当用户以Win形式取消安装时,安装程​​序也应该关闭.

请帮我怎么办?

谢谢.

Hello,

I have developed installer setup project. Here during installation I am using windows application as custom action. Here I will be shown "Cancel" button. If user clicks "Cancel" button or close the form the setup also should not be continue. Means setup also should be close when user canceling the installation in win form.

Please help me how to do?

Thanks.

推荐答案

这里是解决方案

如果需要回滚异常,则抛出安装异常,该异常将自动回滚安装程序.


Here''s the solution

In case you need to rollback on a exception throw the install exception which will automatically rollback the setup.


throw new InstallException("Missing database script file");


嗨Birajdar,

在出现错误或取消后,它不会停止设置的继续.它照常运行.在安装过程中,我正在使用winform.假设如果我在winform中出错,则安装程序应该停止并且应该回滚.那怎么办?

现在,我在安装过程中覆盖了安装方法.以及如何将错误消息重新传递给安装程序.请引导我.
Hi Birajdar,

Its not stoping the setup continuation after getting error or canceling. It is running as usual. During instalation i am using winform. Suppose if i get error in winform the setup should be stop and should be rollback. so how to do?

now i am overriding the install method during installation. and how to pass the error message agin to setup. please guide me.


这篇关于当用户单击Win表单中的Cancel时,取消安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆