Deploy .NET (C#) exe application on desktops

旧城冷巷雨未停 提交于 2019-11-30 01:00:42

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.

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.

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

Yes, you should point them to install .NET. Otherwise it won't be possible for them to run your application.

You didn't say what type of clients they are (are you making a small app for your friends to use or are they paying customers), but whatever the case may be, I'm always completely against sending a zip file with an instruction document describing what to do with it and what folder to extract it to. As Remy said, ClickOnce is not a bad idea, but I've found it to be a bit of a pain to set up (once you get it set up, though, it works just fine). On the other hand, a Deployment project is simpler and if I were you, that would be the first thing I'd explore.

Use xenocode here

http://spoon.net/Studio/

No need to install anything. It converts your exe to Native code indirectly and you can run anywhere on windows system. It also has some option of adding framework inside and the total exe size will be somewhere arround 10MB + Your application exe size..

Thanks

yes! you have to give some general instruction about prerequisites to run your software and in that you can mention the Framework version 3.5 or 4.0 and other utilities you require.

please refer this document for Choosing a Deployment Strategy in Visual studio 2010 may this can help you http://msdn.microsoft.com/en-us/library/e2444w33.aspx

when you package you application,you shoud include the .NET Framework

Check out Inno : http://www.jrsoftware.org/isinfo.php It's free and pretty simple.

OTOH I've seen QTTabBar using it in its' codebase and it was literally one single text file (setup.iss). Let me see if I can find URL to their SourceForge page so you can see the source and the build ... There is it http://qttabbar.svn.sourceforge.net/viewvc/qttabbar/trunk/Install/ If you grab the source tree you can probably re-fit it for your app in a day.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!