How to create a robust, minimal installer for Windows?

WindowsInstallation

Windows Problem Overview


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?

Windows Solutions


Solution 1 - Windows

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

Solution 2 - 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.

Solution 3 - Windows

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

Solution 4 - Windows

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?

Solution 5 - Windows

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.

Solution 6 - Windows

It come to my attention that this answer is still being read. This answer is over 5 years old and much of the information here may not be relevant anymore. Using IExpress also comes with its risks as well, which you can learn more about here.

If you wish to proceed anyways, here is the old answer:

IExpress

You can use Microsoft Windows's built in installer wizard called "Iexpress". To access that, open "Run", which is done by hitting Windows Key and R at the same time(WindowsKey+R). When you get in "Run", type in the little box "iexpress.exe". Then hit enter. You are there!

Notes: Only available on Microsoft Windows (Legit, and NonLegit)

Setup Explained:
Page 1

  • Create a Self Extraction Directive file.
    Makes a new installation file
  • Create a Self Extraction Directive file.
    Edits a .SED file
    Page 2 (Of Create a Self Extraction Directive file.)
  • Look in the "Description" at the bottom
    Page 3
  • Package Title
    The name of your installer, as displayed at the top
    Page 4
  • Confirmation Prompt
    What to tell the user before installing
    Page 5
  • License Agreement
    Skip if you don't know what this is
    Page 6
  • Packaged Files
    What files you need to install
    Page 7
  • Show Window How the window is displayed
    Page 8
  • Displayed At Top Page 9
  • Package Names and Options Where to save your File
  • Hide File Extracting Progress From User Hides the animation
  • Store File using Long Name inside installer Ignore if you don't know what this is Page 10
  • Displayed At Top
    You are done!
    Click on the Title to download the file, without doing those instructions. If it is a virus, got infected or you think it is a virus, feel free to delete the file.

Solution 7 - Windows

You can create a single installer file using just Visual Studio 2017 Pro and Windows in 3 steps:

  1. To have an entry in the Add/Remove Programs, you need to have a setup project.
  2. The setup project may compile into 2 files: *.msi and setup.exe
  3. To create a self-extracting package, you can use the IExpress tool

Solution 8 - Windows

NSIS, MSI any installer can do that for you.

NSIS is pretty small and compact.

Solution 9 - Windows

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.)

Solution 10 - Windows

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.

Solution 11 - Windows

InstallShield has a release option called "Single .EXE". It can bundle the payload inside, plug register w/Add-Remove Programs as you specified.

Solution 12 - Windows

If you want to use standard deployment methods with your installer you probably should stay away from NSIS. See http://unattended.sourceforge.net/installers.php for an overview.

Solution 13 - Windows

I recommend using the Microsoft Visual Studio Installer Project. It is pretty easy to use.

https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2017InstallerProjects

You can install it as an extension in visual studio.

Solution 14 - Windows

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMatView Question on Stackoverflow
Solution 1 - WindowsOtávio DécioView Answer on Stackoverflow
Solution 2 - WindowsRobView Answer on Stackoverflow
Solution 3 - WindowsMarkJView Answer on Stackoverflow
Solution 4 - WindowsMartinView Answer on Stackoverflow
Solution 5 - WindowsjustadreamerView Answer on Stackoverflow
Solution 6 - WindowsMineCMDView Answer on Stackoverflow
Solution 7 - Windowsuser8228677View Answer on Stackoverflow
Solution 8 - Windowsdr. evilView Answer on Stackoverflow
Solution 9 - WindowsApe-inagoView Answer on Stackoverflow
Solution 10 - WindowsNikhilView Answer on Stackoverflow
Solution 11 - WindowsWilliam LearaView Answer on Stackoverflow
Solution 12 - Windowsko-dosView Answer on Stackoverflow
Solution 13 - WindowsChris S.View Answer on Stackoverflow
Solution 14 - WindowsAndrey YankovichView Answer on Stackoverflow