I want to create an installer EXE with some specific properties:
- it should be a single exe file
- it should be robust (i.e. the technique should be known to work well on any Windows system)
- it should create only a single file (a .scn screensaver file) in %systemroot%
- 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?
InstallShield has a release option called "Single .EXE". It can bundle the payload inside, plug register w/Add-Remove Programs as you specified.
Take a look at NSIS it is quite simple and it is used to create installers for Windows.
You can create a single installer file using just Visual Studio 2017 Pro and Windows in 3 steps:
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.
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
filePage 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.
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.)