Page 1 of 3

Simple 'Automatic' Installer

Posted: Fri Dec 09, 2005 8:48 pm
by utopiomania
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

Posted: Fri Dec 09, 2005 8:55 pm
by thefool
Sounds nice. But page cannot be found :(

Posted: Fri Dec 09, 2005 9:10 pm
by utopiomania
Sorry for the inconvinience, for some reason the filename 'installer.htm' was inaccessible, but 'Installers.htm' is ok. :?: Hope it's fixed now.

Posted: Fri Dec 09, 2005 9:22 pm
by thefool
Works very nice here!
And the installer interface looks nice!

Posted: Sat Dec 10, 2005 12:44 am
by Droopy
Very good ! :D And useful 8)

Posted: Sat Dec 10, 2005 1:12 am
by dagcrack
Useful.. you say, but how are you going to convert it into a lib?

Posted: Sat Dec 10, 2005 9:24 am
by Droopy
dagcrack wrote:Useful.. you say, but how are you going to convert it into a lib?
Not this time :lol:

Posted: Sat Dec 10, 2005 10:03 pm
by dagcrack
Image

Posted: Mon Dec 12, 2005 9:10 pm
by utopiomania
@thefool, and @Droopy, thanks for taking the time to check it out! :) And, if there is any kind of problem with it, I'd like to know.

Posted: Mon Dec 12, 2005 9:26 pm
by thefool
np. Ill have a more depth look later today or tomorrow.

Posted: Wed Dec 21, 2005 9:54 pm
by utopiomania
@dagcrack, could you do me a favour and remove your stupid thread-bomb from my, ehh.. thread?

Posted: Thu Dec 22, 2005 12:20 pm
by srod
Works brilliantly. Excellent tool; this will come in very handy.

Thanks for sharing.

Posted: Thu Dec 22, 2005 12:32 pm
by Jan2004
Thanks. U-top Installer is really very good. I have just resigned from Inno Setup - after 6 years of usage.

Jan

Posted: Fri Dec 23, 2005 10:31 pm
by utopiomania
Hey! Thanks srod and jan2004 for testing! :) Glad it can be of any use, and don't hesitate to tell me of any problems
that needs to be corrected, or anything else.

Posted: Mon Dec 26, 2005 2:57 pm
by utopiomania
I have just updated it. The Installer now uses ShellExecute_() to run the installed program after the install.

RunProgram() seems to fail if Windows aks for a confirmation before allowing the installed program to run.

Also, because of this confirmation, the Installer window is no longer topmost. And it has got a different header
logo.