Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installer for C# App

I'm developing an open source C# application. For awhile now, I've been using a basic .NET installer I coded myself. However, with a recent change, that is no longer practical for me, as I'd have to add a large number of files to the installer - and they may change with each release. A ZIP file is also not practical.

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

Actual installing of my program is very simple. Basically, I just need to copy the bin\Release directory (and all subdirs) to the client's computer. I've been achieving this somewhat ad-hoc, by embedding every file in my .NET installer, and maintaining a file table of what goes where.

Unfortunately, I just localized my app. I now have 30+ .resx files (Which are compiled to dlls and placed into MORE subdirectories by Visual Studio) and, obviously, it's impractical to add 30+ folders and DLLs to my installer. Hence why I'm on this search.

There's also a few other requirements:

  • The installer should search predefined directories for a specified .exe. (My app is designed to be a drop in replacement) If the .exe is not found, it should prompt for its location
  • The installer should verify that "OldApp.exe.bak" exists. If not, it should rename "OldApp.exe" to "OldApp.exe.bak"
  • The installer should update files. Ie, if "Culture.de.dll" hasn't changed, the installer will leave it alone.
  • The installer should work with all Windows versions of all .NET IDEs (VS, SharpDevelop, Mono, ect) but does not need to work on other platforms.
  • When I build the solution, the installer should be automatically regenerated. In other words, it should be run-able for by "Post-build" section.
  • The installer generation must be able to be added to a source code repo. This is so that anyone who downloads the source of my app can compile the installer as well.

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

like image 314
Xcelled Avatar asked Apr 16 '12 17:04

Xcelled


People also ask

Can I download C for free?

C and C++ coding made easier It comes with a lot of integrated features to assist you during the coding process. So whether you're a professional coder or a beginner, you can download and use C-Free.

How can I install C language in my laptop?

Method 1: Install Dev C++ Install Dev C++ from sourceforge.com. Dev-C++ is a integrated development environment (IDE) for programming in C and C++. It is bundled with, the MinGW or TDM-GCC 64bit port of the GCC as its compiler. You can check out the video below to see how to install this IDE.


2 Answers

I'd recommend SharpSetup. It combines WiX and C# for a pretty flexible implementation. Not much I've found it can't accomplish.

like image 57
Grant H. Avatar answered Sep 27 '22 21:09

Grant H.


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

You may have to customize your installers with some exit routines to do things out of the ordinary, but there are hooks in Windows Installer framework that let you do that.

You can put these definition files (XML) in your source control, and you can configure a build to execute the installation. However, anyone that gets your source would need to have the WIX utilities installed.

like image 32
Robaticus Avatar answered Sep 27 '22 22:09

Robaticus