我有一个Windows安装程序提示用户inputMysqL信息(服务器,端口,用户名,密码),并希望在完成安装之前确保参数是正确的。
我有一个安装程序项目与自定义操作链接到安装程序类,我做我的错误检查在“安装”方法。 我的错误发生在catch()部分。
任何build议或意见不胜感激。
编辑:当我点击[下一步]安装程序安装应用程序,然后提示MessageBox(如果有错误),但完成安装。 我希望它回滚,并提出以前的屏幕。
如何编写安装程序(安装python,python模块和其他依赖)的Windows框?
Mac .Pkg文件在Windows中打开…奇怪的事情
免费的Windows安装程序
如何以完全自动化的方式在Linux上安装Python解释器
在Windows中,缺less安装权限的用户如何安装每个用户?
编辑2:从MysqLException得到的exception是:“无法连接任何指定的MysqL主机”,这是正确的,但安装程序不会返回/回滚。
public override void Install(IDictionary stateSaver) { base.Install(stateSaver); // parameters from installer // generate connection string conStr MysqLConnection conn = new MysqLConnection(conStr); MysqLCommand cmd = new MysqLCommand(); // open connection and create database try { conn.open(); cmd.Connection = conn; // create database // create table // insert values to test } catch (MysqLException ex) { //I would like this to go back to the prior page //where it asks for user input MessageBox.Show("There was a problem connecting to the database."); this.Rollback(stateSaver); // not working? } // close connection conn.Close(); }
WIX和文件searchinstalldir
testingWindows安装程序
防止Wix安装我的产品中的所有function?
寻找灵活的Windows安装程序产品与强大的脚本语言
要强制回滚当前的安装,可以重新抛出异常。 你只是显示在你的消息框。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。