|
#3
|
|||
|
|||
|
How to add unlimited Redists from an ini?
Code:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define public RedistsINI ".\\Redists.ini"
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
[Run]
#ifnexist RedistsINI
#error Ini for redists reading can't be find
#endif
#define public Section
#define public i
#define public Counter
#expr Counter = 0
#define public RedistFileName
#define public RedistWorkingDir
#define public RedistParameters
#define public RedistFlags
#define public RedistCheck
#sub AddRedist
#expr Counter = Counter + 1
#expr Section = StringChange("RedistCounter", "Counter", str(Counter) )
#expr RedistFileName = ReadIni(SourcePath + RedistsINI , Section , "FileName")
#expr RedistWorkingDir = Readini(SourcePath + RedistsINI , Section , "Workingdir","{src}")
#expr RedistParameters = Readini(SourcePath + RedistsINI , Section , "Parameters","")
#expr RedistFlags = Readini(SourcePath + RedistsINI , Section, "Flags","waituntilterminated skipifdoesntexist")
#expr RedistCheck = Readini(SourcePath + RedistsINI , Section , "Checks","")
Filename: "{#RedistFileName}"; WorkingDir: "{#RedistWorkingDir}" ; Parameters: {#RedistParameters}; Flags: {#RedistFlags}; Check: {#RedistCheck};
#endsub
#for { i = 1 ; ReadIni( SourcePath + RedistsINI, StringChange( "RedistCounter", "Counter", str(i)) , "FileName" , "" ) != "" ; i++ } AddRedist
Code:
[Redist1]
FileName={src}\redist\DirectX\DXSETUP.exe
Workingdir={src}
Parameters=
Flags=waituntilterminated
;Checks=IsWin64 and Installredist and CheckError
[Redist2]
FileName={src}\redist\vcredist\vcredist_x86.exe
Workingdir={src}
Parameters=/Q
Flags=waituntilterminated
;Checks=not IsWin64 and Installredist and CheckError
[Redist3]
FileName={src}\redist\vcredist\vcredist_x64.exe
Workingdir={src}
Parameters=/Q
Flags=waituntilterminated
;Checks=IsWin64 and Installredist and CheckError
Section - [RUN] Code is Written by me. |
| The Following 5 Users Say Thank You to Gupta For This Useful Post: | ||
Cesar82 (28-03-2017), EzzEldin16 (05-01-2018), Razor12911 (14-03-2017), Simorq (16-07-2017), TWOELV (13-03-2017) | ||
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| BlackBox v2 | y_thelastknight | Conversion Tutorials | 567 | 11-03-2025 07:16 |
| INNO TROUBLESHOOT - Tutorials and Answers about INNO Setup | REV0 | Conversion Tutorials | 129 | 21-05-2021 05:51 |
| Inno Setup: Additional Libraries | altef_4 | Conversion Tutorials | 50 | 21-10-2020 09:59 |
| Useful Dll for Inno Setup users | peterf1999 | Conversion Tutorials | 88 | 01-12-2017 16:00 |
| INNO TUTORIAL - Using Unicode and ANSI Versions of INNO Setup | REV0 | Conversion Tutorials | 51 | 26-03-2015 06:57 |