简体   繁体   English

Windows安装程序和安装应用程序到一个文件?

[英]Windows installer and setup application into one file?

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. 我已经使用visual studio在C#中编写了一个应用程序,我已经创建了一个项目设置文件,该文件在我的调试中为我创建了文件。

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. Windows Installer和安装应用程序都是必需的,但我想将它们合并为一个,就像下载应用程序时安装程序只有一个文件。

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. 如果您使用Visual Studio的内置安装项目模板来生成安装程序,则根本不需要setup.exe文件。

The only thing you need to distribute is the .msi file. 您需要分发的唯一内容是.msi文件。 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. setup.exe文件只是一个存根,它根据.msi文件中的信息启动安装例程,该文件是Windows Installer用于安装应用程序的数据库。 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. 如果安装了Windows Installer服务,可以通过双击它们来启动这些文件,如果您不想这样做,则实际上不需要分发setup.exe引导程序。

Some special reasons that you might want to distribute a setup.exe file are: 您可能希望分发setup.exe文件的一些特殊原因是:

  • You expect for some reason that your users might not have the required version of the Windows Installer installed on their computer. 您出于某种原因预计您的用户可能没有在其计算机上安装所需的Windows Installer版本。 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. 但是,如果您的用户处于“断开连接”状态(在许多意义上),您可能希望使用安装程序可执行文件来验证是否存在必要的Windows Installer版本,如果不存在则安装它,然后启动您的.msi文件以执行安装。 (You cannot run a .msi file if you do not have Windows Installer installed.) (如果未安装Windows Installer,则无法运行.msi文件。)

  • 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. 在这种情况下, setup.exe文件可以在启动安装程序之前对.msi文件执行语言转换。

  • You want to manage the installation of several .msi files in sequence. 您希望按顺序管理多个.msi文件的安装。 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. 设计Windows Installer的方式很难链接.msi文件的安装,这使得在安装自己的应用程序文件之前或之后很难安装依赖项。 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. setup.exe文件不受Windows Installer的限制,因此可用于链接这些文件并精确管理安装顺序。

  • 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. 通常,创建自己的setup.exe文件(或使用许多第三方安装程序软件包之一为您创建)可以为您提供更大的灵活性。 You essentially have complete control over the installation process, rather than having to follow the rules of Windows Installer. 您基本上可以完全控制安装过程,而不必遵循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. 但是有83.44%的时间,这不是必需的,您应该遵循使用.msi文件的更简单的路线。 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. 这还允许系统管理员在他们管理的计算机(例如,整个公司网络)之间自动安装,这是原始可执行文件不支持的。

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

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