Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy .NET (C#) exe application on desktops

I develop application in C# with MSVC 2010 Express, with Forms/WPF/etc.

Application consist of some private assemblies (maybe DLLs) and .exe file. It uses .NET 4 features.

How I deploy this application to other computers? Of course if they have .NET 4 I just can send zip of .exe with .dlls and it work. But if they don't have .NET at all (on Win XP machine)? Or maybe they have lower version of .NET? Should I point them to install .NET from internet or package it with my app or what?

Thanks

like image 955
zaharpopov Avatar asked Jul 23 '10 06:07

zaharpopov


4 Answers

There is click-once deploy from microsoft. It automates most of the tasks, including making sure you have the right .Net version and updating the app if a new version of your app is available.

like image 90
Remy Avatar answered Oct 21 '22 05:10

Remy


You should create a installer package. If you are using the express versions of visual studio, you can use some free tools for this like WiX or Inno Setup. WiX is perhaps a difficult option to start with, but has a lot of flexibility. There are tutorials and example projects to modify to adapt them to your needs. http://www.tramontana.co.hu/wix/

This tools create installers that can check if a certain version of the .NET framework is installed on the user computer, among other conditions. You can also include the .NET redistributable in your package, or point the user to download and install it.

like image 42
Alejandro Martin Avatar answered Oct 21 '22 03:10

Alejandro Martin


We try to keep deployment as simple as possible, and one of the things we do is to ensure our application is just a single executable, no support files needed.

We several steps to get there:

  1. Make sure all dependent resource files are stored in embedded resources where possible, and not on disk
  2. Use ILmerge to link all assemblies into a single executable
  3. Optional - obfuscate the assembly
  4. Optional - If some parts cannot be ILMerged or obfuscated, forcing us to have multiple files, we use Xenocode's PostBuild to link all files into a single executable. Xenocode offers a virtual filesystem to do this. This also allows framework embedding so your app will run on a clean Windows install - no dependencies need to be installed :-)
  5. Wrap the single executable into an msi installer using WiX
  6. Wrap the single executable into click once deployment. For this we also use a little stub launcher executable which starts the main application, allowing us to reuse the same main application executable
  7. Create a zip file of just the single file executable for manual installation.

We the following on our downloads site:

  1. the MSI installer - we prefer people to use this one
  2. A zip file with the Xenocoded (single file) executable
  3. A zip file with the Xenocoded (single file) executable including the .NET Framework
like image 27
Tuinstoelen Avatar answered Oct 21 '22 03:10

Tuinstoelen


http://support.microsoft.com/kb/324733

like image 37
Flakron Bytyqi Avatar answered Oct 21 '22 04:10

Flakron Bytyqi