简体   繁体   English

如何使用C#在Windows应用程序中创建单个文件设置?

[英]How to create single file setup in windows application in c#?

无法在单一文件安装程序中创建安装项目选项时在c#中创建Windows应用程序。如何在c#中的Windows应用程序中创建单个文件安装程序?

If you are using Visual Studio 2010 you can find single file option in View menu, click Property Pages when a deployment project is selected in Solution Explorer. 如果使用的是Visual Studio 2010,则可以在“视图”菜单中找到“单个文件”选项,然后在“解决方案资源管理器”中选择部署项目后,单击“属性页”。 Then choose Build in the Configuration Properties list. 然后在“配置属性”列表中选择“生成”。 Under Package files option you can choose In "setup file". 在“包文件”选项下,可以选择“设置文件”中。 (however the dependencies are often put in the same folder).I can suggest creating an SFX(Self Extracting Archive) or Packer as UPX or others as it will also reduce the file size. (但是,依赖项通常放在同一文件夹中。)我建议创建一个UPX或其他文件格式的SFX(自解压存档)或Packer,因为它也会减小文件的大小。

In Visual Studio 2012 or higher you can use Installshield Limited Edition and creating a project of msi Installer or Installshield script. 在Visual Studio 2012或更高版本中,您可以使用Installshield Limited Edition并创建msi Installer或Installshield脚本的项目。

hope that helps 希望能有所帮助

EDIT: you can create SFX with any of available zip or rar tools (7zip,winzip or winrar will do too).create a archive and proceed to create SFX and define file to run after extraction.. you can see http://www.wikihow.com/Use-7Zip-to-Create-Self-Extracting-excutables 编辑:您可以使用任何可用的zip或rar工具创建SFX(7zip,winzip或winrar也会这样做)。创建一个归档文件,然后继续创建SFX并定义要在提取后运行的文件。。您可以看到http:// www .wikihow.com / USE-7Zip的对创建,自解压,excutables

UPX UPX

http://upx.sourceforge.net/ http://upx.sourceforge.net/

WWPACK WWPACK

http://www.wwpack32.venti.pl/wwpack.html http://www.wwpack32.venti.pl/wwpack.html

for comprehensive information of packers you can visit http://en.wikipedia.org/wiki/Executable_compression 有关包装商的全面信息,您可以访问http://en.wikipedia.org/wiki/Executable_compression

a bit of a curveball but setup files are very 1990's - have you considered using spoon to deliver your app in its own environment with its own dependencies as a single exe. 有点曲折,但设置文件是1990年代的-您是否考虑过使用勺子在自己的环境中以自己的依赖项作为单个exe交付您的应用程序。

See spoon.net and spoon studio for what you can do but honestly it is a really nice way to distribute an app. 请访问spoon.net和spoon studio,了解您可以做什么,但是说实话,这是分发应用程序的一种非常不错的方法。

ed ED

[Edit] not sure why the downvote but having a single exe to run an app can be a much better experience for an end user [编辑]不确定为什么低票但只有一个exe来运行应用可以为最终用户带来更好的体验

阅读文章如何使用开源项目叫做松鼠很容易使用安装发电机for Windows应用程序。

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

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