22#AutoIt3Wrapper_Icon= Resources\AltLauncher.ico
33#AutoIt3Wrapper_Outfile= Build\AltLauncher.exe
44#AutoIt3Wrapper_UseX64= n
5- #AutoIt3Wrapper_Res_Fileversion= 0.1.0.1
5+ #AutoIt3Wrapper_Res_Fileversion= 0.1.0.2
66#AutoIt3Wrapper_Res_Fileversion_AutoIncrement= p
77#AutoIt3Wrapper_Res_Language= 1033
88#AutoIt3Wrapper_Run_Before= cmd / c echo %fileversion% > " %scriptdir%\VERSION"
99#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
1010#include < Constants.au3>
11+ #include < File.au3>
1112#include < Misc.au3>
1213Opt (" TrayIconHide" , True )
1314Global $Title = " AltLauncher"
@@ -29,8 +30,8 @@ WaitWhileGameRunning()
2930doExit()
3031
3132Func RegisterVariables()
32- Global $backup = " backup" ,$restore = " restore"
33- EndFunc
33+ Global $backup = " backup" , $restore = " restore"
34+ EndFunc ; ==>RegisterVariables
3435Func ReadINISection(ByRef $Ini , $Section )
3536 Local $Data = IniReadSection ($Ini , $Section )
3637 If @error Then
@@ -41,8 +42,14 @@ Func ReadINISection(ByRef $Ini, $Section)
4142EndFunc ; ==>ReadINISection
4243Func ReadConfig()
4344 Global $Ini = @ScriptDir & " \" & StringTrimRight (@ScriptName , 4 ) & " .ini"
44- If Not FileExists ($Ini ) Then ExitMSG(" AltLauncher.ini not found." )
45+ If Not FileExists ($Ini ) Then
46+ $SearchResults = _FileListToArrayRec(@ScriptDir , StringTrimRight (@ScriptName , 4 ) & " .ini" , $FLTAR_FILES , $FLTAR_RECUR )
47+ _ArrayDisplay($SearchResults , @error )
48+ If $SearchResults [0 ] = 1 Then $Ini = @ScriptDir & " \" & $SearchResults [0 ]
49+ If $SearchResults [0 ] <> 1 Then ExitMSG(" AltLauncher.ini not found." )
50+ EndIf
4551 Global $Name = IniRead ($Ini , " General" , " Name" , Null )
52+ Global $Path = IniRead ($Ini , " General" , " Path" , Null )
4653 Global $Executable = IniRead ($Ini , " General" , " Executable" , Null )
4754 Global $LaunchFlags = IniRead ($Ini , " General" , " LaunchFlags" , Null )
4855 Global $MinWait = IniRead ($Ini , " Settings" , " MinWait" , 0 )
@@ -87,12 +94,12 @@ EndFunc ;==>ShowProgressBar
8794Func RunLauncherIfNeeded()
8895 If FileExists (@ScriptDir & " \" & StringTrimRight (@ScriptName , 4 ) & " -launcher.cmd" ) Then
8996 ProgressSet (100 , " Starting Launcher..." , " " )
90- ShellExecuteWait (@ScriptDir & " \" & StringTrimRight (@ScriptName , 4 ) & " -launcher.cmd" , " " , @ScriptDir , $SHEX_OPEN , @SW_HIDE )
97+ ShellExecuteWait (@ScriptDir & " \" & StringTrimRight (@ScriptName , 4 ) & " -launcher.cmd" , " " , ( $Path = Null ) ? @ScriptDir : $Path , $SHEX_OPEN , @SW_HIDE )
9198 EndIf
9299EndFunc ; ==>RunLauncherIfNeeded
93100Func RunGame()
94101 ProgressSet (100 , " Launching Game..." , " " )
95- ShellExecute ($Executable , $LaunchFlags , @ScriptDir )
102+ ShellExecute ($Executable , $LaunchFlags , ( $Path = Null ) ? @ScriptDir : $Path )
96103EndFunc ; ==>RunGame
97104Func WaitWhileGameRunning()
98105 ProgressSet (100 , " Waiting for game to close..." )
@@ -223,4 +230,4 @@ Func doExit($immediately = False)
223230EndFunc ; ==>doExit
224231Func ExitMSG($msg )
225232 Exit MsgBox ($MB_OK + $MB_ICONERROR + $MB_SYSTEMMODAL , " AltLauncher" , $msg )
226- EndFunc ; ==>ExitMSG
233+ EndFunc ; ==>ExitMSG
0 commit comments