views:

540

answers:

11

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?

+6  A: 

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.

Rob
No, the Express versions dont support making installers.
Martin
So i gave Visual Studio and the installer project a try, but the created MSI wants to create a Folder in the windows "Program Files" folder. I could not remove that from the installer since it told me that this is a required folder and cannot be removed :( So now i'm going to give NSIS a try...
Mat
WiX has been recommended by the Microsoft Windows Installer team - quite a recommendation. http://blogs.msdn.com/windows_installer_team/archive/2006/05/12/595950.aspx
MarkJ
+10  A: 

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

Otávio Décio
+1 because you're the only one to actually link to NSIS.
scvalex
I found this GUI tool very helpful for the set up of my install scripthttp://nsis.sourceforge.net/NSIS_Script_Editor
For something this simple, NSIS is the best bet.
sascha
A: 

NSIS, MSI any installer can do that for you.

NSIS is pretty small and compact.

dr. evil
+5  A: 

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

MarkJ
For start Inno Setup is better, because have an Wizard to make the setup file.
Nathan Campos
Innosetup is very easy, just copy the example file and add the name of your own exe. You don't need the pascal scripting unless you need to o something very complex
Martin Beckett
A: 

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

Ape-inago
With an MSI, Windows caches it in %windir%\installer anyway, so it doesn't create any files in %programfiles% or anywhere else, which I guess probably satisfies the spirit of point 5, if not the exact wording =)
Rob
it seemed very specific "or not coping uninstaller somewhere"... cacheing vs coping?
Ape-inago
caching is actually fine if that chache folder is hidden from the user anyway
Mat
+1  A: 

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.

Nikhil
+1  A: 

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.

justadreamer
A: 

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.

ko-dos
A: 

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?

Martin
A: 

I'm using Actual Installer. Try it!

A: 

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

William Leara