Difference between revisions of "Setups"
(First version of creating a setup in Inno) |
(Update to work with Windows Vista) |
||
(3 intermediate revisions by one user not shown) | |||
Line 3: | Line 3: | ||
There number of options to create a setup for your application as follows: | There number of options to create a setup for your application as follows: | ||
− | # VB Package and Deployment wizard (PDW) | + | # [http://msdn.microsoft.com/library/en-us/vbcon98/html/vbconcreatingsetupprogram.asp VB Package and Deployment wizard (PDW)] |
− | # Microsoft Visual Installer, an addon to Visual Studio | + | # [http://msdn.microsoft.com/vstudio/downloads/tools/vsi11/default.aspx Microsoft Visual Installer], an addon to Visual Studio |
− | # Inno Setup | + | # [http://www.jrsoftware.org/isinfo.php Inno Setup] |
− | # Wise Installer | + | # [http://www.wise.com/wis.asp Wise Installer] |
− | # InstallSheild | + | # [http://www.installshield.com/ InstallSheild] |
− | # Nullsoft Scriptable Install System (NSIS) | + | # [http://nsis.sourceforge.net/ Nullsoft Scriptable Install System (NSIS)] |
Personally, I have had 1st hand experience of PDW, Visual Installer and Inno, and I find Inno by far the best. | Personally, I have had 1st hand experience of PDW, Visual Installer and Inno, and I find Inno by far the best. | ||
− | VB PDW has various known issues installing where it can get stuck in a perpetual reboot loop. | + | VB PDW has various known issues installing where it can get stuck in a perpetual reboot loop. It is also written in VB so requires a two step install to install the runtimes, and then to run the real setup, often with a reboot in the middle. On top of that, it is not very customisable. |
Visual Installer was the next step up and created Microsoft Installer packages. The setup wasn't customisable at all beyond changing the graphics and a few UI elements, and it relied on the ever problematic Windows Installer. This had further problems of not being able to upgrade applications without a full uninstall first. | Visual Installer was the next step up and created Microsoft Installer packages. The setup wasn't customisable at all beyond changing the graphics and a few UI elements, and it relied on the ever problematic Windows Installer. This had further problems of not being able to upgrade applications without a full uninstall first. | ||
Line 29: | Line 29: | ||
AppVerName=HashVB Test App 2.4 | AppVerName=HashVB Test App 2.4 | ||
AppPublisher=HashVB | AppPublisher=HashVB | ||
− | AppPublisherURL=http://www.earlsoft.co.uk/hashvb/ | + | AppPublisherURL=<nowiki>http://www.earlsoft.co.uk/hashvb/</nowiki> |
− | AppSupportURL=http://www.earlsoft.co.uk/hashvb/ | + | AppSupportURL=<nowiki>http://www.earlsoft.co.uk/hashvb/</nowiki> |
− | AppUpdatesURL=http://www.earlsoft.co.uk/hashvb/ | + | AppUpdatesURL=<nowiki>http://www.earlsoft.co.uk/hashvb/</nowiki> |
DefaultDirName={pf}\HashVB Test App | DefaultDirName={pf}\HashVB Test App | ||
DefaultGroupName=HashVB Test App | DefaultGroupName=HashVB Test App | ||
Line 53: | Line 53: | ||
This information is mostly taken from the [http://www.jrsoftware.org/iskb.php?vb InnoSetup Knowledge base]. | This information is mostly taken from the [http://www.jrsoftware.org/iskb.php?vb InnoSetup Knowledge base]. | ||
− | As it is never a good idea to copy files directly | + | As it is never a good idea to copy files directly from the system directory, you will need to get the most recent redistributable files and extract them into a separate directory. These can be downloaded from [http://www.jrsoftware.org/download.php/vb6sp6sys.zip The Inno Setup website] or direct from the [http://www.microsoft.com/downloads/details.aspx?FamilyId=7B9BA261-7A9C-43E7-9117-F673077FFB3C&displaylang=en Microsoft Download Center]. |
;VB system files | ;VB system files | ||
− | Source: "vbfiles\msvbvm60.dll"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regserver | + | Source: "vbfiles\msvbvm60.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver |
− | Source: "vbfiles\oleaut32.dll"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regserver | + | Source: "vbfiles\oleaut32.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver |
− | Source: "vbfiles\olepro32.dll"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regserver | + | Source: "vbfiles\olepro32.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver |
− | Source: "vbfiles\asycfilt.dll"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile | + | Source: "vbfiles\asycfilt.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile |
− | Source: "vbfiles\comcat.dll"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regserver | + | Source: "vbfiles\comcat.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver |
+ | |||
+ | Please note that these are installed by default on windows XP and can't be replaced on Windows Vista so we add the OnlyBelowVersion directives. | ||
As this may be replacing system files, you will need admin privileges to install so I recommend adding this line to the [setup] section: | As this may be replacing system files, you will need admin privileges to install so I recommend adding this line to the [setup] section: | ||
Line 76: | Line 78: | ||
* [http://www.istool.org/ ISTool] - A GUI interface to the Inno scripts | * [http://www.istool.org/ ISTool] - A GUI interface to the Inno scripts | ||
* [http://www.randem.com/innoscript/innoscript.htm InnoScript] - Generates a prewritten Inno script from a Visual Basic project file | * [http://www.randem.com/innoscript/innoscript.htm InnoScript] - Generates a prewritten Inno script from a Visual Basic project file | ||
+ | * [http://www.mirality.co.nz/inno/tips.php Inno Setup Tips & Tricks] |
Latest revision as of 20:33, 26 December 2006
So, you have written your application, made it look all wizzy and it works fine. You then go and copy it to a friends PC to test and it crashes. VB applications, like programs written in almost every other language, have runtimes and dependencies. This normally makes your application slightly more complicated than just "copy and run". You need an installer.
There number of options to create a setup for your application as follows:
- VB Package and Deployment wizard (PDW)
- Microsoft Visual Installer, an addon to Visual Studio
- Inno Setup
- Wise Installer
- InstallSheild
- Nullsoft Scriptable Install System (NSIS)
Personally, I have had 1st hand experience of PDW, Visual Installer and Inno, and I find Inno by far the best.
VB PDW has various known issues installing where it can get stuck in a perpetual reboot loop. It is also written in VB so requires a two step install to install the runtimes, and then to run the real setup, often with a reboot in the middle. On top of that, it is not very customisable.
Visual Installer was the next step up and created Microsoft Installer packages. The setup wasn't customisable at all beyond changing the graphics and a few UI elements, and it relied on the ever problematic Windows Installer. This had further problems of not being able to upgrade applications without a full uninstall first.
I then moved onto Inno which was a breath of fresh air. It is based on a text "script" file that lists all the files to be installed to where, icons, UI, extra code, etc... The installer itself is very customisable out the box with options to control which screens the users see, graphics, what they can and cant do. It can also be expanded using a relatively simple Pascal script which allows you to create your own screens, and much more.
This is the basis for this article.
Sample script
This is a sample script created using the Wizard which appears when you first start Inno Setup.
[Setup] AppName=HashVB Test App AppVerName=HashVB Test App 2.4 AppPublisher=HashVB AppPublisherURL=http://www.earlsoft.co.uk/hashvb/ AppSupportURL=http://www.earlsoft.co.uk/hashvb/ AppUpdatesURL=http://www.earlsoft.co.uk/hashvb/ DefaultDirName={pf}\HashVB Test App DefaultGroupName=HashVB Test App OutputBaseFilename=setup [Files] Source: "C:\Program Files\Inno Setup\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion [Icons] Name: "{group}\HashVB Test App"; Filename: "{app}\MyProg.exe" [Run] Filename: "{app}\MyProg.exe"; Description: "{cm:LaunchProgram,HashVB Test App}"; Flags: nowait postinstall skipifsilent
This is about the minimum amount required for Inno. It will ask the user where to install the application (defaulting to Program Files\HashVB Test App) and what group on the start menu to put the icons under.
VB Runtimes
To install a VB based application, you will need to make sure that the VB runtimes are installed.
This information is mostly taken from the InnoSetup Knowledge base.
As it is never a good idea to copy files directly from the system directory, you will need to get the most recent redistributable files and extract them into a separate directory. These can be downloaded from The Inno Setup website or direct from the Microsoft Download Center.
;VB system files Source: "vbfiles\msvbvm60.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver Source: "vbfiles\oleaut32.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver Source: "vbfiles\olepro32.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver Source: "vbfiles\asycfilt.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile Source: "vbfiles\comcat.dll"; DestDir: "{sys}"; OnlyBelowVersion: 0,6; Flags: restartreplace uninsneveruninstall sharedfile regserver
Please note that these are installed by default on windows XP and can't be replaced on Windows Vista so we add the OnlyBelowVersion directives.
As this may be replacing system files, you will need admin privileges to install so I recommend adding this line to the [setup] section:
PrivilegesRequired=admin
Other files
If your application makes use of other files including DLLs, OCXs, etc, you will need to make sure these are installed as well by adding them to the [files] section. All OCX files, and a fair amount of DLL files, will need to be registered so make sure you specify the regserver flag if it is needed. The general rule is to use regserver, and remove it if it errors. You can check this manually by running regsvr32 and passing the filename. If it says the "DllRegisterServer" entry point is not found, it can not be registered.
Source: "ComCtl32.ocx"; DestDir: "{sys}"; Flags: restartreplace sharedfile regserver
See Also
- Inno Setup website
- ISTool - A GUI interface to the Inno scripts
- InnoScript - Generates a prewritten Inno script from a Visual Basic project file
- Inno Setup Tips & Tricks