使用 VS.Net 中的安装项目(安装程序)创建和恢复 mysql 数据库
为 winform 应用程序创建安装程序的最佳实践是什么?
该应用程序应该在不连接互联网的情况下安装以下内容。
- .Net Framework 3.5sp1
- MySQL 服务器
- My SQL 连接器
- 使用 MySQL uname/pwd恢复 Mysql 数据库
- 更新配置文件。
我有用于安装上述项目的所有 msi 文件。但我想知道创建安装程序的最佳实践。
提前致谢,
What is the best practice for creating an installer for a winform application.
The application is supposed to install the following without connecting to internet.
- .Net Framework 3.5sp1
- MySQL Server
- My SQL Connector
- Restore Mysql db
- Update Config file with the MySQL uname/pwd.
I have all the msi files for installing the above mentioned items. But am wondering about the best practice to create the installer.
Thanks in advance,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗨,我想到了类似的情况。首先,您应该有 .NET Framework 离线安装程序,可以从 http://www.microsoft.com/downloads/en/details.aspx?FamilyID=992cffcb-f8ce-41d9-8bd6-31f3e216285c。我假设您正在使用 Visual Studio 安装程序。有多种选择,但我更喜欢将离线 .NET 安装程序复制到安装项目输出目录,并根据目标计算机选项卡上的要求,将 .NET Framework 的安装 URL 属性设置为离线安装文件的确切名称。如图所示。
因此安装程序不会尝试连接到远程计算机来下载 .NET Framework 并安装它,但是我认为连接微软服务器并安装更合适。无论如何,下一步是配置 MySQL 服务器。 MySQL 对我来说非常慷慨,因为它们支持完整记录的 noinstall 文件。您可以在此处找到该文档: http://dev .mysql.com/doc/refman/5.5/en/windows-install-archive.html
使用 noinstall zip 存档,您可以将 dbengine 核心文件复制到 clint 计算机上的任何文件夹。并更改MySQL的配置参数。您可以为 MySQL 服务命名任何您想要的名称。启动服务并创建表。您可以从安装项目的自定义操作选项卡中选择适当的脚本文件来执行所有这些操作,也可以为其编写代码。美妙的事情是您的客户不需要知道他/她正在目标计算机上安装数据库引擎。我希望这有帮助。谢谢。
Hi I came up with a similar situation. Firstly you should have .NET framework offline installer which can be downloaded from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=992cffcb-f8ce-41d9-8bd6-31f3e216285c. I assume you are using visual studio installer. There are couple of choices but I prefer to copy the offline .NET installer to the setup projects output directory and from requirements on target machine tab I set the install URL property of .NET framework the exact name of offline setup file. As described in the figure.
So the installer does not try to connect to a remote computer to download .NET framework and install it however I think it is more appropriate that it connects to a Microsoft server and installs it. Anyways the next step is to configure the MySQL server. MySQL is really generous for me since they support a fully documented noinstall files. You can find the document here: http://dev.mysql.com/doc/refman/5.5/en/windows-install-archive.html
Using a noinstall zip archive you can copy the dbengine core files to any folder on the clint machine. And change the configuration parameters of MySQL. You can name the MySQL service anything you want. Start the the service and create tables. You can do all of this stuff from custom actions tab of the setup project choosing the appropriate script files or you can write code for it. The beautiful thing is that your customer does not need to know that he/she is installing a database engine on the target machine. I hope this helps. Thanks.