Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-03-2017, 07:32
Gupta Gupta is offline
Banned
 
Join Date: Aug 2016
Location: https://t.me/pump_upp
Posts: 399
Thanks: 139
Thanked 715 Times in 231 Posts
Gupta is on a distinguished road
Send a message via ICQ to Gupta Send a message via AIM to Gupta Send a message via Yahoo to Gupta
How to add unlimited shortcuts 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 ShortcutsINI ".\\Shortcuts.ini"

[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application

[Icons]
#ifnexist ShortCutsINI
  #error Ini doesn't Exists
#endif
#define public Counter
#define public i
#define public Section

#expr Counter = 0
#define public ExeName
#define public ExeFile
#define public ExeGroupFile
#define public ExeParameters
#define public ExeWorkingDir
#define public ExeComment
#define public ExeIconFileName
#define public ExeFlags
#sub AddIcons
  #expr Counter = Counter + 1
  #expr Section = StringChange( "ExeCounter", "Counter", str(Counter) )
  #expr ExeName = ReadIni (SourcePath + ShortcutsINI , Section, "Name")
  #expr Exefile = Readini  (SourcePath + ShortcutsINI , Section, "File")
  #expr ExeParameters = Readini  (SourcePath + ShortcutsINI , Section, "Parameters","")
  #expr ExeWorkingDir = Readini  (SourcePath + ShortcutsINI , Section, "WorkingDir","{app}")
  #expr ExeComment = Readini  (SourcePath + ShortcutsINI , Section, "Comment","Play")
  #expr ExeIconFileName = Readini  (SourcePath + ShortcutsINI , Section, "IconFileName","")
  #expr ExeFlags = Readini  (SourcePath + ShortcutsINI , Section, "Flags","")
  #if ReadIni(SourcePath + ShortcutsINI, Section, "GroupShortCut","0") != "0"
    #expr ExeGroupFile = Readini(SourcePath + ShortcutsINI , Section, "GroupIconName","")
    Name: "{group}\{#ExeGroupFile}"; Filename:"{#ExeFile}"; Parameters: "{#ExeParameters}" ; WorkingDir: "{#ExeWorkingDir}" ; Comment: "{#ExeComment}" ; IconFilename: "{#ExeIconFileName}" ; Flags: {#ExeFlags}  ; 
  #endif
  Name: "{userdesktop}\{#ExeName}"; Filename: "{#ExeFile}"; Parameters: "{#ExeParameters}" ; WorkingDir: "{#ExeWorkingDir}"; Comment: "{#ExeComment}" ; IconFilename: "{#ExeIconFileName}" ; Flags: {#ExeFlags}  ; 
#endsub
#for { i = 1 ; ReadIni( SourcePath + ShortcutsINI, StringChange( "ExeCounter", "Counter", str(i)) , "Name" , "" ) != "" ; i++ } AddIcons
Ini Structure Should be:
Code:
[Exe1]
Name=Play - Some game
File={app}\SomeExecutable
Parameters=/play filename.mid
WorkingDir={app}
Comment=This is my program
IconFileName={app}\myicon.ico
;Flags=createonlyiffileexists
GroupShortCut=0
GroupIconName=SomeExecutableName

[Exe2]
Name=Play - Some game2
File={app}\SomeExecutable
Parameters=/play filename.mid
WorkingDir={app}
Comment=This is my program
IconFileName={app}\myicon.ico
;Flags=createonlyiffileexists
GroupShortCut=0
GroupIconName=SomeExecutableName

[Exe3]
Name=Play - Some game3
File={app}\SomeExecutable
Parameters=/play filename.mid
WorkingDir={app}
Comment=This is my program
IconFileName={app}\myicon.ico
;Flags=createonlyiffileexists
GroupShortCut=0
GroupIconNameSomeExecutableName

[Exe4]
Name=Play - Some game4
File={app}\SomeExecutable
Parameters=/play filename.mid
WorkingDir={app}
Comment=This is my program
IconFileName={app}\myicon.ico
;Flags=createonlyiffileexists
GroupShortCut=0
GroupIconName=SomeExecutableName
I wrote this Myselef
Reply With Quote
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), TWOELV (13-03-2017), Viper645 (10-03-2017)
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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



All times are GMT -7. The time now is 05:37.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com