Deploy VB6 Application Using InnoSetup
Deploy VB6 Application Using InnoSetup
com
I. Introduction
Create an installation program is the final step in developing an application.
Given my specialty, this tutorial is necessarily very oriented Visual Basic, and mainly Section II.
But InnoSetup installatteur is a universal, and may well be used for the distribution of applications developed with other
programming languages (Delphi, for example, to mention only the latter).
Of course, for Visual Basic, there is the assistant installation deployment is supplied with basic with VB6-professional
publishing or +
But little change is so tedious, it quickly becomes a deterrent!
InnoSetup is a good alternative to this problem, offering multiple opportunities for customization, a very simple way,
without taking the lead in changing the Setup.bas of VB6!
If you're not an expert in this field, I advise you to use, in a first phase, the assistant deployment VB6 to get a file
Setup.lst, which contains the dependencies.
If you do not have the assistant VB6 (distributed only from the professional version of VB6), there are other solutions,
but we will talk later!
Find this file, it will be the basis of our installation with InnoSetup.
Some components ocx freeware may have hidden dependencies, not identified not the assistant VB.
I do not have a miracle solution and can only advise you to test your setup well before broadcast (I have had bitter
experience)
; 'C: \ Applications VB6 \ Test ADO \ Package \ SETUP.LST' imported by ISTool version 5.2.1
[Setup]
AppName = MyProgram
AppVerName = MyProgram
DefaultDirName pf = () \ MyProgram
http://techdos.com Powered by Joomla! Generated: 11 April, 2012, 18:24
www.techdos.com
DefaultGroupName = MyProgram
[Files]
[Bootstrap Files]
@ COMCAT.DLL, $ (WinSysPathSysFile), $ (DLLSelfRegister), 6/1/98 1:00:00 AM, 22288,4.71.1460.1
Source: COMCAT.DLL; DestDir: (sys); Flags: restartreplace uninsneveruninstall sharedfile regserver
@ VB6FR.DLL, $ (WinSysPath ),,$( Shared), 10/2/00 1:00:00 AM, 119568,6.0.89.88
Source: VB6FR.DLL; DestDir: (sys); Flags: promptifolder sharedfile
@ STDOLE2.TLB, $ (WinSysPathSysFile), $ (TLBRegister), 6/3/99 1:00:00 AM, 17920,2.40.4275.1
Source: STDOLE2.TLB; DestDir: (sys); Flags: restartreplace uninsneveruninstall sharedfile regtypelib
@ ASYCFILT.DLL, $ (WinSysPathSysFile),,, 3/8/99 1:00:00 AM, 147728,2.40.4275.1
Source: ASYCFILT.DLL; DestDir: (sys); Flags: restartreplace uninsneveruninstall sharedfile
@ OLEPRO32.DLL, $ (WinSysPathSysFile), $ (DLLSelfRegister), 3/8/99 1:00:00 AM, 164112,5.0.4275.1
Source: OLEPRO32.DLL; DestDir: (sys); Flags: restartreplace uninsneveruninstall sharedfile regserver
@ OLEAUT32.DLL, $ (WinSysPathSysFile), $ (DLLSelfRegister), 4/12/00 1:00:00 AM, 598288,2.40.4275.1
Source: OLEAUT32.DLL; DestDir: (sys); Flags: restartreplace uninsneveruninstall sharedfile regserver
@ Msvbvm60.dll, $ (WinSysPathSysFile), $ (DLLSelfRegister), 2/23/04 9:42:40 PM, 1386496,6.0.97.82
Source: msvbvm60.dll; DestDir: (sys); Flags: restartreplace uninsneveruninstall sharedfile regserver
[Setup1 Files]
@ DBRPRFR.DLL, $ (WinSysPath ),,$( Shared), 7/13/98 1:00:00 AM, 33280,6.0.81.63
Source: DBRPRFR.DLL; DestDir: (sys); Flags: promptifolder sharedfile
@ Stdftfr.dll, $ (WinSysPath ),,$( Shared), 11/21/00 4:46:34 AM, 6656,6.0.81.63
Source: stdftfr.dll; DestDir: (sys); Flags: promptifolder sharedfile
@ MSSTDFMT.DLL, $ (WinSysPath), $ (DLLSelfRegister), $ (Shared), 2/23/04 1:00:00 AM, 119808,6.1.97.82
Source: MSSTDFMT.DLL; DestDir: (sys); Flags: promptifolder regserver sharedfile
;
>> I've just removed the middle!
;
@ Msadox.dll, $ (WinSysPath), $ (DLLSelfRegister), $ (Shared), 8/5/04 1:00:00 PM, 200704,2.81.1117.0
Source: msadox.dll; DestDir: (sys); Flags: promptifolder regserver sharedfile
[Icons]
Name: group) (\ MyProgram; Filename: app) (\ MyProgram.exe; WorkingDir:) (app
The you show lines imported file Setup.LST (in the form of comments), and these lines can be deleted.
At this level, lies the main problem IsTools, and you will probably quickly noticed: it is not able to include the path source
for files listed!
A brief overview with what we achieved during the conversion of Setup.lst file, with explanatory comments:
[Setup]
; The name "commercial" your application to be used in the titles of windows and dialogues main
AppName = MyProgram
; The name and version of your program (visible on the home page)
AppVerName = MyProgram v1.0
; The default
DefaultDirName pf = () \ MyProgram
; Group The installation program by default, in the "Start" menu
DefaultGroupName = MyProgram
; Impose an administrator for the installation (needed for registering dll and ocx)
PrivilegesRequired = admin
To define a default source directory which will search for the files section [Files]
If the source directory is not specified
SourceDir = C: \ MyProgram
To define a Copyright
AppCopyright = Copyright © 2008 thierryaim
All options section [Setup] are easily configured in the menu "Project">> "Options installer" IsTools.
If you have any questions, please visit the forum installation VB
In this section, you can add all the folders or files to be attached to the application:
Key parameters:
Source (required): name (and folder) source file
DestDir (required): destination directory
DestName (optional): filename destination, if different from the original name
[Files]
[Redist Files]
Source: c: \ Redist \ DCom \ dcom98.EXE; DestDir:) (app; Flags: promptifolder deleteafterinstall nocompression; Tasks:
DCOM98
http://techdos.com Powered by Joomla! Generated: 11 April, 2012, 18:24
www.techdos.com
[Application Files]
Source: MyProgram.exe; DestDir:) (app; Flags: promptifolder
Source: MyProgram.ini; DestDir:) (app; Flags: promptifolder
Source: readme.txt; DestDir:) (app; Flags: promptifolder isreadme
See the list of files unsafe not to redistribute (depending on different platforms), on-line help InnoStup
For other Flags, I invite you to read the online help-Inno Setup.
III-3. The section [Dirs]
permits, during installation, creating sub-folders directory application
The example below creates files and data bin as subfolders directory application) (app:
[Dirs]
Name: app) (\ data
Name: app) (\ bin
If this section is present in the script, the installer automatically generate a selection of tasks, depending on the
specified parameters:
[Tasks]
Name: InstalRTVB6; Description: Install VB6 Runtime
Name: DCOM98; Description: COM & D 1.3 (Windows 98); GroupDescription: Complements:; Flags: checkedonce;
MinVersion: 4.1,0; OnlyBelowVersion: 4.9,0
Name: DesktopIcon; Description: Create an icon on the &bureau; GroupDescription: Icons; Flags: checkedonce
Name: QuickLaunchIcon; Description: Create an icon & Quick Start; GroupDescription: Icons; Flags: unchecked
The execution of the code will be conditioned by the preselection of the task [Tasks]:
Take the example of installation files VB6 runtime:
[Files]
[VB Runtime files]
Source: c: \ Redist \ VB_Runtime \ stdole2.tlb; DestDir: (sys); Flags: restartreplace uninsneveruninstall sharedfile
regtypelib; Tasks: InstalRTVB6
Source: c: \ Redist \ VB_Runtime \ msvbvm60.dll; DestDir: (sys); Flags: restartreplace uninsneveruninstall sharedfile
regserver; Tasks: InstalRTVB6
Source: c: \ Redist \ VB_Runtime \ oleaut32.dll; DestDir: (sys); Flags: restartreplace uninsneveruninstall sharedfile
regserver; Tasks: InstalRTVB6
Source: c: \ Redist \ VB_Runtime \ olepro32.dll; DestDir: (sys); Flags: restartreplace uninsneveruninstall sharedfile
regserver; Tasks: InstalRTVB6
Source: c: \ Redist \ VB_Runtime \ asycfilt.dll; DestDir: (sys); Flags: restartreplace uninsneveruninstall sharedfile; Tasks:
InstalRTVB6
Source: c: \ Redist \ VB_Runtime \ comcat.dll; DestDir: (sys); Flags: restartreplace uninsneveruninstall sharedfile
regserver; Tasks: InstalRTVB6
Source: c: \ Redist \ VB_Runtime \ Vb6fr.dll; DestDir: (sys); Flags: restartreplace uninsneveruninstall promptifolder
sharedfile; Tasks: InstalRTVB6
The installation will be done if and only if the task InstalRTVB6 was selected previously.
http://techdos.com Powered by Joomla! Generated: 11 April, 2012, 18:24
www.techdos.com
Parameters:
Filename: filename. Ini
Section: name of the section of the file. Ini
Key: key name of the file. Ini
String: Value of key
[INI]
Filename: app) (\ MyProgram.ini Section: Setup; Key: Language; String: French; Languages: fr; Flags:
createkeyifdoesntexist
Filename: app) (\ MyProgram.ini Section: Setup; Key: Language; String: English; Languages:; Flags:
createkeyifdoesntexist
The list of languages pre-formatted is contained in the installation folder-Inno Setup; normally your directory "C: \
Program Files \ Inno Setup 5 \ Languages"
The default language, you will have noticed, is English, coupled with the language file default.isl
For an installation in french only, you only have to set the language, replacing the default language (English):
For an installer who speaks french:
http://techdos.com Powered by Joomla! Generated: 11 April, 2012, 18:24
www.techdos.com
[Languages]
Name: fr; MessagesFile: compile: Languages \ French.isl
For a multilingual, you must define a name (abbreviation short, preferably) for each language declared.
We will, in the examples below, two languages: french and English:
Example section [Languages]
[Languages]
Name:; MessagesFile: compile: Default.isl
Name: fr; MessagesFile: compile: Languages \ French.isl
; Add below all languages that you want to make available. Examples:
Name: gr; MessagesFile: compile: Languages \ German.isl
Name: it; MessagesFile: compile: Languages \ Italian.isl
Name: sp; MessagesFile: compile: Languages \ Spanish.isl
If this section is present in your Setup program, and has more than one language declared the dialog language
selection installation will, by default, automatically displayed at the launch of the programme:
Each message must be prefixed by the name (Name) defined in section [Languages]
Example section [CustomMessages]
[CustomMessages]
; French
fr.TaskIconGroup = Icons:
fr.TaskDesktopIcon = Create an icon on the desktop &
fr.TaskQuickLaunchIcon = Create an icon & Quick Start
; English
en.TaskIconGroup = Icons:
en.TaskDesktopIcon = Create a desktop icon
en.TaskQuickLaunchIcon = Create a quicklaunch icon
Then, in the script, replace the text messages on their equivalent with the syntax: (cm: monmessage]
The text will be displayed depending on the language chosen to start the installation.
Example of section [Tasks]
[Tasks]
Name: DesktopIcon; Description: (cm: TaskDesktopIcon); GroupDescription: (cm: TaskIconGroup); Flags: checkedonce
Name: QuickLaunchIcon; Description: (cm: TaskQuickLaunchIcon); GroupDescription: (cm: TaskIconGroup); Flags:
unchecked
If you are prompted to create customized pages for the use of (cm: ..) in section [Code], I urge you to read Section
[Code] InnoSetup
V. Conclusions
To each his preferences, but I am very fond of this software, simple, easy to grip, little bigger resources, and
opportunities and options immense.
For followers of the language of Shakespeare, I urge you to read using InnoSetup for all information, mainly on Flags, it
would be difficult to describe here, as there are many possibilities.
V-1. Links
Download the latest version of Inno-Setup
Get the latest IsTools (the site is in English, but the software offers a package in French language)
A big THANK YOU to those who took a few minutes of their precious time to read me and advise me, and particularly
bbil and sjrd.