User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

PowerBuilder v12.1, build 7055
Windows 7 32 bit platform
Windows 7 64 bit platform
Windows 10, 64 bit platform


A Sample Inno Setup ".ISS" File
Olan Knight
28-Mar-2019


Once upon a time, long, long ago, we used a product called InstallShield to create the Windows installer for our various products. Over time, the cost for InstallShield became prohibitive, and we eventually settled on using Inno Setup as the replacement tool to create out installers.

You can get the free tool here:    http://www.jrsoftware.org/isinfo.php
The excellent HELP file is here:     http://www.jrsoftware.org/ishelp/   

It's a simple and intuitive tool, but it has some quirks and there is a learning curve. 
Inno Setup uses an ".iss" file as its source code. It compiles that ISS file into the SETUP.EXE for your application, with the file name being up to you.



After some time, I was able to create an ".ISS" file that did the following:
   1. Check the target platform to ensure that the correct version of Java in installed.
           If not, a message is displayed and the installer exists.

   2. Install the software or upgrade the existing software.
            The install location is based on if the platform is 32 bit or 64 bit.

   3. Install or update the Windows Registry entries.

   4. Use our custom icons for the application and for the uninstaller.

   5. Create an uninstaller and put a link to in the Control Panels "Programs and Features" applet.

   6. Update the list of apps displayed in the START menu (when you click the START button, or click Start/All Programs).

   7. Provide the user the option to start the app after it has been installed.
       Provide the use the option to read the Install Notes at the end of the installation. (Commented out)


   As you can see, Inno Setup is pretty flexible! And no, I don't work for Inno.

   Take a look at the script below and use what you want and what works for you.

   If you have any suggestions on how to improve this script, or if you have additional features that you think would be useful, please feel free to simply add COMMENTS to this article that list the lines of INNO script code to add, along with an explanation of what your script addition accomplishes!

Enjoy,

Olan Knight

 

~~~~~~~~~~~~~~~~~~~~~~~~

 

// Sample ISS file
// =========
Be sure to delete the comments in RED before compiling!

; ======================================================================
;      
; INNO Installer Script
; iCABS4_5, b0168
;     
;          
; Description:  This is the installer script for iCABS4_5, b0168.
;
;********************************************************************
; Revision History
;
; Developer      Date              Version     Description
; ---------   -----------   ---------   -------------------------------
; O Knight    12-MAR-2019   6.0.5.168   #66036:    Create full installer for b0168.
; O Knight    15-MAR-2019   6.0.5.167   #2429190:  Change AppPath to (x86).
; O Knight    12-MAR-2019   6.0.5.167   #2429190:  Create full installer for b0167.
; O Knight    12-MAR-2019   6.0.5.166   #2438462:  Create full installer for b0166.
; O Knight    03-DEC-2019   6.0.5.163   #2190338:  Full installer for b0163.
;
; Script generated by the Inno Setup Script Wizard then manually
; modified by Olan Knight.
;
;********************************************************************
; COPYRIGHT © 2017 XXXXXXXXXXXXXXXXXXXXXXX  AND/OR ITS
; AFFILIATES (“CSG”). ALL RIGHTS RESERVED.
;
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
; ======================================================================

; This is the set of variables that are used throughout the script. Having these means
; that I only have one location in which I need to make most of my changes between versions.
 
