Simple 'Automatic' Installer
Posted: Fri Dec 09, 2005 8:48 pm
This is a simple 'Automatic' Installer, in the way that if you finish a program and put the program and its files together
with 'Install.exe' in a folder, you can ask users to unzip the folder and run 'install.exe' to install the program.
The installer will copy what's in there to the appropriate folder, create a desktop shortcut, create a program group and
some shortcuts in Start/Programs. It will also create the necessary registry entries to uninstall the program through
Control Panel Add/Remove programs.
To do this properly the Installer looks for some filenames in the folder it runs from:
1) The installed program need to be on the form Name10.exe, a name and some numeric version info. An exe on that
form will be interpreted as Name 1.0, and this will be used to name some elements during the installation process.
2) If it find's an 'Install.png' it will be used for the header background logo. (600x60 px)
3) If it find's a 'licence.txt' it will be used for the required program licence.
4) If it finds a filename containing the word 'help' it will link to it in the program group.
5) If it finds a filename containing the word 'readme' it will link to it too.
The uninstall is clean, provided that your program doesn't add or save anything to the folder it is installed in. If it does,
the original copied files are deleted, but the added files and the folder structure itself are not deleted.
I've put together two demos that install another small app (the htm editor I posted recently). Compare the folder file
contents with the final result to get a grip on how it works:
1) A zipped install. Unzip, open and run install.exe. This folder also contains the installer source, an install.jpg (header
logo), and an install.txt (licence) that you can use (at your own risk).
2) An install using the free MS IExpress program to create a self extracting install package.
Please note that if you compile and run the source directly, the resulting program is created in the compilers folder, not
in the source folder you put the source in, and it is going to attempt to install the compilers folder on your computer if you
click 'Finish', and you will have to remove it manually.
If you want to modify and run the source, create an executable in a test folder and run that instead using a desktop
shortcut to it, but comment out any unwanted actions.... Have fun installing
Edit:20071016:
The source to the installer and a licence.txt is now posted below:
here
with 'Install.exe' in a folder, you can ask users to unzip the folder and run 'install.exe' to install the program.
The installer will copy what's in there to the appropriate folder, create a desktop shortcut, create a program group and
some shortcuts in Start/Programs. It will also create the necessary registry entries to uninstall the program through
Control Panel Add/Remove programs.
To do this properly the Installer looks for some filenames in the folder it runs from:
1) The installed program need to be on the form Name10.exe, a name and some numeric version info. An exe on that
form will be interpreted as Name 1.0, and this will be used to name some elements during the installation process.
2) If it find's an 'Install.png' it will be used for the header background logo. (600x60 px)
3) If it find's a 'licence.txt' it will be used for the required program licence.
4) If it finds a filename containing the word 'help' it will link to it in the program group.
5) If it finds a filename containing the word 'readme' it will link to it too.
The uninstall is clean, provided that your program doesn't add or save anything to the folder it is installed in. If it does,
the original copied files are deleted, but the added files and the folder structure itself are not deleted.
I've put together two demos that install another small app (the htm editor I posted recently). Compare the folder file
contents with the final result to get a grip on how it works:
1) A zipped install. Unzip, open and run install.exe. This folder also contains the installer source, an install.jpg (header
logo), and an install.txt (licence) that you can use (at your own risk).
2) An install using the free MS IExpress program to create a self extracting install package.
Please note that if you compile and run the source directly, the resulting program is created in the compilers folder, not
in the source folder you put the source in, and it is going to attempt to install the compilers folder on your computer if you
click 'Finish', and you will have to remove it manually.
If you want to modify and run the source, create an executable in a test folder and run that instead using a desktop
shortcut to it, but comment out any unwanted actions.... Have fun installing

Edit:20071016:
The source to the installer and a licence.txt is now posted below:
here