Click here to Skip to main content
6,306,412 members and growing! (18,516 online)
Email Password   helpLost your password?
Development Lifecycle » Installation » General     Intermediate

Little Install Builder

By Pablo van der Meer

Building setup programs using Microsoft's setup scripts.
VC6, VC7Win2K, WinXP, MFC, Dev
Posted:30 Jul 2002
Views:59,247
Bookmarked:33 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
20 votes for this article.
Popularity: 5.92 Rating: 4.55 out of 5

1

2

3
2 votes, 11.8%
4
15 votes, 88.2%
5

Sample Image

Description

There are a lot of setup programs available, but I found that their code may add more than 250KB to the total size of the final setup application, and because most of my applications are not much bigger than 100KB, I decided to write my own installation builder.

The application does not have all the features available in commercial setup builders, but it's a good start (I think...). Maybe in the future I will extend the installation builder with more features, but for now I found it good enough for my needs. If you have any suggestions or improvements please let me know!

Little Install Builder is made up out of two parts:

  1. Installation Builder -> Used to create the installation package.
  2. Setup Program -> The actual setup application.

Installation Builder

The installation builder is a simple SDI application with a tabbed form where you can enter all the information needed by the setup program. For example: add files, assign shortcuts and other setup specific variables. You can also use the wizard, which will guide you through the necessary steps of creating a setup program for your software product.

The application has 4 tab-pages:

  1. General, where you can enter application name, company name and so on.
  2. Files, this is where you specify all files that are needed to be distributed.
  3. Shortcuts, for specifying shortcuts in the program folder (start menu).
  4. Output, the final step where you enter the output directory.

After you entered all the necessary information you can build the setup program. This creates a single output file that contains all setup information and files needed for installation.
I decided to use no compression because most setups are distributed as zip files, so why compress it twice? The generated output file is made up from 3 parts:

  1. The setup program = stub.exe (which unpacks the files, asks for destination folder and executes setup script).
  2. All files needed for the distribution glued together.
  3. The setup script, which is a Windows compatible Setup Script that does all the installation stuff for us.

Setup Program

The setup program performs the following tasks:

  1. Extract all files from the distribution package.
  2. Ask for a destination folder and program folder.
  3. Execute setup (.inf) script.

The .inf file describes the actions in the setup process such as:

  • Copying the files to the right place.
  • Creating a start menu shortcut.
  • Providing an uninstall procedure.
All these actions are taken care of by Windows, so we don't have to implement them ourselves!

Implementation Highlights

Because there's too much code to explain, I'll just give you a list of implementation highlights.
This project shows you how to:

  • Create a self-extracting setup file.
  • Create a simple .inf setup script.
  • Run an executable that is linked in your resources.
  • Create a setup wizard and run the setup script.
  • Keep yourself busy for a while...
One of the problems I ran into was the lack of support for long file names when using Windows setup scripts. So I had to build a rename table (in the setup file), which renames all short names back to their original names. Even the latest version of syssetup.dll (in XP) can't handle long filenames without problems!

Contacting the Author

Please send any comments or bug reports to me via email. For any updates to this article, check my site here.

Revision history

  • 22th May 2002 - Initial revision.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Pablo van der Meer


Member
Pablo has been programming in C/C++ for 8 years and Visual C++/MFC for 6 years.
He is interested in music, blonde women and programming. His background includes telecommunication, electronics and software engineering, and he is currently based in 't Westland, The Netherlands.
Pablo van der Meer is developing software for a small Dutch telecom company. Besides programming Pablo is active as a dj/producer and creates various styles of music.

Check out my website for lots of other MFC articles:http://www.pablosoftwaresolutions.com

Occupation: Web Developer
Location: Netherlands Netherlands

Other popular Installation articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 15 of 15 (Total in Forum: 15) (Refresh)FirstPrevNext
Generallol Pinmembermp4city10:49 28 Dec '05  
GeneralCan I register ActiveX/DLL PinmemberBalkrishna Talele1:24 15 Sep '04  
GeneralRe: Can I register ActiveX/DLL PinmemberPablo van der Meer2:31 15 Sep '04  
GeneralXP PinmemberSantangelo Angelo22:20 6 Nov '03  
GeneralRe: XP Pinmemberconman 510:09 3 Jun '05  
GeneralMFC Static Lybrary PinmemberSantangelo Angelo23:47 16 Oct '03  
GeneralRe: MFC Static Lybrary PinmemberPablo van der Meer1:45 17 Oct '03  
GeneralRe: MFC Static Lybrary PinmemberSantangelo Angelo2:22 17 Oct '03  
Generalquestion PinmemberAchim Mueller7:49 6 May '03  
Generalquestion Pinmembershotgun12:26 5 Sep '02  
GeneralRe: question PinmemberPablovanderMeer2:56 6 Sep '02  
Generalwhat about windows installer... PinmemberMario M.15:57 2 Aug '02  
GeneralRe: what about windows installer... PinmemberYoSilver10:00 25 Aug '02  
GeneralRe: what about windows installer... PinmemberMario M.13:52 25 Aug '02  
GeneralRe: what about windows installer... PinsussJeyRun2:24 27 Nov '02  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 30 Jul 2002
Editor: Genevieve Sovereign
Copyright 2002 by Pablo van der Meer
Everything else Copyright © CodeProject, 1999-2009
Web11 | Advertise on the Code Project