#define MyAppId       "A44C3C34-52ED-4625-8BBC-912B9119052B"  
#define MyAppName     "iCABS4_5"                                                Name fof the application
#define MyAppExeName  "iCABS4_5.exe"                                        
#define MyAppIcon     "taxi_v3_64x64_v2_black2.ico"
#define MyAppIconPath "J:\Applications\QualityAssurance\csgi12\ICABS\__ICABS b0168 - LPCs\installer\"
#define MyAppIconName "J:\Applications\QualityAssurance\csgi12\ICABS\__ICABS b0168 - LPCs\installer\taxi_v3_64x64_v2_black2.ico"
#define MyAppPath     "C:\Program Files (x86)\CSGI\ICABS4_5"              
#define MyAppVersion  "4.0.5.0168"
#define Reg32AppKey   "Software\CSGI"
#define Reg64AppKey   "Software\Wow6432Node\CSGI"
#define Reg32SubKey   "Software\CSGI\\ICABS4_5"
#define Reg64SubKey   "Software\Wow6432Node\CSGI\ICABS4_5"
#define SourceFileDir "J:\Applications\QualityAssurance\csgi12\ICABS\__ICABS b0168 - LPCs"
#define MyWebsite  "http://www.csgi.com/"



[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{A44C3C34-52ED-4625-8BBC-912B9119052B}                           

; "ArchitecturesInstallIn64BitMode=x64" requests that the install be
; done in "64-bit mode" on x64, meaning it should use the native
; 64-bit Program Files directory and the 64-bit view of the registry.
; On all other architectures it will install in "32-bit mode".
ArchitecturesInstallIn64BitMode=x64
; Note: We don't set ProcessorsAllowed because we want this
; installation to run on all architectures (including Itanium,
; since it's capable of running 32-bit code too).

AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName="{#MyAppName} {#MyAppVersion}"                                 
AppPublisher="Intec Billing/CSG International"                                         
AppPublisherURL={#MyWebsite}
AppSupportURL={#MyWebsite}
AppUpdatesURL={#MyWebsite}
Compression=lzma
DefaultDirName={#MyAppPath}
DisableDirPage=yes
DisableProgramGroupPage=yes
LicenseFile="{#SourceFileDir}\installer\iCABS4 Setup License Agreement.txt"    
OutputDir={#SourceFileDir}\installer                                                            
OutputBaseFilename="{#MyAppName}-v{#MyAppVersion}_Full_Setup"            Setup.EXE file name
SetupIconFile={#MyAppIcon}
SetupLogging=yes
SolidCompression=yes
VersionInfoVersion={#MyAppVersion}


; If this SETUP parameter is set, its value will be used for the name displayed in
; the Control Panel's "Programs and Features" applet instead of the value of APPNAME.
; -----------------------------------------------------------------------------------
;UninstallDisplayName="iCABS4_5 v4.0.5.0168 Uninstall"                                  

; This sets the icon displayed in the Programs and Features" applet of the Control panel
UninstallDisplayIcon={#SourceFileDir}\installer\{#MyAppIcon}                           


[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
            

[Icons]
Name: "{group}\{#MyAppName}";               Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"; IconFilename: "{#MyAppIconName}"
Name: "{group}\CSGI\{#MyAppName}";          Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"; IconFilename: "{#MyAppIconName}"

Name: "{commonprograms}\CSGI\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"; IconFilename: "{#MyAppIconName}"
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{#MyAppIconName}"; Tasks: quicklaunchicon;

Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "http://www.csgi.com/"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "uninstall_{#MyAppExeName}"; IconFilename: "Uninstaller_icon_256x256.ico"

; Create the desktop shortcut to the app
;Name: "{userdesktop}\{#MyAppName}"; Filename: "{#MyAppExeName}"; WorkingDir: "{win}"; IconFilename: "{#MyAppIconName}"; Tasks: desktopicon
Name: "{commondesktop}\{#MyAppName}";       Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"; IconFilename: "{#MyAppIconName}"


[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"

; Create the "Start ICABS4_5" checkbox on the last page of the installer.
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1


[Files]
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
;
; Install the iCABS4_5 files
Source: "{#SourceFileDir}\{#MyAppExeName}";       DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs.pbd";             DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_asap.pbd";        DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_aur.pbd";         DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_bill_print.pbd";  DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_billing.pbd";     DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_bos.pbd";         DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_cfg.pbd";         DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_company.pbd";     DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_corp.pbd";        DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_dddw.pbd";        DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_dispute.pbd";     DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_emi.pbd";         DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_ext.pbd";         DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_fa.pbd";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_fnc.pbd";         DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_ic.pbd";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_lerg.pbd";        DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_license.pbd";     DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_occ_adj.pbd";     DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_order.pbd";       DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_payment.pbd";     DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_reporting.pbd";   DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_rpts.pbd";        DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_rtelement.pbd";   DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_secab10.pbd";     DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_secab11.pbd";     DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_secab12.pbd";     DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_secab13.pbd";     DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_secab14.pbd";     DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_secab15.pbd";     DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_soc_juris.pbd";   DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_str.pbd";         DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_sw.pbd";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_tariff.pbd";      DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_tod.pbd";         DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_usage.pbd";       DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\icabs_wc.pbd";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\csgi_icabs.pbd";        DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\csgi_pfe.pbd";          DestDir: "{app}"; Flags: ignoreversion

; Install the Class Libraries
Source: "{#SourceFileDir}\corp_pfc.pbd";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\corp_pfe.pbd";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\corp_vrsn.pbd";         DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\pfeapsrv.pbd";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\pfedwsrv.pbd";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\pfemain.pbd";           DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\pfeutil.pbd";           DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\pfewnsrv.pbd";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\pfcapsrv.pbd";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\pfcdwsrv.pbd";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\pfcmain.pbd";           DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\pfcutil.pbd";           DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\pfcwnsrv.pbd";          DestDir: "{app}"; Flags: ignoreversion

; Install the the Runtime JAR files
Source: "{#SourceFileDir}\cabs4.jar";             DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\ojdbc14.jar";           DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\ojdbc6.jar";            DestDir: "{app}"; Flags: ignoreversion

; Install the the Runtime DLLs
Source: "{#SourceFileDir}\atl71.dll";             DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\libjcc.dll";            DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\libjutils.dll";         DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\mfc71.dll";             DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\msvcp71.dll";           DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\msvcr71.dll";           DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\PBDWE120.DLL";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\pbo10120.dll";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\pbo90120.dll";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\pbora120.dll";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\PBSHR120.DLL";          DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceFileDir}\PBVM120.DLL";           DestDir: "{app}"; Flags: ignoreversion

; Add the Standard REPORTS library
Source: "{#SourceFileDir}\icabs_rpts.pbl";        DestDir: "{app}"; Flags: ignoreversion

; Install the generic CFG file (for use with Java AUR Processing)
Source: "{#MyAppIconPath}\cabs.cfg";              DestDir: "{app}"; Flags: ignoreversion

; Install the HELP file
Source: "{#MyAppIconPath}\ICABS4.chm";            DestDir: "{app}"; Flags: ignoreversion

; Install the icon file
Source: "{#MyAppIconPath}\taxi_v3_64x64_v2_black2.ico"; DestDir: "{app}";

; Specify the ReadMe file option on the last page of the installer wizard
;Source: "{#SourceFileDir}\Installer\Release Notes Version 4.5 v1.0.pdf";    DestDir: "{app}"; Flags: isreadme


[Code]
// ----------------  BEGIN Determine Platform bitness  --------------------------
// Inno Pascal functions for determining the processor type.
// you can use these to use (in an inno "check" parameter)
//   Source: "driver\ia64\libusb0.dll"; DestDir: {sys}; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsI64;
//

function IsX64: Boolean;
begin
  Result := Is64BitInstallMode and (ProcessorArchitecture = paX64);
end;

function IsI64: Boolean;
begin
  Result := Is64BitInstallMode and (ProcessorArchitecture = paIA64);
end;

function IsX86: Boolean;
begin
  Result := not IsX64 and not IsI64;
end;

function Is64: Boolean;
begin
  Result := IsX64 or IsI64;
end;
// ----------------  END  Determine Platform bitness  --------------------------



// ----------------  BEGIN Return the correct Registry Subkey  --------------------------
function GetRegAppKey(Param: String): String;
begin
  if (IsX86) then
  begin
     Result := '{#Reg32AppKey}';
  end else
  begin
     Result := '{#Reg64AppKey}';
  end;
end;

function GetRegSubKey(Param: String): String;
begin
  if (IsX86) then
  begin
     Result := '{#Reg32SubKey}';
  end else
  begin
     Result := '{#Reg64SubKey}';
  end;
end;
// ----------------  END  Return the correct Registry Subkey  --------------------------


// ----------------  BEGIN Determine Java Version installed  --------------------------
function InitializeSetup(): Boolean;
var
  ErrorCode: Integer;
  JavaInstalled : Boolean;
  Result1 : Boolean;
  Versions: TArrayOfString;
  I: Integer;
  count: Integer;
  JavaMsg: String;
  sLineBreak: String;

begin

   // Get the set of installed Java runtimes
   // --------------------------------------
   JavaInstalled := FALSE;
   sLineBreak    := #13#10;
   
  if RegGetSubkeyNames(HKLM, 'SOFTWARE\JavaSoft\Java Runtime Environment', Versions) then
  begin
    // Java is installed on a 32 bit platform
    JavaInstalled := TRUE;
  end else
  begin

    if RegGetSubkeyNames(HKLM, 'SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment', Versions) then
    begin
      // Java is installed on a 64 bit platform
      JavaInstalled := TRUE;
    end;

  end;

  if (JavaInstalled) then
  begin

    JavaInstalled := FALSE;

    // Get the set of installed Java runtimes
    // --------------------------------------
    count := GetArrayLength(Versions)-1;     // Remember that arrays in Pascal are zero-based, not 1-based.
    for I := 0 to count do

      if JavaInstalled = true then
      begin
        //do nothing
      end else
      begin
        if ( Versions[I][2]='.' ) and ( ( StrToInt(Versions[I][1]) > 1 ) or ( ( StrToInt(Versions[I][1]) = 1 ) and ( StrToInt(Versions[I][3]) >= 6 ) ) ) then
          begin
            JavaInstalled := true;
          end else
          begin
            JavaInstalled := false;
          end;
      end;

  end;


   
   if JavaInstalled then
   begin
      Result := true;
   end else
      begin
        JavaMsg :=  'A 32 bit version of Java v1.6u45 or higher must be installed. Do you wish to install Java at this time?' +
                    sLineBreak +
                    sLineBreak +
                    'Note that choosing to install Java will cause this installer to exit and your browser to display '  +  
                    'the Java Download site. Once you have installed the 32-bit version of Java version 1.6 or higher, ' +
                    'please re-run this installer.'
        Result1 := MsgBox(JavaMsg, mbConfirmation, MB_YESNO) = idYes;
        if Result1 = false then
        begin
          // User said NO to installing Java at this time; proceed with the CABS4_5 install
          Result:=TRUE;
        end else
        begin
          // Exit the installer
          Result:=false;

          // Open up the browser to the Java Download site
          ShellExec('open', 'http://www.java.com/getjava/',  '','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
        end;

     end;
  end;

end.
// ----------------  End of Determine Java Version installed  --------------------------


[Registry]
; Tell Windows that a new EXE has been installed
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\\{#MyAppExeName}"; ValueType: string; ValueName: "Path"; ValueData: "{#MyAppPath}\{#MyAppExeName}"; Flags: createvalueifdoesntexist uninsdeletekey

; Create the top level Registry entry and all required subkeys
Root: HKLM; Subkey: {code:GetRegAppKey}; Flags: createvalueifdoesntexist  
Root: HKLM; Subkey: {code:GetRegAppKey}; ValueType: string; ValueName: "Company"; ValueData: "CSG International"; Flags: createvalueifdoesntexist
Root: HKLM; Subkey: {code:GetRegAppKey}; ValueType: string; ValueName: "HelpPath"; ValueData: "..\Help\"; Flags: createvalueifdoesntexist

Root: HKLM; Subkey: "{code:GetRegAppKey}\Applications"; Flags: createvalueifdoesntexist  
Root: HKLM; Subkey: "{code:GetRegAppKey}\Applications"; ValueType: string; ValueName: {#MyAppExeName}; ValueData: "{#MyAppPath}\{#MyAppExeName}"; Flags: uninsdeletevalue  

Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "";                      ValueData: "";      Flags: createvalueifdoesntexist uninsdeletekey
Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "AutoCompanySelect";     ValueData: "N";     Flags: createvalueifdoesntexist
Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "AutoUpdateOn";          ValueData: "N";     Flags: createvalueifdoesntexist
Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "DEBUG_U_NV_SW_ORDER_USAGE_TOTALLING"; ValueData: "N"; Flags: createvalueifdoesntexist
Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "DebugLogFileLocation";  ValueData: "C:\";   Flags: createvalueifdoesntexist
Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "enableDBMessages";      ValueData: "FALSE"; Flags: createvalueifdoesntexist
Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "EnablePBDebugMessages"; ValueData: "FALSE"; Flags: createvalueifdoesntexist

Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "JavaExeFile"; ValueData: "C:\Program Files (x86)\Java\jre6\bin\java.exe"; Flags: createvalueifdoesntexist
Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "JavaJarFile"; ValueData: "{#MyAppPath}\cabs4.jar;{#MyAppPath}\ojdbc6.jar"; Flags: createvalueifdoesntexist

Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "PlatformBitness"; ValueData: "32"; Flags: createvalueifdoesntexist; Check: IsX86
Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "PlatformBitness"; ValueData: "64"; Flags: createvalueifdoesntexist; Check: Is64  

Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "ProprietaryDuration"; ValueData: "1"; Flags: createvalueifdoesntexist
Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "ProprietaryFile";     ValueData: ""; Flags: createvalueifdoesntexist
Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "ProprietaryPath";     ValueData: "{#MyAppPath}"; Flags: createvalueifdoesntexist

Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "SaveDataWhenAmountBilledIsZero"; ValueData: "N"; Flags: createvalueifdoesntexist
Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "SetSQLSpy";                      ValueData: "N"; Flags: createvalueifdoesntexist
Root: HKLM; Subkey: {code:GetRegSubKey}; ValueType: string; ValueName: "StaticBind";                     ValueData: "1"; Flags: createvalueifdoesntexist


[Run]
; There is no way to rename the uninstaller generated by Inno Setup within Inno. The best we can do is to rename it after it has been placed.
;Filename: {cmd}; Parameters: "RENAME "" {app}""\unins000.exe"" ""uninstall_iCABS4_5.exe"""; StatusMsg: Installing uninstaller for ICABS4_5...; Flags: RunHidden WaitUntilTerminated

; Give the user the option to run iCABS4_5 after the installation has completed.
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: nowait postinstall skipifsilent



[UninstallDelete]
; The last step of the Uninstaller will be to delete the new ICABS4_5 folder
Type: filesandordirs; Name: {#MyAppPath}

 

Comments (3)

  1. Roland Smith

You can specify folder-name\* to get all files in the folder. You don't have to specify each file separately.

I think you've gone overboard with the defines and actually made it more complex. My setup files are between 25 and 50 lines.

What is the purpose of renaming the uninstall program? Won't that actually prevent it from working? When you run an install, Windows records the name of the uninstaller in the registry.

 
  1. Olan Knight

I do understand where you are coming from.

However, I like the defines. They minimize the number of places where I need to update the code for each new release. Yes, it's a wee bit more complex when you look at the downstream code, but not very much so.

I'd love to be able to use the "\*| option, sadly I am unable to do so.

The UninstallDisplayName should be commented out. It does not work correctly, as you have pointed out.


Later -

Olan

 
  1. Andreas Mykonios

A simple addition to this nice article, for those who are new to innosetup and would like to make their life easier: take a look to Inno Script Studio. It's an let say IDE for InnoSetup.

 
There are no comments posted here yet