TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Results 1 to 7 of 7

Thread: Inno Setup Help

  1. #1
    Member
    Registered: Mar 2005
    Location: Corvallis, Oregon

    Inno Setup Help

    I tried the newsgroups at http://www.jrsoftware.org/newsgroups.php, but I'm still having problems.

    What I'm trying to install:
    Garrett animation tweaks for Thief: Deadly Shadows

    What I want the installer to do:
    • Install a patch to Kernel_GFXALL.ibt (working)
    • Locate Uninstall_JohnP* or Uninstall_Minimalist* in the TDS root directory. Then have the user choose whether or not they want compatibility with the Minimalist Project or John P's texture packs, through the use of component selection. (not working). Either the installer doesn't find those files, or it does find them, but installs the NoModsInstalled anyway.


    Here's the full script:
    HTML Code:
    [_TopOfScript]
    
    [_ISPP]
    #Pragma Option -v+
    #Pragma VerboseLevel 9 ;Macro and functions successfull call acknowledgements
    #Pragma SpanSymbol "\"
    #define AppVersion "0.5"
    #define AppID "G"
    #define AppCopyright "Copyright  2006 Scott Kingston"
    #define AppUninstallDir "{reg:HKLM\SOFTWARE\Ion Storm\Thief - Deadly Shadows\Animations Uninstall Information}"
    #define AppName "Garrett Animations Setup"
    #define AppCopyright "Copyright  2006 Scott Kingston"
    #define AppDefaultPath "{reg:HKLM\SOFTWARE\Ion Storm\Thief - Deadly Shadows,ION_ROOT|}"
    
    [_EndOfScript]
    ;  HiSoft2000 http://www.Hisoft2000.de Mail: HiSoft2000@HiSoft2000.de  2002-2005
    ; Visual dBase, dB2K, dBase SE and dBase Plus  dataBased Intelligence.Inc Homepage: http://www.databi.com/
    ; dQuery for Delphi,C++,dBASE PLUS  dataBased Intelligence.Inc see also Homepage: http://www.dQuery.com/
    [Setup]
    AppName=Garrett Animations Tweak
    AppVerName={#AppVersion}
    AppPublisher=ascottk
    DefaultGroupName=Garrett Animations
    AllowNoIcons=true
    LicenseFile=F:\RealistPatching\GFXALL-patch\GA4TDSlicense.txt
    InfoBeforeFile=F:\RealistPatching\GFXALL-patch\GA4TDSInfo.rtf
    OutputBaseFilename=GarrAT_Setup-0.5
    SolidCompression=true
    OutputDir=F:\
    AppCopyright={#AppCopyright}
    RestartIfNeededByRun=false
    VersionInfoVersion={#AppVersion}
    VersionInfoTextVersion={#AppVersion}
    AllowUNCPath=false
    AppId={#AppID}
    AppPublisherURL=http://home.comcast.net/~ascottk
    CreateAppDir=true
    UninstallFilesDir={#AppDefaultPath}\GarrAT_Uninstall
    UsePreviousAppDir=true
    AllowCancelDuringInstall=true
    AppendDefaultDirName=false
    SourceDir=F:\RealistPatching
    InternalCompressLevel=fast
    ShowLanguageDialog=yes
    DefaultDirName={#AppDefaultPath}
    DirExistsWarning=no
    DisableDirPage=false
    DisableFinishedPage=false
    AlwaysShowDirOnReadyPage=false
    AlwaysShowComponentsList=true
    ShowComponentSizes=false
    FlatComponentsList=true
    AppVersion={#AppVersion}
    
    [Languages]
    Name: english; MessagesFile: compiler:Default.isl
    
    [Messages]
    WizardSelectDir=Select your working Thief: Deadly Shadows directory
    
    [Tasks]
    
    [Types]
    Name: Default; Description: Default Installation; Flags: iscustom
    Name: ModSupport; Description: Compatibility with other mods; Flags: iscustom
    
    [Components]
    Name: Default; Description: No Modifications Installed  (No texture packs or Minimalist); Flags: exclusive; Check: NoModsInstalled; Types: Default
    Name: JohnP; Description: Install with John P's Texture Pack Compatibility; Types: ModSupport; Check: JohnPInstalled; Flags: exclusive
    Name: Minimalist; Description: Install with Minimalist 1.4.1 Compatibility; Types: ModSupport; Check: MinimalistInstalled; Flags: exclusive
    Name: Minimalist_JohnP; Description: Install with  John P. and Minimalist Compatibility; Types: ModSupport; Check: BothModsInstalled; Flags: exclusive
    
    [Dirs]
    Name: {app}\CONTENT\T3\Maps\GarrAT_Install; Flags: deleteafterinstall uninsalwaysuninstall
    Name: {app}\CONTENT\T3\Maps\AnimationsBackup; Flags: uninsalwaysuninstall
    Name: {app}\System\GarrAT_backup; Flags: uninsalwaysuninstall
    Name: {app}\GarrAT_Uninstall; Flags: uninsalwaysuninstall
    Name: {app}\System\INI_tmp; Flags: deleteafterinstall uninsalwaysuninstall
    Name: {app}\System\Shaders
    
    [Files]
    Source: {app}\System\T3PlayerAnims.ini; DestDir: {app}\System\GarrAT_backup; Flags: uninsneveruninstall external skipifsourcedoesntexist
    Source: GFXALL-patch\bunzip2.exe; DestDir: {app}\CONTENT\T3\Maps\GarrAT_Install; Flags: deleteafterinstall
    Source: GFXALL-patch\bzip2.exe; DestDir: {app}\CONTENT\T3\Maps\GarrAT_Install; Flags: deleteafterinstall
    Source: GFXALL-patch\bzip2.dll; DestDir: {app}\CONTENT\T3\Maps\GarrAT_Install; Flags: deleteafterinstall
    Source: GFXALL-patch\bzip2recover.exe; DestDir: {app}\CONTENT\T3\Maps\GarrAT_Install; Flags: deleteafterinstall
    Source: GFXALL-patch\bspatch.exe; DestDir: {app}\CONTENT\T3\Maps\GarrAT_Install; Flags: deleteafterinstall
    Source: GFXALL-patch\Kernel_GFXALL-backup-dir.bat; DestDir: {app}; Flags: deleteafterinstall
    Source: GFXALL-patch\Kernel_GFXALL-patch; DestDir: {app}\CONTENT\T3\Maps\GarrAT_Install; Flags: deleteafterinstall
    Source: GFXALL-patch\Kernel_GFXALL-patch-minimalist; DestDir: {app}\CONTENT\T3\Maps\GarrAT_Install; Flags: deleteafterinstall
    Source: GFXALL-patch\Kernel_GFXALL-patch-minimalist-john_p; DestDir: {app}\CONTENT\T3\Maps\GarrAT_Install; Flags: deleteafterinstall
    Source: GFXALL-patch\Kernel_GFXALL-patch-john_p; DestDir: {app}\CONTENT\T3\Maps\GarrAT_Install; Flags: deleteafterinstall
    Source: GFXALL-patch\Kernel_GFXALL-replace.bat; DestDir: {app}; Flags: deleteafterinstall
    Source: GFXALL-patch\Kernel_GFXALL-replace-minimalist.bat; DestDir: {app}; Flags: deleteafterinstall
    Source: GFXALL-patch\T3PlayerAnims.ini; DestDir: {app}\System\INI_tmp
    Source: GFXALL-patch\BasicOverlayNoise.dds; DestDir: {app}\CONTENT\T3\PCTextures\DynamicallyLoaded; Flags: onlyifdoesntexist
    Source: GFXALL-patch\BasicOverlayScanLines.dds; DestDir: {app}\CONTENT\T3\PCTextures\DynamicallyLoaded; Flags: onlyifdoesntexist
    Source: GFXALL-patch\VisionBiomodBaseOverlay.dds; DestDir: {app}\CONTENT\T3\PCTextures\DynamicallyLoaded; Flags: onlyifdoesntexist
    Source: GFXALL-patch\OverlayFx11.nvo; DestDir: {app}\System\Shaders; Flags: onlyifdoesntexist
    Source: GFXALL-patch\OverlayFx11.pso; DestDir: {app}\System\Shaders; Flags: onlyifdoesntexist
    Source: GFXALL-patch\Kernel_GFXALL-restore-minimalist.bat; DestDir: {app}\GarrAT_Uninstall; Attribs: hidden
    Source: GFXALL-patch\Kernel_GFXALL-restore.bat; DestDir: {app}\GarrAT_Uninstall; Attribs: hidden
    
    [Run]
    Filename: {app}\Kernel_GFXALL-backup-dir.bat; WorkingDir: {app}; StatusMsg: Backing Up Original Files; Components: ; Languages: ; Flags: runhidden
    Filename: {app}\Kernel_GFXALL-replace-minimalist.bat; WorkingDir: {app}; StatusMsg: Replacing T3Camera.ini; Flags: runhidden
    Filename: {app}\CONTENT\T3\Maps\GarrAT_Install\bspatch.exe; Parameters: ..\Kernel_GFXALL.ibt Kernel_GFXALL.ibt Kernel_GFXALL-patch; WorkingDir: {app}\CONTENT\T3\Maps\GarrAT_Install; StatusMsg: Patching with Default Installation; Flags: runhidden
    Filename: {app}\CONTENT\T3\Maps\GarrAT_Install\bspatch.exe; Parameters: ..\Kernel_GFXALL.ibt Kernel_GFXALL.ibt Kernel_GFXALL-patch-john_p; WorkingDir: {app}\CONTENT\T3\Maps\GarrAT_Install; StatusMsg: Patching with John P. Texture Pack Compatibility; Flags: runhidden
    Filename: {app}\CONTENT\T3\Maps\GarrAT_Install\bspatch.exe; Parameters: ..\Kernel_GFXALL.ibt Kernel_GFXALL.ibt Kernel_GFXALL-patch-minimalist; WorkingDir: {app}\CONTENT\T3\Maps\GarrAT_Install; StatusMsg: Patching with Minimalist Compatibility; Flags: runhidden
    Filename: {app}\CONTENT\T3\Maps\GarrAT_Install\bspatch.exe; Parameters: ..\Kernel_GFXALL.ibt Kernel_GFXALL.ibt Kernel_GFXALL-patch-minimalist-john_p; WorkingDir: {app}\CONTENT\T3\Maps\GarrAT_Install; StatusMsg: Patching with John P. and Minimalist Compatibility; Flags: runhidden
    Filename: {app}\Kernel_GFXALL-replace.bat; WorkingDir: {app}; Components: ; StatusMsg: Replacing Animations; Flags: runhidden
    
    [Registry]
    Root: HKLM; SubKey: SOFTWARE\ascottk; ValueType: string; ValueName: GarrAT; Flags: uninsdeletekey
    
    [Icons]
    
    [UninstallDelete]
    
    [UninstallRun]
    Filename: {app}\GarrAT_Uninstall\Kernel_GFXALL-restore-minimalist.bat; WorkingDir: {app}; RunOnceId: minimalist-uninst; Flags: runhidden
    Filename: {app}\GarrAT_Uninstall\Kernel_GFXALL-restore.bat; WorkingDir: {app}; Components: ; RunOnceId: garrat-uninst; Flags: runhidden
    [Code]
    function JohnPInstalled: Boolean;
    var
    	JohnP: TFindRec;
    begin
    	Result := False;
        if FindFirst(AddBackslash('{#AppDefaultPath}') + 'Uninstall_JohnP*.exe', JohnP) then begin
    		FindClose(JohnP);
    		Result := True;
        end;
    end;
    
    function MinimalistInstalled: Boolean;
    var
    	Minimalist: TFindRec;
    begin
    	Result := False;
        if FindFirst(AddBackslash('{#AppDefaultPath}') + 'Uninstall_Minimalist*.exe', Minimalist) then begin
    		FindClose(Minimalist);
    		Result := True;
        end;
    end;
    
    function NoModsInstalled(): Boolean;
    begin
    	Result := not JohnPInstalled and not MinimalistInstalled
    end;
    
    function BothModsInstalled(): Boolean;
    begin
    	Result := JohnPInstalled and MinimalistInstalled;
    end;
    Any help is appreciated, thanks.

  2. #2
    Member
    Registered: Feb 2003
    Location: Finland
    Well, let's see...

    Code:
    function NoModsInstalled(): Boolean;
    begin
    Result := not JohnPInstalled and not MinimalistInstalled
    end;
    
    function BothModsInstalled(): Boolean;
    begin
    Result := JohnPInstalled and MinimalistInstalled;
    end;
    At first I would suggest to you remove both brackets before colon as they do not fit in procedure (or in this particular case, function) definition in pascal language. And add semi-colon at the end of Result-clause in NoModsInstalled-function.

    Code:
    function JohnPInstalled: Boolean;
    var
    JohnP: TFindRec;
    begin
    Result := False;
        if FindFirst(AddBackslash('{#AppDefaultPath}') + 'Uninstall_JohnP*.exe', JohnP) then begin
    FindClose(JohnP);
    Result := True;
        end;
    end;
    
    function MinimalistInstalled: Boolean;
    var
    Minimalist: TFindRec;
    begin
    Result := False;
        if FindFirst(AddBackslash('{#AppDefaultPath}') + 'Uninstall_Minimalist*.exe', Minimalist) then begin
    FindClose(Minimalist);
    Result := True;
        end;
    end;
    And here you should move those FindClose() clauses out from if-clause and put them after if-clauses.

  3. #3
    Member
    Registered: Mar 2005
    Location: Corvallis, Oregon
    Thanks for the reply, but the the find function -- in the code section -- still doesn't work properly. I tried adding the check parameters to the install files, the install run section (both without the components and types), and the component section. I keep getting the same result: the default install. I may have to do without the checks, but I'm hoping not, because some people install the mod with mod compatibility even if those mods are not installed.

  4. #4
    Member
    Registered: Feb 2003
    Location: Finland
    Ah, I think I have found error in your search function, ascottk.

    FindFirst-function needs file attribute mask flag before it can return something useful information back to your script.

    So change your code to look like this:
    Code:
    FindFirst(AddBackslash('{#AppDefaultPath}') + 'Uninstall_JohnP*.exe', faAnyFile, JohnP)
    Here is more information about FindFirst-function and it's parameters : http://www.delphibasics.co.uk/RTL.asp?Name=FindFirst

    EDIT: After downloading and installing newest version of Inno Setup, I checked it's documentation and it's seems that it is using own version of FindFirst-function. So what I wrote here you can dismiss as false information.
    Last edited by The Brain; 30th Apr 2006 at 14:16.

  5. #5
    Member
    Registered: Mar 2005
    Location: Corvallis, Oregon
    Yeah, I get an unknown identifier, "faAnyFile".

  6. #6
    Member
    Registered: Mar 2005
    Location: Corvallis, Oregon
    Oops, double post . . .

    Finally have it figured out. Gavin Lambert @ the Inno Setup newsgroups helped out quite a bit. The FindFirst function returned a string value, an ISPP definition:
    Code:
    #define AppDefaultPath "{reg:HKLM\SOFTWARE\Ion Storm\Thief - Deadly Shadows,ION_ROOT|}"
    instead of actually going to the install directory. So I replaced
    Code:
    AddBackslash('{#AppDefaultPath}') + 'Uninstall_JohnP*'
    to this:
    Code:
    ExpandConstant('{#AppDefaultPath}\Uninstall_JohnP*')
    Here's the fixed code:

    HTML Code:
    function JohnPInstalled: Boolean;
    var
    	JohnP: TFindRec;
    begin
            if FindFirst(ExpandConstant('{#AppDefaultPath}\Uninstall_JohnP*'), JohnP) then begin
    		Result := True;
    	end else begin
    		Result := False;
    	end;
    	FindClose(JohnP);
    end;
    
    function MinimalistInstalled: Boolean;
    var
    	Minimalist: TFindRec;
    begin
             if FindFirst(ExpandConstant('{#AppDefaultPath}\Uninstall_Minimalist*'), Minimalist) then begin
    		Result := True;
             end else begin
    		Result := False;
    	end;
    	FindClose(Minimalist);
    end;
    
    function NoModsInstalled: Boolean;
    begin
    	Result := not JohnPInstalled and not MinimalistInstalled;
    end;
    
    function BothModsInstalled: Boolean;
    begin
    	Result := JohnPInstalled and MinimalistInstalled;
    end;

  7. #7
    New Member
    Registered: May 2006

    Request "font install" script for Inno Setup

    I have a need to install some fonts with my programs using Inno, is there a script already made for this? If so, please show me the way so I could download it.

    Many thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •