Announcement

Collapse
No announcement yet.

Inno Setup: Commented Install Script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Inno Setup: Commented Install Script

    Code:
    ; SAMPLE_RELEASE_SCRIPT.ISS
    ; Cleaned up and commmented "Actual, Real, Live" Inno Setup Script.
    ; This script ("more or less" is used by Tal Systems, Inc. to create the
    ; 'setup.exe' file supplied to licensed users of the EDI Pal (tm) ANSI EDI
    ; viewer-editor-printer tool
    ; This scipt is for Inno Setup v 3.0.x, and WILL NOT WORK with Inno Setup
    ; version 2.X
    ; Author: Michael Mattias, Racine WI USA
    ; Inno Setup is Copyright (C) 1997-2002 Jordan Russell. All rights reserved.
    ; =================================================================
    ; In the 'actual' process of creating the setup file, I use additional
    ; software to generate the INCLUDE file for the kits; and the EDI Pal
    ; does NOT use a password. The Provider Payment Partner (tm) System
    ; does use a password with the message strings as below which I modified
    ; for this demo script.
    ; The installation software then calls the Inno Command line compiler
    ; passing this file's name as a parameter.
    ; ======================================================================
    
    ; =====================================================================
    ; Override the default message to change 'password' to 'serial number'
    ; =====================================================================
    [Messages]
    PasswordLabel1=Installation of EDI Pal requires the serial number from your disk.
    PasswordLabel3=Please enter the serial number in the form 1234-4567-90AB (case-sensitive), then click <Next> to continue
    PasswordEditLabel=&Serial Number:
    IncorrectPassword=The serial number you entered is not correct. Please try again.
    ; =====================================================================
    ; Create the directories needed on the user system
    ; =====================================================================
    [Dirs]
    ; programs and support files
     Name: "{app}\System"
    ; EDI Files
    Name: "{app}\EDI Files"
    ; =====================================================================
    ; [SETUP] Section: options used when creating Setup.exe and in the
    ; Setup Wizard the user sees
    ; =====================================================================
    [Setup]
    AppName=EDI Pal ANSI EDI Tool
    AppVerName=EDI Pal 2.0
    Appversion=2.0
    AppCopyright=Copyright 2003 Michael C. Mattias Racine WI
    ; The AppMutex is not currently used by the EDI Pal; however, if used
    ; it prevents installing and upgrade or uninstalling if the program is
    ; running. Inno diplays a message similar to "This program is currently
    ; running, please end and click retry.' Of course, this only works
    ; if your program actually does create a mutex.
    ;AppMutex=EDIPAL_Mutex_NAME
    ; Make sure the uninstall program is created
    Uninstallable=yes
    ; NEXT PARAMETER MAJOR CHANGE BETWEEN INNO v2 and v3
    ; NEXT NOT SUPPORTED IN INNO v 3, must use [ICON] section entry
    ;AlwaysCreateUninstallIcon=yes  << NOT VALID INNO V3
    ; --------------------------------------------------------------------
    ; Default Directory which comes up in the Wizard when user asked for
    ; an installation directory
    ; -------------------------------------------------------------------
    DefaultDirName=C:\EDIPAL
    ; --------------------------------------------------------------------
    ; Name of the entry on the "Programs" menu
    ; -------------------------------------------------------------------
    DefaultGroupName=EDI Pal(tm) ANSI EDI Tool
    ; --------------------------------------------------------------------
    ; 'source' directory for unqualified files specified in [Setup]
    ;  and [Files] sections of this script
    ; -------------------------------------------------------------------
    SourceDir=C:\Software_Development\pbwin70\work\edipal\2_0_0004\Inno_SourceDir
    ; I forgot what next means. Let's check the Inno Help File:
    ; "If this is set to yes, Setup will not show the Select Start Menu Folder
    ; wizard page. In this case, it uses the folder name specified by the
    ; DefaultGroupName [Setup] section directive, or "(Default)" if none is specified.
    DisableProgramGroupPage=yes
    ; --------------------------------------------------------------------
    ; What Setup.exe is named and where it is created.
    ; Outputdir is relative to sourcedir unless fully qualified
    ; -------------------------------------------------------------------
    OutputDir="..\Registered"
    ; create "setuppal.exe" rather than "setup.exe"
    OutputBaseFileName="setupPal"
    ; ---------------------------------------------------------------------
    ; Password or serial number required for setup wizard to continue.
    ; Any quotation marks on this line become part of the password; i.e.,
    ; the user will be required to enter the quotes
    Password=1234-5678-9012
    ; ----------------------------------------------------------------------
    ; Displayed to user BEFORE user selected installation directory.
    ; May be plain text or rich text.
    InfoBeforeFile="user_before_install.txt"
    ; License file which user may read before he clicks, " I accept the agreement"
    ; If no license file supplied here, user does not need to 'accept' anything.
    ; May be text or rich text.
    LicenseFile="C:\My Documents\Tal Systems\products\edipal\edipal_license.rtf"
    ; Image used on install wizard
    WizardImageFile="C:\My Documents\Tal Systems\Corporate\Artwork\Tal_lg_120x60.bmp"
    ; Color used on Setup Wizard
    ; Inno wants "$bbggrr"; bb=blue, gg=green, rr=red, in hex
    WizardImageBackColor=$75AC94
    ; ======================================================
    ; FILES SECTION. Uses SourceDir from Setup Section unless
    ; Source is fully qualified
    ; ======================================================
    [FILES]
    ; main User Interface Executable:
    Source: "edipal.exe"; DestDir: "{app}\system"
    ; help file
    Source: "edipal.hlp"; DestDir: "{app}\system"
    Source: "edipal.cnt"; DestDir: "{app}\system"
    ; DDOC PRINT SUPPORT FROM UTILITY FOLDER:
    Source: "C:\Utility\Dlls\ddoc.exe"; DestDir: "{app}\system"
    Source: "C:\Utility\Dlls\ddoc32.Dll"; DestDir: "{app}\system"
    ; ---------------------------------------------------------------
    ; Implementation kits - Extra charge
    ; In actual installation process, I create the #include file on the fly
    ; based on which kits the customer actually ordered.
    #include "edipal_inno_files.txt"
    ; =================================================
    ; TYPICAL ENTRIES IN THE #include file (except not commented):
    ; Source: "tsiig015.dll"; DestDir: "{app}\system"
    ; Source: "tsiig022.dll"; DestDir: "{app}\system"
    ; Source: "tsiig041.dll"; DestDir: "{app}\system"
    ; Source: "tsiig051.dll"; DestDir: "{app}\system"
    ; =================================================
    ; Add a price list (MS-Word format)
    Source: "C:\My Documents\Tal Systems\Products\Edipal\edipal_price_list.doc" ; Destdir: "{app}\system"
    
    ;=====================================================
    ; CREATE DEFAULT ENTRIES IN THE EDIPAL.INI FILE
    ;=====================================================
    [INI]
    Filename: "{app}\system\edipal.ini"; Section: "Settings" ;Key:"EDIFolder"; String:"{app}\EDI Files"
    Filename: "{app}\system\edipal.ini"; Section: "Settings" ;Key:"SaveMode"; String:"T"
    Filename: "{app}\system\edipal.ini"; Section: "Settings" ;Key:"RetotalTrailers"; String:"Y"
    Filename: "{app}\system\edipal.ini"; Section: "Settings" ;Key:"ProgressFileSize"; String:"75"
    
    ; =====================================================================
    ; Actual registry key containing the value of the {app}\system folder
    ; =====================================================================
    [REGISTRY]
    Root: HKLM; Subkey:"Software\Tal Systems\EdiPal";Flags:uninsdeletekey; ValueType:string; ValueName:"Install Path"; ValueData:"{app}\system"
    
    [Icons]
    ; Group icon goes on Start Menu, userdesktop goes on user desktop
    ; Include price list, email and web site links
    Name: "{group}\EDI Pal ANSI EDI Tool"; Filename: "{app}\system\edipal.exe"; workingdir:"{app}"
    Name: "{group}\Tal Systems on the 'Net"; Filename: "http://www.talsystems.com"
    Name: "{group}\Send email to Tal Systems"; Filename: "mailto:[email protected]"
    Name: "{group}\Price and Kits List"; Filename: "{app}\system\edipal_price_list.doc"; workingdir:"{app}"
    ; Add uninstall icon entry on program menu:
    Name: "{group}\Uninstall the EDI Pal Software"; Filename: "{uninstallexe}"
    ; have not yet figured out how to ASK the user if he wants a desktop icon or not.
    Name: "{userdesktop}\EDI Pal"; Filename: "{app}\system\edipal.exe"; workingdir:"{app}"
    
    ; END OF INSTALL SCRIPT FOR EDIPAL Release
    ------------------
    Michael Mattias
    Tal Systems Inc.
    Racine WI USA
    mailto:[email protected][email protected]</A>
    www.talsystems.com
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

  • #2
    Added this script 1/29/2021.

    This shows the coding and Pascal code requred to call a FUNCTION in a PB-created Dynamic Link Library

    Paste lost the indents so I had to redo those in the code setion of the scripts

    [code]

    ; PPPS3x_4x_upgrade.ISS
    ; Upgrade from PPPS 3.x OR 4.x to PPPS 4x to latest 4.x
    ; does latter by checking both here in the install script.
    ; Uses TSIUPGRADE DLL to confirm there is an installation
    ; and copy the serial number from existing install
    ; creates output file "ppps3031upg.exe" which will go on website.
    ; ==============================================
    ; ----[ HISTORY AND UPDATES] -----
    ; 7.14.06 Cleaned out all old history. Working 7-14-06 to upgrade 3.0 to 3.1
    ; Must change TSI upgrade.dll to make a 3.1 to 3.1 upgrade.
    ; Oops, what about web site? Might have to make user choose WHICH he wants
    ; the 3.0 to 3.0 or the 3.1 to 3.1? Yikes. Let me think about that.
    ; other than the web site issue, this is working perfectly 7-14-06
    ; This file is not currently usable to update 3.1 to 3.1 IT IS NOW 9/11/06
    ; 9.11.06 THIS FILE WILL NOW (with tsiupgrade v 1.3 DLL) upgrade 3.0 to 3.1
    ; OR 3.1 to 3.1 latest
    ; This will go on the website when 3.1 is formally released.
    ; 09.20.06 Much better test. Installed 3.0.19 from old cd. Upgraded to 3.1. Replaced
    ; 3.0.3 map with 3.0.2 map and upgraded again... and everything worked
    ; perfectly!
    ; 09.21.06 I forgot to bring along unicows.dll. I got away with it because I am now on
    ; Nt+
    ; 11.15.07 For 3.2 copied the 3.0 to 3.1 file here renamed and started setting it up.
    ; 11.30.07 I have this working, but I have some potential issues with HKLM vs HKCU and with
    ; the I/S constants {commonXXXX} vs {userXXXXX] (eg, CommonDesktop, UserDesktop).
    ; THis is the first time I've really done anyting since I got WIN/XP which handles
    ; a lot of the "admin" and "non-admin" stuff. I MAY need to require administrator
    ; privileges to install/uninistall. Will hold off on finding/fixing until after 3.2
    ; is out, since the next release will have to deal with the {commonappdata} anyway
    ; to accomodate Vista or any fully-UAC-enabled machine.
    ; 01.02.08 Update RASYS200 to 3.2.1 (updated reason and remark code literals)
    ; 06.13.08 Update RASYS200 to 3.2.2 (updated reason and remark code literals)
    ; 06.01.08 Updatge RASYS200 to 3.2.12. ; 03.29.10 Update RASYS200 to 3.2.14
    ; 03.29.11 Create 3x4x_4x script to upgrade users from 3x to 4x or (later) from 4x to 4x
    ; Tested both OK 3/29/11
    ; 3.30.11 Move what's new file to CommonAppData (out of program files)

    ;THIS NEEDS AN UPGRADE OF THE X221 map here (that may be automatic)IT IS.
    ; ==[ USER INFO IF DESIRED GOES HERE]
    ; ==[END USER INFO]====
    ; -----------------------------------------
    ; ==========[ BEGIN INSTALL SCRIPT ]=====================================================
    ; =====================================================================
    ; Override the default message to change 'password' to 'serial number'
    ; =====================================================================
    [Messages]
    SetupLdrStartupMessage=This program will upgrade an existing %1 version 3x/4x system to the latest 4x. Do you wish to continue?
    ; above message never appears when DisableStartupPrompt is used
    WelcomeLabel1=[name] Update Wizard
    WelcomeLabel2=This will upgrade PPPS version 3x/4x to the latest version 4x
    InfoBeforeClickLabel=When you are ready to continue, click Next.
    ClickNext=Click Next to continue, or Cancel to exit.
    ReadyLabel1=Ready to begin updating [name] on your computer.
    ReadyLabel2b=Click Install to proceed with the update.
    FinishedHeadingLabel=Completing the [name] Update
    FinishedLabelNoIcons=Finished updating [name].
    ClickFinish=Click 'Finish' button to exit.
    RunEntryShellExec=View readme file '%1'
    ; =====================================================================
    ; Create the directories needed on the user system
    ; There will be no new directories created here.
    ; =====================================================================
    ;[Directories] NOTE Files section entries will create these. These are used for creating empty dirs
    ; hell it cannot hur
    [DIRECTORIES]
    Name: "{commonappdata}\Tal Systems\PPPS\4.0"

    ; =====================================================================
    ; Options for source files when creating setup.exe and
    ; on the user system at installation time
    ; AppId is used to find previous install info
    ; If no AppId is present, AppName is used.
    ; V 2.6: Added APPID = Provider Payment Partner System. All prior installs used AppName
    ; for 3.0 changed to PPPS300, will simplify some update things.
    ; for version 3/0 to 3.1 upgrade:
    ; To change the icon, add an [installdelete] of the *.lnk file and add the start menu icon
    ; =====================================================================
    [Setup]
    AppID=PPPS300
    AppName=Provider Payment Partner System
    ; app vername is the version to which you are upgrading
    AppVerName=Provider Payment Partner 4.0
    Appversion=4.0
    AppCopyright=Copyright 2001, 2004, 2005, 2007 Michael C. Mattias Racine WI
    ; DO NOT CHANGE MUTEX NAME ACROSS VERSIONS!!!
    ; For 3.0 we will piggyback the 3.0 mutex name
    ; in later versions of inno we can semicolon-seperate multiple mutexs.. let's try that here
    ; AppMutex=provider_payment_partner_v_212
    AppMutex=provider_payment_partner_v_300
    ; use default dir normally required!
    ;I took this out an it compiled? Shouldn't?
    ; this dir is not used, the actual install dir is used.
    DefaultDirName=C:\PPPS30
    DisableDirPage=yes
    ; ==== UPGRADE [SETUP] Setttings =========
    ; THESE FOUR SETTINGS FOUND ON ISKB AND ARE REQUIRED
    ; AppId = same
    ; CreateUninstallRegKey=no
    ; UsePreviousAppDir=yes
    ; UpdateUninstallLogAppName=no
    ; THESE LEARNED BY TRIAL AND ERROR
    ; Uninstallable=no
    ;
    ; 11.27.07 I think I have to make uninstallable= YES as long as the appID is the same
    ; let's try. Yes, that is what I have to do. Done.
    Uninstallable=yes
    CreateAppDir=yes
    CreateUninstallRegKey=no
    UsePreviousAppDir=yes
    ; next must be no to use the new group. I delete the old icons and set the new.
    UsePreviousGroup=no
    ; ----
    DirExistsWarning=auto
    DisableStartupPrompt=no
    UpdateUninstallLogAppName=no
    ; ===[ END OF UPDATE STUFF]
    DefaultGroupName=Provider Payment Partner System
    ; location for unqualified filenames specified in [Setup] and [Files] sections of this script
    ; NOTE: SourceDir does NOT use quotes. even with space in the name!
    SourceDir=D:\Utility\Serializer\ppps 4.0\InnoSourceDir
    ; Outputdir is relative to sourcedir unless fully qualified
    OutputDir=D:\Utility\Serializer\ppps 4.0\OutputDir
    ; NOTE THE file name "ppps3031upg.exe" is coded into the web site on the supportpage.
    ; for non-website shipments name = ppps3x40upg
    OutputBaseFileName=ppps3x40upg
    DisableProgramGroupPage=yes
    ; Files from sourcedir unless pathed
    ; DROPPED INFO BEFORE FILE for this version of update, this is the Readme anyway
    ;InfoBeforeFile="readme_update30.txt"
    ;LicenseFile="ppps_eula_noheader.rtf" NO LICENSE FILE ON UPGRADE
    WizardImageFile="D:\tal Systems\Corporate\Artwork\ppps_tal_lg_110x180.bmp"
    WizardImageStretch=no
    ; Tal Dark Green = RGB 108, 132, 80 = x'6C', x'84', x'50'
    ; Tal Light Green = RGB 148 172 117 = x'94' x'AC', x'75'
    ; Inno wants "$bbggrr" (error in help file? should be $rrggbb ? NOPE OK)
    WizardImageBackColor=$75AC94
    ; with default compression, setup.exe = 1541 Kb
    ; with bzip (best!) compressionm setup.exe = 1540 Kb
    ;Compression=bzip
    ; ======================================================
    ; FILES SECTION USES SourceDir from Setup Section
    ; ======================================================
    ; [InstallDelete' processed as first step of installation. This may be useful for deleting RASY200.DLL and X12NX091.DLL

    [FILES]
    ; Executable and standard support DLLs
    ; In this version of upgrade, ppps.exe is not installed from [FILES]
    ; Main User Interface Executable. Is manually extracted in [Code] section and installed
    ; at that time.
    Source: "ppps.exe"; Flags: dontcopy
    Source: "D:\utility\Serializer\CommonSourceDir\tsiupgrade.dll"; Destdir: "{tmp}"; flags:dontcopy
    ; for 4.0 version 1.10 of tsiupgrade.dll is required.
    ; 9/21/06 I forgot the MSLU. I got away with it because now I am on Nt+ machine
    ; version we use is 1.0.3703
    ; I am just going to extract it to TMP here..
    Source: "D:\utility\Serializer\CommonSourceDir\unicows.dll"; Destdir: "{tmp}"
    Source: "rasys200-4.dll"; DestDir: "{app}\system" ;
    Source: "pppssprg.dll"; DestDir: "{app}\system" ; flags: onlyifdestfileexists
    ; new file 3.2, the archive/extract wizard, let it follow the regular rules:
    Source: "pppsaew.dll"; Destdir: "{app}\System"
    Source: "x12nx091-4.dll"; DestDir: "{app}\system" ;
    ; X221 map module
    Source: "x12NX221.DLL"; DestDir: "{app}\system" ;
    ; system codes database DO NOT OVERWRITE
    Source: "pppsSystem.mdb"; Destdir: "{commonappdata}\Tal Systems\PPPS\4.0"; flags: onlyifdoesntexist
    ; PC_print single claim report as a user option during upgrade
    Source: "pcpmasc.dll"; DestDir: "{app}\system"
    ; supporting text / documentation files moved to commonappdata in 4.0 (out of program files)
    Source: "What's New in PPPS Version 4.0.rtf"; DestDir: "{commonappdata}\Tal Systems\PPPS\4.0"; flags: onlyifdoesntexist
    ; ===[HELP FILE]==========
    ; help file is not versioned; options would be only the 'timestamp' which is not recommended
    ; for the 3.0 to 3.1 upgrade, will just install it
    ; ditto for 3.2
    ;Source: "pppshelp.hlp"; DestDir: "{app}\system"; Flags:ignoreversion
    ;Source: "pppshelp.cnt"; DestDir: "{app}\system"; Flags:ignoreversion
    ; 3.2 uses these files. We want to delete the old help files along with the *.GID and *.FTS if found
    ; I think I will use Installdelete section for that.
    Source: "ppps.chm"; DestDir: "{app}\system"; Flags:ignoreversion

    ; ==={DDOC PRINT AND PREVIEW FILES] =========================================
    ; I think I shall include a new ddoc.exe? What have I been installing with PPPS?
    ; I HAVE been installing 1.9.5e2 which is correct. No update required
    ;============================================================================
    ; INI Section for file PPPSUSER.INI
    ; Since this is an update, there is NO INI section. But if an update does
    ; use a new INI setting, the default value should be placed here
    ; new option in 3.1: Duplicate checking
    ;============================================================================
    [INI]
    ; === NEW INI OPTION VERSION 3.1 : Duplicate checking.
    ; fixed path and name of INI to ppps.ini in commonappdata 1/16/12
    ; allowed values: STORE SKIP ASK NONE THIS IS ALREADY SET FOR PPPS 3.1 or later
    Filename: "{commonappdata}\Tal Systems\PPPS\4.0\ppps.ini"; Section: "Settings" ;Key:"Duplicates"; String:"SKIP"; Flags: createkeyifdoesntexist
    ; for 3x to 4x, add the key to the system codes database. Hmm, if 3x to 4x, I have to put in the old file
    ; for 4x to 4x.. it's not touched anyway so I can use only if it does not exist... except it won't exist 4x/4x
    ; This will work for 3x to 4x.. but not 4x to 4x, it will create a new ini file. I may need a 'code' to
    ; do this correctly. BUT IT DOES NOT HAVE TO WORK 4X TO 4X does it?
    Filename: "{commonappdata}\Tal Systems\PPPS\4.0\ppps.ini"; Section: "Settings" ;Key:"CodesDatabase"; String:"{commonappdata}\Tal Systems\PPPS\4.0\pppssystem.mdb"; Flags: createkeyifdoesntexist
    ; 11/21/11oops this is wrong, the INI file is not installed in APP any more its in commonappdata
    ; and is named ppps.ini!
    ;=====================================================================
    ; Registry entry containing the value of the {app}\system folder and version
    ; We do not need this to do updates (we can use the UsePreviousAppDir setting for that)
    ; but to add the ODBC DSN creator we need this so we can find the database

    ; ------- [REGISTRY Section] ----------------------------------
    ; for version 3.1, we will have a 3.1 key. I am going to try to have the 3.0 key deleted
    ; here by Inno setup using the "deletekey" flag. WORKS PERFECTLY 7-14-06!
    [REGISTRY]
    ; DELETE THE EXISTING VERSION 3.0 KEY and 3.1 key or 3.2 key
    ; deletekey
    ; When this flag is specified, Setup will first try deleting the entire key if it exists,
    ; including all values and subkeys in it. If ValueType is not none, it will then
    ; create a new key and value.
    ; Tested 7/14/06 worked perfectly to delete the 3.0 key and add the 3.1 key
    Root: HKLM; Subkey: "Software\PPPS\3.0\"; ValueType: none; flags:deletekey
    ; now delete the 3.1 key:
    Root: HKLM; Subkey:"Software\PPPS\3.1\"; ValueType: none; flags:deletekey
    ; add the 3.2 key:
    Root: HKLM; Subkey:"Software\PPPS\3.2\"; ValueType: none; Flags:deletekey
    Root: HKLM; Subkey:"Software\PPPS\4.0\"; ValueType:string; ValueName:"Install Path"; ValueData:"{app}"
    ; executable files are installed in system subfolder of {app}. The upgrade DLL looks for this.

    ; ------- [REGISTRY Section] ----------------------------------
    ; =====================================================================
    ; I may change this for upgrade to just install it. I also may still add this
    ; report to the PPPSSPRG module, in which case I will add an installdelete of the separate
    ; DLL file
    [TASKS]
    Name: desktopicon; Description: "Install New &Desktop Icon"
    ; This will not be a task option in 4x, everyone gets it
    ; Name: pcpsc; Description: "Install or Update &PC-PRINT Single Claim Report"

    ; We delete the 3.1 icon; so we add the 3.1 icon. Will be in same group.
    ; Unfortunately, all the 3.0 versions went out with PPPS 3.0 in the main group name
    ; (the name right below the programs menu)
    [ICONS]
    ; -------------------------------------------------------------------------------
    ; Start Menu Icons, always created, built always. Note space before first name
    ; so that will appear first
    ; -------------------------------------------------------------------------------
    Name: "{group}\ Provider Payment Partner System 4.0"; Filename: "{app}\system\ppps.exe"; workingdir:"{app}"
    name: "{group}\PPPS Help File" ; Filename: "{app}\system\ppps.chm" ; workingdir: "{app}"
    Name: "{group}\PPPS Web Site"; Filename: "http://www.providerpaymentpartner.com"
    Name: "{group}\Send e-mail to PPPS support"; Filename: "mailto:[email protected]"
    ; if there is a desktop icon required because of task selection
    Name: "{commondesktop}\Provider Payment Partner System 4.0";Filename: "{app}\system\ppps.exe"; workingdir:"{app}"; Tasks:desktopicon
    ; Remittance de-identifier tool. Tried using no path with useapppaths but got invalid *.lnk. INstalled program OK though
    Name: "{group}\Remittance De-Identifier Tool"; Filename:"{app}\system\835did.exe"; workingdir:"{app}"
    ; create uninstall as last {group} icon item:
    ; 11.27.07 this is not finding the previous {uninstallexe} in an upgrade situation.. I tihnk because
    ; this is 'uninstallable=no" Hmm....
    Name: "{group}\Uninstall the PPPS"; Filename: "{uninstallexe}"


    ; THIS NEXT IS USED IF WE CAN'T DELETE AND REBUILD THE ENTIRE 3.0 ICON SET

    [INSTALLDELETE]
    ; ==WORKS 7-14-06 DO NOT DELETE UNLESS YOU GET THE REST WORKING
    ; delete the 3.0 group icon icon. Note space at start
    ; Type: Files; Name:"{group}\ Provider Payment Partner System 3.0.lnk"
    ; =======================================================================
    ; PLAN B FOR START MENU: WORKS GOOD.
    ; See if we can delete the entire group entry and rebuild ALL the icons
    ; 11.27.07 It did not delete PPPS 3.1 from submenu. I think I need to delete without the "3.1" (I do)
    ; ==
    Type: FilesandorDirs; Name:"{commonprograms}\Provider Payment Partner System 3.0"
    Type: FilesandorDirs; Name:"{commonprograms}\Provider Payment Partner System 3.1"
    Type: FilesandorDirs; Name:"{commonprograms}\Provider Payment Partner System 3.2"
    Type: FilesandorDirs; Name:"{commonprograms}\Provider Payment Partner System"
    ; =======================================================================
    ; Next worked perfectly to delete the desktop icon, and clean up the help file support.
    ; If help support not deleted, the search will be screwed up unless user removes manually.
    Type: files; Name: "{app}\system\pppshelp.gid"
    Type: files; Name: "{app}\system\pppshelp.fts"
    ; delete the pre-3.2 help files:
    Type: files; Name: "{app}\system\pppshelp.cnt"
    Type: files; Name: "{app}\system\pppshelp.hlp"
    ; delete the 3.0 desktop icon if it exists. User must select task above to get new one.
    Type: Files; Name: "{userdesktop}\Provider Payment Partner System 3.0.lnk"
    ; delete the 3.1 desktop icon if it exists.
    Type: Files; Name: "{userdesktop}\Provider Payment Partner System 3.1.lnk"
    ; delete the 3.2 desktop icon if it exists.
    Type: Files; Name: "{userdesktop}\Provider Payment Partner System 3.2.lnk"

    ; ----------------------------------------------------------
    ; also delete the {commondesktop} icons; added this 11/27/07
    ; ----------------------------------------------------------
    Type: Files; Name: "{commondesktop}\Provider Payment Partner System 3.0.lnk"
    Type: Files; Name: "{commondesktop}\Provider Payment Partner System 3.1.lnk"
    Type: Files; Name: "{commondesktop}\Provider Payment Partner System 3.2.lnk"
    ; ==== [CODE] SECTION ===================================
    ; CODE SECTIONS USED TO UPDATE THE SERIAL NUMBER
    ;=========================================================
    [Code]
    var
    ResultCode: Integer;
    // "During Setup, a special 'files:' prefix to instruct Setup to automatically extract the DLL from the
    // [Files] section may also be used.
    function TsiUpgradeCheck (szTmp, szParam, szSpare: String): Integer;
    external '[email protected]:tsiupgrade.dll';


    function InitializeSetup(): Boolean;
    var
    sFile: String;
    sFullFile: String;
    sMsg : String;
    sTmp : String;
    sSpare : String;
    bMsgBox : Boolean;
    iZero : Integer;
    iOne : Integer;
    iTwo : Integer;
    iThree : Integer;
    iFour : Integer;
    iFive : Integer;
    bMutex : Boolean;

    begin
    //
    bMutex := CheckForMutexes ('provider_payment_partner_v_300');

    if bMutex = True then
    begin
    sMsg := 'Cannot run upgrade - PPPS is currently executing.';
    msgbox (sMsg,mbCriticalError, MB_OK);
    Result := False;
    bMsgbox := False;
    end;
    if bMutex = False then
    begin
    iZero := 0;
    iOne := 1;
    iTwo := 2;
    iTHree := 3;
    iFour := 4;
    iFive := 5;
    sFile := 'ppps.exe'; // file to be extracted to {tmp}: the DLL will need it
    sFullFile := ExpandConstant('{tmp}\'+ sFile)
    sTmp := ExpandConstant('{tmp}')
    sSpare := 'log=pppsupgrade.log'

    // get the new PPPS.EXE into {tmp}
    ExtractTemporaryFile (sFile)
    // CALL the UpgradeCheck function. Returns zero if OK to continue.
    // this function with this parameter is looking for 3.0 to be installed.
    // which is exactly what we want.
    // I think for 3.2 I want to also check for 3.2 installed.
    // TsiUpgradeCheck does what...?
    //
    ResultCode := TsiUpgradeCheck (sTmp,'PPPS300',sSpare); // key for PPPS 3x3x upgrade
    // old exec code was here
    // I could check here if not zero, then retry with PPPS 310?
    if ResultCode > 0 then
    begin
    ResultCode := TsiUpgradeCheck (sTmp, 'PPPS310', sSpare)
    end;
    // I think just adding this code will work for upgrade
    if ResultCode > 0 then
    begin
    ResultCode := TsiUpgradeCheck (sTmp, 'PPPS320', sSpare)
    end;
    // Add for 4.0
    if ResultCode > 0 then
    begin
    ResultCode := TsiUpgradeCheck (sTmp, 'PPPS400', sSpare)
    end;
    // at this point if ResultCode = 0 then at least one of 3x or 4x is installed and we may proceed.
    case ResultCode of
    iZero:
    Result := True
    // 1 = not installed
    iOne :
    begin
    sMsg := 'Neither PPPS version 3.x or 4.x is installed on this system. Cannot upgrade.'
    bMsgBox := True
    Result := False
    end
    // 2 = installed EXE not found where it belongs
    iTwo :
    begin
    sMsg := 'Cannot find installed PPPS.EXE in correct folder'
    bMsgBox := True
    Result := False
    end
    // 3= {tmp} exe not found (this is REALLY bad)
    iThree :
    begin
    sMsg := 'Cannot find PPPS.EXE in {tmp} Folder'
    bMsgBox := True
    Result := False
    end
    // 1.03.06 we can no longer get RC 4 or 5 here.
    // 4 = invalid USN
    iFour :
    begin
    sMsg := 'Invalid or Missing Serial Number'
    bMsgBox := True
    Result := False
    end
    // 5 = can't update USN block
    iFive :
    begin
    sMsg := 'Unable to serialize new program file'
    bMsgBox := True
    Result := False
    end
    else
    begin
    sMsg := 'Return code ' + IntToStr (ResultCode)
    Result := False
    bMsgBox := True
    end
    end; // end of case


    if bMsgbox = True then
    begin
    sMsg := sMsg + '. Contact TSI Support for assistance'
    msgbox (sMsg,mbCriticalError, MB_OK)
    end
    end; // end of if bMutex = false's begin

    end;

    /// AFTER INNO SETUP HAS COMPLETED ITS INSTALLATION TASKS, WE EXTRACT THE EXISTING USN BLOCK FROM
    //// CURRENTLY-INSTALLED PPPS, PUT IT INTO THE NEW PPPS.EXE, AND COPY THE NEW PPPS.EXE TO
    /// THE INSTALL FOLDER

    // HELP FILE:
    // You can use this event function to perform your own pre-install and post-install tasks.
    // Called with CurStep=ssInstall just before the actual installation starts, with CurStep=ssPostInstall
    // just after the actual installation finishes, and with CurStep=ssDone just before Setup terminates
    // after a successful install.
    // Test 1/3/06: at ssPostInstall, {tmp} is present as are all files extracted thereto.
    // so this might actually be a better place to do the serialization and overwrite, by simply NOT
    // extracting EDIPAL.EXE earlier. Or maybe by extracting it to {tmp}.

    function PPPSPostInstall (szTmp, szParam, szSpare: String): Integer;
    external '[email protected]:tsiupgrade.dll';

    procedure CurStepChanged(CurStep: TSetupStep);
    var
    sDllParam : String;
    sTmp : String;
    sSpare : String;
    iRet : Integer;

    begin
    if CurStep = ssPostInstall then
    begin
    // PPPS300 string is used by 3.0, 3.1 and 3.2 in PPPSPostInstall procedure
    // PPPS300 string is used by 4.0, too (3/29/11 tsiupgrade v 1.10)
    sDllParam := 'PPPS300' ;
    sSpare := 'log=pppsupgrade.log';
    sTmp := ExpandConstant('{tmp}') ;
    iRet := PPPSPostInstall (sTmp, sDllParam, sSpare);
    // if iret is non-zero, we had a fatal error re-serializing the EXE and the user should contact Tal Systems
    if iRet > 0 THEN
    msgbox ('Fatal Error Code ' + IntToStr(iRet) + ' during serialization. Contact Tal Systems', mbCriticalError, MB_OK);
    end
    end;

    // === END OF
    Code:
     SECTION
    // END OF 3.0 to 3.1 PPPS upgrade script FOR UPGRADES ONLY
    // UPDATED 9/11/06 to handle 3.1 to 3.1 upgrades.
    // Modified 3/29/11 to handle 3x/4x and 4x/4x tested both OK! (only the INI file thing is wrong did not add right key)

    This was a losing battle trying to get the indents in there so I am attaching the file 'as is' except I had to add a "txt" suffix to the "iss" file.

    ppps3x_4x_upgrade.iss.txt
    Attached Files
    Last edited by Michael Mattias; 28 Jan 2021, 01:57 PM.
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      > This was a losing battle trying to get the indents in there so I am attaching the file 'as is' except I had to add a "txt" suffix to the "iss" file.

      That would be caused by the multiple embedded [ C O D E ] strings (sans spaces) in your posted text

      Comment

      Working...
      X