简体   繁体   English

创建自定义winforms应用程序作为安装程序是不好的做法吗?

[英]Is it bad practice to create a custom winforms app as an installer?

I can't find an installer on the market I like that's opensource or free. 我在市场上找不到我喜欢的开源或免费安装程序。 Sure I would love to use Install shield, but my project needs to finish under budget. 当然,我很想使用Install shield,但是我的项目需要在预算范围内完成。

I was thinking about creating a custom win forms app to handle the install, is this acceptable practice. 我正在考虑创建一个自定义的Win Forms应用程序来处理安装,这是可以接受的做法。 Or should I be creating a custom MSI? 还是应该创建自定义MSI?

If MSI is the route, what tools should I use? 如果使用MSI,应该使用哪些工具?

Essentially I need to perform the following in the installer: 本质上,我需要在安装程序中执行以下操作:

  1. Create an IIS Application 创建一个IIS应用程序
  2. Set permissions 设定权限
  3. Install a console app 安装控制台应用
  4. Create a scheduled task 创建计划任务

then when patching 然后在打补丁时

  1. Replace bin dll's for IIS app 替换IIS应用程序的bin dll

The built in installers provided by Microsoft are not flexible enough to creat self standing IIS applications. Microsoft提供的内置安装程序不够灵活,无法创建独立的IIS应用程序。

MSI is the recommendation from Microsoft to install anything . MSI是Microsoft推荐的安装任何东西的建议。

Sure there are simpler cases where xcopy deployment is fine, or where you can have your own installer. 当然,在某些简单情况下,可以很好地进行xcopy部署,或者可以拥有自己的安装程序。 But In complex cases, users want the auditing and uninstall capabilities, the familiar UI, the pre-req checking (among other things) that comes with MSI. 但是在复杂的情况下,用户需要审核和卸载功能,熟悉的UI,MSI附带的预需求检查(以及其他功能)。

You can customize the MSI-based install that is produced with Visual Studio. 您可以自定义Visual Studio生成的基于MSI的安装。

I normally write scripts using Javascript to do the customization, and then set the Javascript script as a "custom install action". 我通常使用Javascript编写脚本来进行自定义,然后将Javascript脚本设置为“自定义安装操作”。

替代文字

WiX具有Visual Studio集成功能,并且与内置的安装项目相比,它可以完全自定义的MSI构建器并不会太麻烦

If you can do it, then just create your own installer, as an executable. 如果可以做到,则只需将自己的安装程序创建为可执行文件即可。 It could either download the file to be installed or they have downloaded a zip file and then run the executable, which will have all the files to use for the installation. 它可以下载要安装的文件,也可以下载zip文件,然后运行可执行文件,该可执行文件将包含用于安装的所有文件。

I have done that before, as I needed to do some steps that VS2003 couldn't do, and the users didn't seem to mind running the executable. 我之前已经做过此事,因为我需要执行VS2003无法执行的一些步骤,并且用户似乎并不介意运行可执行文件。

Just make certain you have some sort of version in a file or registry, so that you can tell if you need to update, as there may be some extra steps in updating between version 1.2 and 3.8, if some people don't update that often. 只要确定您在文件或注册表中有某种版本,就可以告诉您是否需要更新,因为如果有人不经常更新,则在版本1.2和3.8之间可能需要一些额外的步骤。 。

While your installing is running, make certain to give good information as to what you are doing and how far along you are, that will help people feel better. 当您的安装运行时,请确保提供良好的信息,以帮助您更好地了解自己的工作状况以及发展的步伐。

您可以通过Visual Studio创建Windows Installer,并添加自定义操作以执行所需的操作

I have had good success with Inno Setup. 我使用Inno Setup取得了成功。 It uses a pascal like language and has a GUI helper app called ISTool. 它使用类似Pascal的语言,并具有一个称为ISTool的GUI帮助程序。 It's free/OSS and well documented. 它是免费的/ OSS,并且有据可查。 I can't imagine having to write mine own installation program when there are so many options out there. 我无法想象当有这么多的选择时必须编写自己的安装程序。 Other tools that I've looked at are NSIS (already mentioned), WIX (Microsoft open sourced MSI building tool), and of course the VS Setup Project with custom scripts. 我看过的其他工具是NSIS(已经提到),WIX(Microsoft开源MSI构建工具),当然还有带有自定义脚本的VS安装项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM