How to create a robust, minimal installer for Windows?

Viewed 75241

I want to create an installer EXE with some specific properties:

  1. it should be a single exe file
  2. it should be robust (i.e. the technique should be known to work well on any Windows system)
  3. it should create only a single file (a .scn screensaver file) in %systemroot%
  4. it should add the option to uninstall that particular file in "Control Panel -> Add or Remove Programs" but without creating any new entry C:\Program Files or copying an uninstaller.exe somewhere.

I've seen installers that work like that - so how to do this?

14 Answers

Take a look at NSIS it is quite simple and it is used to create installers for Windows.

As you've said it can be an MSI, I'd suggest going down that route.

You could play around with installer projects in Visual Studio (if you have it; I'm not sure if the Express editions support making installers), as they'll quite happily produce an MSI that will do what you're asking. It's worth noting they'll produce an EXE and an MSI, you only need to distribute the MSI though.

Failing that, take a look at Windows Installer XML (WiX) as that will let you hand sculpt an MSI that does exactly what you want it to do and will cater for all five of your points above.

Note: Using an MSI will mean that you'll need to have Windows Installer on the machine you're installing to - It's in-box from Windows 2000/ME upwards.

I've heard good things about the free installer Innosetup, and the website says it can create single EXE installs.

Try Advanced Installer, I think it can do all that you ask. I use it for slightly more complex installers but the free version is easy to use and powerful.

There can be an issue with MSI files, older PCs don't have the latest Windows Installer, 3.1, so you need to install that or prompt the user to, first! Have you looked into using IExpress if you just want to copy a file across?

Both NSIS and Inno Setup will cope with all the tasks specified. Inno Setup uses a Pascal-like language for its scripts, NSIS uses its own script language.

NSIS, MSI any installer can do that for you.

NSIS is pretty small and compact.

The not copying an installer somewhere and adding an entry into Add/Remove seem to be counteractive. My understanding is that add-remove programs neccesarily references a copy of the uninstaller that resides in a Windows directory (so it doesn't lose access to it).

Perhaps you could have the screensaver double as an uninstaller if you pass it some sort of command-line option. Then simply tell the msi that the uninstaller IS the screensaver (hence no unnecessary coping to some other directory.)

NSIS is the way to go, very simple to learn, just write a simple file specifying which files you want to install over where. You can also add QuickLaunch options and so on. Then run the NSIS compiler and you get the exe.

Try the CQtDeployer tool. This tool using the Qt Installer Framework for create installers and supports Windows and Linux platforms.

  1. Install the cqtdeployer tool. I am recommended use the online installer, because it has the latest version of cqtdeployer with minor bug fixes.
  2. Open the cmd with your framework envirement.
  3. Run the cqtdeployer for your application on the cmd.
cqtdeployer -bin path\to\myApp.exe qif 

If you use Qt then add the qmake option.

cqtdeployer -bin path\to\myApp.exe -qmake path\to\qmake.exe qif 

For more examples of using this util see the CQtDeployer Wiki

Related