![]() |
![]() |
|
![]() |
Using Inno to Install a Paradox Application © 2003 Ken Loomis Editor's note: In order to keep the text of this article within the limits of a maximized browser window at 800x600 resolution, it was necessary to break some of the script and registry lines. When viewing the script and registry lines below, please note that comment lines which begin with a semicolon (;) belong on their own line, lines indented two spaces should be joined with the unindented line above them. Preface InnoSetup is a free installer program that offers a high degree of flexibility for installing applications. As a replacement for the Paradox Distribution Expert it solves many of the limitations of the PDE especially in allowing you to install your custom icons and in allowing the user to select directory locations for the application. With the addition of the Inno extensions and a bit of Pascal programming, you can do virtually anything with Inno. Many former InstallShield users are grateful to have discovered Inno. You can download a copy of Inno from: http://www.jrsoftware.org/isinfo.php. To begin, download and install InnoSetup. To install a Paradox application you must install 3 main parts. 1. The BDE, 2. Paradox Runtime, and 3. your application and its data files. This article shows how to install all three parts. For information on using the extensions, go to the extensions page, http://www.wintax.nl/isx/ If you are interested in using it, download it, and see the sample scripts that come with it. Entering the Setup Information Before you do anything you need to complete the setup section of the Inno script. Here is a sample from one of my applications with some annotation. Note: comments in Inno must be on a line by themselves. The comments here on the same line as Inno commands must be removed. "MyApplication", "MyDomain", and "MyApp" have been substituted for real product names and locations. [Setup] AppName=MyApplication AppVerName=MyApplication 1.3.0 ; me AppPublisher=IT Resources ; the app's web page AppPublisherURL=http://www.MyDomain.com/software/MyApplication.html AppSupportURL=http://www.MyDomain.com/software/MyAppSupport.html AppUpdatesURL=http://www.MyDomain.com/dload/MyAppUpdate.html ; unless the user specifies a different directory, ; this is the directory where the application goes DefaultDirName=C:\MyApp ; This ensures the user gets to choose a directory for the install DisableDirPage=no DefaultGroupName=MyApplication DisableProgramGroupPage=yes ; the path to the license doc on my machine LicenseFile=C:\MyApplication\Documents\License.rtf ; the path to the readme doc on my machine InfoAfterFile=C:\MyApplication\Documents\Readme.rtf ; the install requires admin privileges PrivilegesRequired=Admin ; my custom graphic (optional) WizardSmallImageFile=C:\MyApplication\graphics\isi.bmp ; my other custom graphic (optional) WizardImageFile=C:\MyApplication\graphics\isilrg.bmp ; this is the name of the resultant setup exe. It will go into Inno's output directory OutputBaseFilename=MyAppSetup ; requires a restart after install AlwaysRestart=yes [Messages] ; I add this in for a little pizzazz BeveledLabel= MyApplicationI include the following to create a directory where PDOX puts the config files, although I'm not sure they always get there (depends on the operating system). [Dirs] Name: "C:\Program Files\Corel\Paradox 9 Runtime\Programs\config" Installing Your Application Files Next, you want to install your application files. Here are all the files for my application. The source is the location on my machine, the DestDir is the location on the target machine. See the Constants section of the Inno help to understand the constants. Here {app} refers to the default dir name in the setup section or the directory the user picks in Inno's Dir Page. {sys} refers to the Windows system directory. [Files] Source: "C:\MyAppDeliver\*.*"; DestDir: "{app}"; Flags: promptifolder Source: "C:\MyAppDeliver\MyAppapp\*.*"; DestDir: "{app}\app"; Flags: promptifolder Source: "C:\MyAppDeliver\Private\*.*"; DestDir: "{app}\private"; Flags: promptifolder ;The destination directory for tables shown below uses InnoExtensions, not shown here. ;The "code:" part refers to a user selected directory. Source: "C:\MyAppDeliver\MyApptbl\*.*"; DestDir: ""{code:GetDataDir}"; Flags: promptifolder"; Flags: promptifolder ;The following line installs the OCX files that require registration. ;The regserver flag registers them. Source: "C:\MyAppDeliver\ActiveX\*.*"; DestDir: "{sys}"; Flags: regserver Loading the BDE See the FAQ section of the Inno website for information on installing the BDE: http://www.jrsoftware.org/ishowto.phtml?a=bde You should acquire the file BdeInst.dll. You can find this in your BDE cab files or you can download it from an address at the Inno website FAQ section. You will also need the file, miniReg.exe, which you can also get from the Inno website. Now, continuing the [Files] section above, add these files to the target machine. {tmp} refers to the windows temporary directory. BdeInst.dll contains all the BDE files you need for the install. Source: "MiniReg.exe"; DestDir: "{tmp}" Source: "BdeInst.dll"; DestDir: "{tmp}" Installing Paradox Runtime Continuing the [Files] section, add the Runtime files. {pf} is the Inno constant for the program files directory. If you are using PDOX 8 or 9 you should install the PDE, if you haven't already, and find the files in the redist directory, and then load them as shown below: Source: "C:\Program Files\Corel\Paradox 9 Runtime\Programs\*.*"; DestDir: "{pf}\Corel\Paradox 9 Runtime\Programs"; Flags: promptifolder Source: "C:\Program Files\Corel\Pde\config\redist\*.*"; DestDir: {sys}If you want to install the runtime help files do it this way: Source: "C:\Program Files\Corel\Paradox 9 Runtime\Paradox\PdoxRun9.HLP"; DestDir: "{pf}\Corel\Paradox 9 Runtime\Paradox" Source: "C:\Program Files\Corel\Paradox 9 Runtime\Paradox\PdoxRun9.CNT"; DestDir: "{pf}\Corel\Paradox 9 Runtime\Paradox" Source: "C:\Program Files\Corel\Paradox 9 Runtime\Paradox\PXRERROR.HLP"; DestDir: "{pf}\Corel\Paradox 9 Runtime\Paradox"Note: If you are installing PDOX 10, I understand that you can use a runtime.exe instead of the PDE generated files. You would put the exe in the files section and then run it in the run section, see below. The setup in this document is only tested with P9. Also, the default mode for Inno is copyifexistingorolder. A number of the Windows files in the reDist dir are now older than what users may have on their machines. The default copy method of Inno will leave the newer files on the system. Installing the BDE Now to install the BDE, run the miniReg.exe program. [Run] FileName: "{tmp}\miniReg.exe"; Parameters: """{tmp}\BdeInst.dll"""This will produce a reliable Paradox Runtime application. There is one slight problem. On machines with more than, I believe it's 2 gig of free space, you will get an error saying that there isn't enough space on the machine. This is guaranteed to freak out your users. I recommend that you use a simple program called AutoIt available at http://www.hiddensoft.com/AutoIt/ to issue keystrokes to simply exit out of the warning. I used AutoIt to wrap the whole miniReg.exe and keystrokes into one simple exe that I named InstBDE.exe and put into the run section. In my script it looks like this: [Files] Source: "InstBDE.exe"; DestDir: "{tmp}"; flags: deleteafterinstall [Run] ; instBDE.exe is the AutoIt built exe FileName: "{tmp}\InstBDE.exe"Of course this won't work without the instBDE.exe program. This file may be available at the Paradox Community download site. Extras Then there's a lot of miscellaneous stuff you can do. I used another program called setACL to set permissions on the target machine to get around permissions problems on WinXP machines. You'll need the setAcl.exe program: http://www.helge.mynetcologne.de/setacl/. [Files] Source: "SetACL.exe"; DestDir: "{tmp}"; flags: deleteafterinstall [Run] Filename: "{tmp}\SetACL.exe"; Parameters: """{app}\tbl"" /dir /grant S-1-1-0 /write /sid" ; Grant Everyone "write" permissions in the private directory Filename: "{tmp}\SetACL.exe"; Parameters: """{app}\private\"" /dir /grant S-1-1-0 /write /sid" Filename: "{tmp}\SetACL.exe"; Parameters: """{pf}\Corel\Paradox 9 Runtime\Programs\config"" /dir /grant S-1-1-0 /write /sid" Installing Icons Last, you'll want to install your program's icons. This is as simple as this: (pws.ico is the file name of my custom icon. Startup.ssl is my app's startup script. The parameters should be familiar to you.) Note that any quote contained within a quote must be preceded by another quote. [Icons] Name: "{commondesktop}\MyApplication"; filename: "C:\Program Files\Corel\Paradox 9 Runtime\Programs\pdxrwn32.exe"; iconfilename: "{app}\pws.ico"; comment: "MyApplication"; parameters: "-q -m -p ""{app}\private"" -w ""{app}"" ""{app}\startup.sdl"""I get a bit fancy and offer my users a choice of icons depending on which features of the program they will eventually unlock. Using the tasks section of Inno I give the user radio buttons to choose the icon. I also install a suite of icons in the group section of the startup menu. Here's what my icons section looks like: [Tasks] name: SoloIcon; description: "Install the Solo Icon on the desktop. (Recommended for Solo.)"; Flags: exclusive name: OfficeIcon; description: "Install the Office Icon on the desktop. (Recommended for Office.)"; Flags: exclusive unchecked [Icons] Name: "{group}\MyApplication"; Filename: "C:\Program Files\Corel\Paradox 9 Runtime\Programs\pdxrwn32.exe"; iconfilename: "{app}\MyAppicon.ico"; parameters: "-q -m -p ""{app}\private"" -w ""{app}"" ""{app}\startup.sdl""" Name: "{group}\MyApplication Website"; Filename: "{app}\MyApplication.url" Name: "{group}\Uninstall MyApplication"; filename: {uninstallexe} Name: "{commondesktop}\MyApplication"; filename: "C:\Program Files\Corel\Paradox 9 Runtime\Programs\pdxrwn32.exe"; iconfilename: "{app}\pws.ico"; comment: "MyApplication"; parameters: "-q -m -p ""{app}\private"" -w ""{app}"" ""{app}\startup.sdl"""; Tasks: soloicon Name: "{commondesktop}\MyApplication"; filename: "C:\Program Files\Corel\Paradox 9 Runtime\Programs\pdxrwn32.exe"; iconfilename: "{app}\MyAppicon.ico"; comment: "MyApplication"; parameters: "-q -m -p ""{app}\private"" -w ""{app}"" ""{app}\startup.sdl"""; Tasks: officeicon Registry Settings I use Inno's [Registry] section to put registry entries for my app. The entry {code:someVariable} refers to values obtained from using InnoExtensions not shown here, which I use to manage the location of data files. Root: HKLM; Subkey: "Software\IT Resources\MyApplication"; Flags: deletevalue; ValueType: string; ValueName: "Version"; ValueData: "130" Root: HKLM; Subkey: "Software\IT Resources\MyApplication"; ValueType: string; ValueName: "AppDir"; ValueData: "{app}" Root: HKLM; Subkey: "Software\IT Resources\MyApplication"; ValueType: string; ValueName: "DataDir"; ValueData: "{code:GetDataDir}" Root: HKCU; Subkey: "Software\IT Resources\MyApplication"; ValueType: string; ValueName: "Name"; ValueData: "{code:GetUser|Name}" Root: HKCU; Subkey: "Software\IT Resources\MyApplication"; ValueType: string; ValueName: "Company"; ValueData: "{code:GetUser|Company}"There is a file named RParadox.reg in the PDE/redist/regfiles directory that appears to list the registry entries for the Runtime distribution. I have distributed many Paradox applications without them with no problems, but if you want Paradox file associations you'll need them. Here are the runtime related registry settings I'm currently using: [Registry] ;Pdox config Root: HKLM; Subkey: "Software\Corel\Paradox Runtime\9.0"; ValueType: string; ValueName: "ConfigDir"; ValueData: "{pf}\Corel\Paradox 9 Runtime\Programs" Root: HKLM; Subkey: "Software\Corel\Paradox Runtime\9.0"; ValueType: string; ValueName: "Destination"; ValueData: "{pf}\Corel\Paradox 9 Runtime" Root: HKLM; Subkey: "Software\Corel\Paradox Runtime\9.0\Configuration\ParadoxDir"; ValueType: string; ValueName: ""; ValueData: "{pf}\Corel\Paradox 9 Runtime\Paradox" Root: HKLM; Subkey: "Software\Corel\Paradox Runtime\9.0\Configuration\ParadoxLocalDir"; ValueType: string; ValueName: ""; ValueData: "{pf}\Corel\Paradox 9 Runtime\Paradox" Root: HKLM; Subkey: "Software\Corel\Paradox Runtime\9.0\Configuration\PrivDir"; ValueType: string; ValueName: ""; ValueData: "{pf}\Corel\Paradox 9 Runtime\Paradox\Private" Root: HKLM; Subkey: "Software\Corel\Paradox Runtime\9.0\Configuration\WorkDir"; ValueType: string; ValueName: ""; ValueData: "{pf}\Corel\Paradox 9 Runtime\Paradox\Working" Root: HKLM; Subkey: "Software\Corel\Paradox Runtime\9.0\INIT"; ValueType: dword; ValueName: "LANGUAGE"; ValueData: "00000009" Root: HKLM; Subkey: "Software\Corel\Paradox Runtime\9.0\INIT"; ValueType: dword; ValueName: "UI"; ValueData: "0000000" Root: HKLM; Subkey: "Software\Corel\Paradox Runtime\9.0\Pdoxwin\Properties"; ValueType: string; ValueName: "StandardTransactions"; ValueData: "True" Root: HKLM; Subkey: "Software\Corel\Paradox Runtime\9.0\Pdoxwin\Desktop"; ValueType: string; ValueName: ""; ValueData: "75 65 853 614 0 1" Root: HKLM; Subkey: "Software\Corel\Paradox Runtime\9.0\Toolbars\Application Bar"; ValueType: string; ValueName: "SpeedBarPos"; ValueData: "" Root: HKLM; Subkey: "Software\Corel\Paradox Runtime\9.0\Toolbars\Application Bar"; ValueType: string; ValueName: "SpeedBarState"; ValueData: "Fix" ;Help Root: HKLM; Subkey: "Software\Microsoft\Windows\Help"; ValueType: string; ValueName: "Bdeadmin.hlp"; ValueData: "{pf}Common Files\Borland Shared\BDE" Root: HKLM; Subkey: "Software\Microsoft\Windows\Help"; ValueType: string; ValueName: "Pdoxrun9.hlp"; ValueData: "{pf}\Corel\Paradox 9 Runtime\Paradox" Root: HKLM; Subkey: "Software\Microsoft\Windows\Help"; ValueType: string; ValueName: "PxRerror.hlp"; ValueData: "{pf}\Corel\Paradox 9 Runtime\Paradox" ;Associations Root: HKCR; Subkey: ".FSL"; ValueType: string; ValueName: ""; ValueData: "FSLFile" Root: HKCR; Subkey: ".FDL"; ValueType: string; ValueName: ""; ValueData: "FDLFile" Root: HKCR; Subkey: ".RSL"; ValueType: string; ValueName: ""; ValueData: "RSLFile" Root: HKCR; Subkey: ".RDL"; ValueType: string; ValueName: ""; ValueData: "RDLFile" Root: HKCR; Subkey: ".SSL"; ValueType: string; ValueName: ""; ValueData: "SSLFile" Root: HKCR; Subkey: ".SDL"; ValueType: string; ValueName: ""; ValueData: "SDLFile" Root: HKCR; Subkey: "FSLFile"; ValueType: string; ValueName: ""; ValueData: "Paradox Form" Root: HKCR; Subkey: "FSLFile\Shell\Open\Command"; ValueType: string; ValueName: ""; ValueData: """{pf}\Corel\Paradox 9 Runtime\Programs\PdxRwn32.exe"" -b ""%1""" Root: HKCR; Subkey: "FSLFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{pf}\Corel\Paradox 9 Runtime\Programs\PdxSe.dll,-103" Root: HKCR; Subkey: "FSLFile\Shellex\ContextMenuHandlers\Paradox"; ValueType: string; ValueName: ""; ValueData: "{{D761C5B0-E1D9-11d0-B756-00A0C906BCC5}" Root: HKCR; Subkey: "FDLFile"; ValueType: string; ValueName: ""; ValueData: "Paradox Form (Delivered)" Root: HKCR; Subkey: "FDLFile\Shell\Open\Command"; ValueType: string; ValueName: ""; ValueData: """{pf}\Corel\Paradox 9 Runtime\Programs\PdxRwn32.exe"" -b ""%1""" Root: HKCR; Subkey: "FDLFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{pf}\Corel\Paradox 9 Runtime\Programs\PdxSe.dll,-104" Root: HKCR; Subkey: "FDLFile\Shellex\ContextMenuHandlers\Paradox"; ValueType: string; ValueName: ""; ValueData: "{{D761C5B0-E1D9-11d0-B756-00A0C906BCC5}" Root: HKCR; Subkey: "RSLFile"; ValueType: string; ValueName: ""; ValueData: "Paradox Report" Root: HKCR; Subkey: "RSLFile\Shell\Open\Command"; ValueType: string; ValueName: ""; ValueData: """{pf}\Corel\Paradox 9 Runtime\Programs\PdxRwn32.exe"" -b ""%1""" Root: HKCR; Subkey: "RSLFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{pf}\Corel\Paradox 9 Runtime\Programs\PdxSe.dll,-105" Root: HKCR; Subkey: "RSLFile\Shellex\ContextMenuHandlers\Paradox"; ValueType: string; ValueName: ""; ValueData: "{{D761C5B0-E1D9-11d0-B756-00A0C906BCC5}" Root: HKCR; Subkey: "RDLFile"; ValueType: string; ValueName: ""; ValueData: "Paradox Report (Delivered)" Root: HKCR; Subkey: "RDLFile\Shell\Open\Command"; ValueType: string; ValueName: ""; ValueData: """{pf}\Corel\Paradox 9 Runtime\Programs\PdxRwn32.exe"" -b ""%1""" Root: HKCR; Subkey: "RDLFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{pf}\Corel\Paradox 9 Runtime\Programs\PdxSe.dll,-106" Root: HKCR; Subkey: "RDLFile\Shellex\ContextMenuHandlers\Paradox"; ValueType: string; ValueName: ""; ValueData: "{{D761C5B0-E1D9-11d0-B756-00A0C906BCC5}" Root: HKCR; Subkey: "SSLFile"; ValueType: string; ValueName: ""; ValueData: "Paradox Script" Root: HKCR; Subkey: "SSLFile\Shell\Open\Command"; ValueType: string; ValueName: ""; ValueData: """{pf}\Corel\Paradox 9 Runtime\Programs\PdxRwn32.exe"" -b ""%1""" Root: HKCR; Subkey: "SSLFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{pf}\Corel\Paradox 9 Runtime\Programs\PdxSe.dll,-107" Root: HKCR; Subkey: "SSLFile\Shellex\ContextMenuHandlers\Paradox"; ValueType: string; ValueName: ""; ValueData: "{{D761C5B0-E1D9-11d0-B756-00A0C906BCC5}" Root: HKCR; Subkey: "SDLFile"; ValueType: string; ValueName: ""; ValueData: "Paradox Script (Delivered)" Root: HKCR; Subkey: "SDLFile\Shell\Open\Command"; ValueType: string; ValueName: ""; ValueData: """{pf}\Corel\Paradox 9 Runtime\Programs\PdxRwn32.exe"" -b ""%1""" Root: HKCR; Subkey: "SDLFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{pf}\Corel\Paradox 9 Runtime\Programs\PdxSe.dll,-108" Root: HKCR; Subkey: "SDLFile\Shellex\ContextMenuHandlers\Paradox"; ValueType: string; ValueName: ""; ValueData: "{{D761C5B0-E1D9-11d0-B756-00A0C906BCC5}"You could just look at your own runtime registry entries and decide which ones you want to use. Uninstall When your user selects uninstall, Inno will uninstall everything it installed, except the BDE, because it didn't really install it, the bdeInst.dll did, which is why it's legal (we think). You wouldn't want to uninstall the BDE because what if other applications are using it? However, since your application itself may install files in your application directory, such as answer tables, etc. Inno will leave the directory intact. To wipe out everything my app creates I include the following: [UninstallDelete] Type: filesandordirs; Name: "{app}" Conclusion I didn't have a lot of experience with InstallShield. I spent 2-3 frustrating days trying to get it to run correctly and, most annoying, trying to get answers from the support people. The only guy who would talk to me was the sales guy who tried to act as a go-between to tech support and wasn't much help. Inno on the other hand proved to be a breeze to set up. The newsgroup is supportive and tolerant, and the developer of Inno, Jordan Russell, is an active member. You can find the newsgroups at: news.jrsoftware.org The fact that it's free is not really the best part of it, but it certainly is refreshing, especially where InstallShield is costly. While it would be helpful if Borland would certify Russell to distribute the BDE Merge Module, it probably won't happen since Borland is depreciating the BDE. The last version of the Merge Module I saw did not install the BDE Administrator in the Windows Control Panel, and the Merge Module requires the Microsoft Installation Platform behemoth (which name I forget), so there may not be any great loss in not having it. Discussion of this article |
![]() Feedback | Paradox Day | Who Uses Paradox | I Use Paradox | Downloads ![]() |
|
![]() The information provided on this Web site is not in any way sponsored or endorsed by Corel Corporation. Paradox is a registered trademark of Corel Corporation. ![]() |
|
![]() Modified: 29 Jun 2003 Terms of Use / Legal Disclaimer ![]() |
![]() Copyright © 2001- 2003 Paradox Community. All rights reserved. Company and product names are trademarks or registered trademarks of their respective companies. Authors hold the copyrights to their own works. Please contact the author of any article for details. ![]() |
![]() |
|