0

When developing a WinForm application, we have to create an installation package for this project and send it to our customer. The customer has to install the application and run it. Otherwise we can send the Bin folder to customer, which contains .exe and .dll

Is there any way to package all the files into one file and the customer can just run it by double click the file? Just like Jave does about Jar.

I find a solution in CodeProject. But this is old, in 2006. I am not sure it can use with today's framwork version. Is there any alternative?

Robin Sun
  • 1,352
  • 3
  • 20
  • 45
  • Which version of Visual Studio are you using? – John Saunders Oct 16 '13 at 02:54
  • Possibly you want ILMerge? http://stackoverflow.com/q/1829531/56778 – Jim Mischel Oct 16 '13 at 02:55
  • @John Saunders The version of VS is vs2010, and it is a winfrom application. – Robin Sun Oct 16 '13 at 03:04
  • @JimMischel Will ILMerge merge all files including .dll, .txt, .config or will it just merge all .dll files into one file? – Robin Sun Oct 16 '13 at 03:06
  • I don't know if it will merge .txt, .config, etc. I know that it will merge assemblies. If you need to merge other types of files and ILMerge won't handle it, you could create a resource assembly. The linked question has a link to ILMerge. Download it and see if it'll do what you need. – Jim Mischel Oct 16 '13 at 03:29
  • You may want to try describing the details of the functionality you want. Not all .NET people are familiar with exactly what a .jar file is. – John Saunders Oct 16 '13 at 04:06
  • Add your extra files as embedded resources in the exe file. Then override the assemblyresolve event to handle dlls (e.g http://stackoverflow.com/a/9180843/157224). For the other files you need to change File.Open into ResourceStream – adrianm Oct 16 '13 at 06:26

1 Answers1

0

You need to create a Windows Installer Package.

The WIX Toolset is a Visual Studio extension you can install, which allows you to create an installation package.

http://wixtoolset.org/

Previous versions of Visual Studio supported an "Installer" project type, but this was discontinued. Hence the need for a third-party extension.

Andrew Shepherd
  • 44,254
  • 30
  • 139
  • 205