Windows安装程序和安装应用程序合并为一个文件? [英] Windows installer and setup application into one file?

查看:157
本文介绍了Windows安装程序和安装应用程序合并为一个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用Visual Studio用C#编写了一个应用程序,并制作了一个项目设置文件,该文件在调试时为我创建为文件.

Windows Installer和安装应用程序都是必需的,但是我想将它们合并为一个,就像当您下载一个应用程序时,安装程​​序只有一个文件.

有人可以告诉我如何做到这一点,或者只是指向一个好的消息来源.

谢谢.

解决方案

如果您使用Visual Studio的内置安装项目模板来生成安装程序,则根本不需要setup.exe文件. /p>

您唯一需要分发的是.msi文件.它包含用户安装您的应用程序所需的一切. setup.exe文件只是一个存根,它从.msi文件中的信息启动安装程序,该文件是Windows Installer用于安装应用程序的数据库.而且,如果已安装Windows Installer服务,则可以通过双击这些文件来启动它们,因此,如果您不想这样做,则确实不需要分发setup.exe引导程序.

您可能要分发setup.exe文件的一些特殊原因是:

  • 由于某些原因,您可能希望用户的计算机上未安装所需版本的Windows Installer.如今,这已经变得非常罕见了,尤其是考虑到宽带Internet连接的普及程度以及OS厂商如何推动自动更新而变得越来越棘手.但是,如果您的用户处于断开连接"状态(从某种意义上说,是这样),则您可能希望使用安装可执行文件来验证是否存在必需版本的Windows Installer,如果没有安装该版本,则将其安装,然后启动您的.msi文件执行安装. (如果未安装Windows Installer,则无法运行.msi文件.)

  • 您需要支持多种语言.在这种情况下,setup.exe文件可以在启动安装程序之前对.msi文件执行语言转换.

  • 您要按顺序管理几个.msi文件的安装. Windows Installer的设计方式很难链接.msi文件的安装,这使得在安装自己的应用程序的文件之前或之后安装依赖项变得困难. setup.exe文件不受Windows Installer的限制,因此可以用来链接这些文件并精确地管理安装顺序.

  • 通常,创建您自己的setup.exe文件(或使用许多第三方安装程序软件包之一为您创建文件)可为您提供更大的灵活性.您基本上可以完全控制安装过程,而不必遵循Windows Installer的规则.

但是83.44%的时间是不必要的,您应该遵循使用.msi文件的简单得多的方法.这也使系统管理员可以在他们管理的机器之间(例如,在整个公司网络中)自动执行安装,而原始可执行文件不支持这种安装.

I have written a application in C# using visual studio, I have made a project set up file which as created to files for me in my debug.

The Windows Installer and the setup application are both needed, but i would like to merge them into one, like when you download an app the installer its just one file.

Could some one please show me how to do this, or just point me towards a good source.

Thanks in advance.

解决方案

If you're using Visual Studio's built-in setup project template to generate your installer, then you don't need the setup.exe file at all.

The only thing you need to distribute is the .msi file. That contains everything that a user would need to install your application. The setup.exe file is simply a stub that launches the setup routines from information in the .msi file, which is a database that the Windows Installer uses to install your application. And since these files can be launched by double-clicking on them if the Windows Installer service is installed, you really don't need to distribute the setup.exe bootstrapper if you don't want to.

Some special reasons that you might want to distribute a setup.exe file are:

  • You expect for some reason that your users might not have the required version of the Windows Installer installed on their computer. This is getting to be pretty rare nowadays, especially considering how widespread broadband Internet connections are and how pushy OS vendors are getting with pushing automatic updates. But if your users are "disconnected" (in many senses of the word), you might want to use a setup executable to verify the presence of the necessary version of the Windows Installer, install it if it isn't there, and then launch your .msi file to perform the install. (You cannot run a .msi file if you do not have Windows Installer installed.)

  • You need to support multiple languages. In this case, the setup.exe file can perform a language transformation on the .msi file before launching the installer.

  • You want to manage the installation of several .msi files in sequence. The way that Windows Installer is designed, it's difficult to chain installations of .msi files, which makes it difficult to install dependencies before or after you install your own application's files. A setup.exe file is not subject to the limitations of the Windows Installer, so it can be used to chain these and precisely manage the order of installation.

  • In general, creating your own setup.exe file (or using one of the many third-party installer software packages to create it for you) gives you significantly greater flexibility. You essentially have complete control over the installation process, rather than having to follow the rules of Windows Installer.

But 83.44% of the time, this isn't necessary and you should follow the much simpler route of using an .msi file. This also allows system administrators to automate installs across machines that they manage (for example, throughout a corporate network), something that is not supported for raw executable files.

这篇关于Windows安装程序和安装应用程序合并为一个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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