Installer for C # application

I am developing an open source C # application. Some time ago, I used the basic .NET installer, which I myself encoded. However, with a recent change, this is no longer practical for me, since I would have to add a large number of files to the installer - and they can change with each version. A zip file is also not practical.

I checked online, I see a lot of MSI, ClickOnce, Self-extracting ZIPs and the (most promising) NSIS system. None of them seem to fit my needs exactly, so I'm looking for tips on which system to use.

The actual installation of my program is very simple. Basically, I just need to copy the bin \ Release directory (and all the sub-folders) to the client computer. I accomplished this with a few ad-hoc by inserting each file into my .NET installer and maintaining a file table of what is happening.

Unfortunately, I just localized my application. I now have 30 + .resx files (which are compiled in dll and placed in the MORE Visual Studio subdirectory), and it is obviously impractical to add 30+ folders and DLLs to my installer. Therefore, why am I in this search.

There are also several other requirements:

  • The installer should look for predefined directories for the specified .exe. (My application is for replacement). If the .exe file is not found, it should request its location
  • The installer must ensure that "OldApp.exe.bak" exists. If not, it should rename "OldApp.exe" to "OldApp.exe.bak"
  • The installer must update the files. That is, if "Culture.de.dll" has not changed, the installer will leave it alone.
  • The installer should work with all versions of Windows of all .NET IDEs (VS, SharpDevelop, Mono, ect), but should not work on other platforms.
  • When I create a solution, the installer should automatically recover. In other words, it must be running for the "After Build" section.
  • Installer generation must be added to the source code repository. This means that anyone who downloads the source of my application can also compile the installer.

Sorry for the long post, I thought it was better to post more than less.

+6
source share
4 answers

I would recommend SharpSetup . It combines WiX and C # for a fairly flexible implementation. Not as much as I found, this cannot be achieved.

+5
source

We widely use WIX: http://wix.codeplex.com/

You may need to configure your installers using some exit procedures to do something unusual, but there are hooks in the Windows Installer environment that allow you to do this.

You can put these definition (XML) files in your source control, and you can customize the assembly to complete the installation. However, anyone who gets your source must have the WIX utilities installed.

+2
source

WIX is good. According to Wikipedia , it is used by Microsoft to create installers for some of its products.

+1
source

I would recommend NSIS. In my experience, any installer function I need has been covered in NSIS documentation or community examples. I cannot comment on the integration of NSIS with Visual Studio, since I am using NSIS integrated with my Jenkins build server. It appears that the free Visual Studio add-in is called Visual and Installer , which provides NSIS integration using Visual Studio. I personally have not used it, but it seems that it is actively developing, so it’s worth checking.

+1
source

Source: https://habr.com/ru/post/913347/


All Articles