问题
I am creating windows application in c# when creating setup project option of single file setup in not available.How to create single file setup in windows application in c#?
回答1:
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.
See spoon.net and spoon studio for what you can do but honestly it is a really nice way to distribute an app.
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
回答2:
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. 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.
In Visual Studio 2012 or higher you can use Installshield Limited Edition and creating a project of msi Installer or Installshield script.
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
UPX
http://upx.sourceforge.net/
WWPACK
http://www.wwpack32.venti.pl/wwpack.html
for comprehensive information of packers you can visit http://en.wikipedia.org/wiki/Executable_compression
回答3:
Read this article how to use open source project called Squirrel it is easy to use setup generator for windows application.
来源:https://stackoverflow.com/questions/29910569/how-to-create-single-file-setup-in-windows-application-in-c