Skip to content

Commit

Permalink
v1.5.1
Browse files Browse the repository at this point in the history
- fixed bug (introduced by v1.5.0) that caused incorrect path for '_savegame.lnk' shorcut, also meaning that any files from '_1st_run.zip' were copied to the wrong location
- added a another icon for 'UniGame_Launcher_restore.exe', and changed its temporary directory from _GameDir_\_DeleteMe to _GameDir\_launcher_restore
- tested all features more thoroughly this time - everything should work as intended. That's all Folks!
  • Loading branch information
alex47exe committed Jun 23, 2020
1 parent ec2f2a5 commit 44c2f4c
Show file tree
Hide file tree
Showing 19 changed files with 270 additions and 182 deletions.
2 changes: 1 addition & 1 deletion ProgramData.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ___ UniGame Launcher v1.5.0 © 2017-2020, SalFisher47
# ___ UniGame Launcher v1.5.1 © 2017-2020, SalFisher47


[game]
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### UniGame Launcher v1.5.0
### UniGame Launcher v1.5.1

Universal launcher for games, to be placed in game folder. I would say it's best to rename it to something like *_Game Name.exe*, so that it's the first file you see there. It includes two versions:

Expand Down
53 changes: 35 additions & 18 deletions UniGame_Launcher_one.au3
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UPX_Parameters=-9 --strip-relocs=0 --compress-exports=0 --compress-icons=0
#AutoIt3Wrapper_Res_Description=UniGame Launcher
#AutoIt3Wrapper_Res_Fileversion=1.5.0.47
#AutoIt3Wrapper_Res_ProductVersion=1.5.0.47
#AutoIt3Wrapper_Res_Fileversion=1.5.1.47
#AutoIt3Wrapper_Res_ProductVersion=1.5.1.47
#AutoIt3Wrapper_Res_LegalCopyright=2017-2020, SalFisher47
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Run_Au3Stripper=y
Expand All @@ -20,8 +20,8 @@
#pragma compile(AutoItExecuteAllowed, True)
#pragma compile(InputBoxRes, True)
#pragma compile(Stripper, True)
#pragma compile(FileVersion, 1.5.0.47)
#pragma compile(ProductVersion, 1.5.0.47)
#pragma compile(FileVersion, 1.5.1.47)
#pragma compile(ProductVersion, 1.5.1.47)
#pragma compile(ProductName, 'UniGame Launcher')
#pragma compile(FileDescription, 'UniGame Launcher')
#pragma compile(LegalCopyright, '2017-2020, SalFisher47')
Expand All @@ -37,7 +37,7 @@
; Language ......: English
; Description ...: Universal Game Launcher one
; Author(s) .....: SalFisher47
; Last Modified .: June 21, 2020 - last compiled on June 21, 2020
; Last Modified .: June 23, 2020 - last compiled on June 23, 2020
; ==================================================================================================================================

#include <Array.au3>
Expand All @@ -58,6 +58,7 @@ Global $7z_dir = $Env_ProgramData & "\SalFisher47\7za", $7z = $7z_dir & "\7za.ex
$Ini = @ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini"
$ini_RunAdmin = IniRead($ini, "launcher", "run_admin", "")
$ini_1stRun = IniRead($ini, "launcher", "1st_run", "")
$_1st_run_ini = "_1st_run.ini"

; check for game path and add it to ini file in C:\ProgramData\SalFisher47\UniGame Launcher
If Not FileExists(@AppDataCommonDir & "\SalFisher47\UniGame Launcher") Then DirCreate(@AppDataCommonDir & "\SalFisher47\UniGame Launcher")
Expand All @@ -67,7 +68,7 @@ FileInstall("ProgramData.ini", $Ini_ProgramData, 0)
; check if _1st_run.zip exists, when 1st_run = 1 in ini file
If $ini_1stRun == 1 Then
If Not FileExists(@ScriptDir & "\_1st_run.zip") Then
$first_launch = 1
; $_1st_run_ini = "_1st_run_example.ini"
FileInstall("_1st_run.zip", @ScriptDir & "\_1st_run.zip", 0)
FileInstall("ProgramData.ini", $Ini_ProgramData, 1)
EndIf
Expand Down Expand Up @@ -144,21 +145,37 @@ $ini_Savegame_dir = IniRead($ini, "savegame", "savegame_dir", "")
$ini_Savegame_subdir = IniRead($ini, "savegame", "savegame_subdir", "")
$Savegame_dir = ""
Switch $ini_Savegame_dir
Case "_MyDocs_" Or "MyDocs"
Case "MyDocs"
$Savegame_dir = @MyDocumentsDir & "\" & $ini_Savegame_subdir
Case "_MyDocs_"
$Savegame_dir = @MyDocumentsDir & "\" & $ini_Savegame_subdir
Case "_PublicDocs_" Or "PublicDocs"
Case "PublicDocs"
$Savegame_dir = @DocumentsCommonDir & "\" & $ini_Savegame_subdir
Case "_PublicDocs_"
$Savegame_dir = @DocumentsCommonDir & "\" & $ini_Savegame_subdir
Case "_RoamingAppData_" Or "RoamingAppData"
Case "RoamingAppData"
$Savegame_dir = $Env_RoamingAppData & "\" & $ini_Savegame_subdir
Case "_LocalAppData_" Or "LocalAppData"
Case "_RoamingAppData_"
$Savegame_dir = $Env_RoamingAppData & "\" & $ini_Savegame_subdir
Case "LocalAppData"
$Savegame_dir = $Env_LocalAppData & "\" & $ini_Savegame_subdir
Case "_LocalAppData_"
$Savegame_dir = $Env_LocalAppData & "\" & $ini_Savegame_subdir
Case "_ProgramData_" Or "ProgramData"
Case "ProgramData"
$Savegame_dir = $Env_ProgramData & "\" & $ini_Savegame_subdir
Case "_SavedGames_" Or "SavedGames"
Case "_ProgramData_"
$Savegame_dir = $Env_ProgramData & "\" & $ini_Savegame_subdir
Case "SavedGames"
$Savegame_dir = $Env_SavedGames & "\" & $ini_Savegame_subdir
Case "_SavedGames_"
$Savegame_dir = $Env_SavedGames & "\" & $ini_Savegame_subdir
Case "_UserProfile_" Or "UserProfile"
Case "UserProfile"
$Savegame_dir = @UserProfileDir & "\" & $ini_Savegame_subdir
Case "_GameDir_" Or "GameDir"
Case "_UserProfile_"
$Savegame_dir = @UserProfileDir & "\" & $ini_Savegame_subdir
Case "GameDir"
$Savegame_dir = @ScriptDir & "\" & $ini_Savegame_subdir
Case "_GameDir_"
$Savegame_dir = @ScriptDir & "\" & $ini_Savegame_subdir
EndSwitch

Expand Down Expand Up @@ -299,7 +316,7 @@ Func _1st_run()
;---
Local $ini_1stRun_copy_from[1], $ini_1stRun_copy_to[1], $ini_1stRun_open_file[1], $ini_1stRun_file_cmd[1]
For $i = 1 To 9
_ArrayAdd($ini_1stRun_copy_from, IniRead(@ScriptDir & "\_1st_run\_1st_run.ini", "copy", "copy_from" & $i, ""))
_ArrayAdd($ini_1stRun_copy_from, IniRead(@ScriptDir & "\_1st_run\" & $_1st_run_ini, "copy", "copy_from" & $i, ""))
If $ini_1stRun_copy_from[$i] <> "" Then
Switch StringLeft($ini_1stRun_copy_from[$i], 8)
Case "_SaveDir"
Expand All @@ -324,7 +341,7 @@ Func _1st_run()
$ini_1stRun_copy_from[$i] = @ScriptDir & "\_1st_run\" & $ini_1stRun_copy_from[$i]
EndSwitch
EndIf
_ArrayAdd($ini_1stRun_copy_to, IniRead(@ScriptDir & "\_1st_run\_1st_run.ini", "copy", "copy_to" & $i, ""))
_ArrayAdd($ini_1stRun_copy_to, IniRead(@ScriptDir & "\_1st_run\" & $_1st_run_ini, "copy", "copy_to" & $i, ""))
If $ini_1stRun_copy_to[$i] <> "" Then
Switch StringLeft($ini_1stRun_copy_to[$i], 8)
Case "_SaveDir"
Expand Down Expand Up @@ -360,7 +377,7 @@ Func _1st_run()
EndIf
Next
For $j = 1 To 9
_ArrayAdd($ini_1stRun_open_file, IniRead(@ScriptDir & "\_1st_run\_1st_run.ini", "open", "open_file" & $j, ""))
_ArrayAdd($ini_1stRun_open_file, IniRead(@ScriptDir & "\_1st_run\" & $_1st_run_ini, "open", "open_file" & $j, ""))
If $ini_1stRun_open_file[$j] <> "" Then
Switch StringLeft($ini_1stRun_open_file[$j], 8)
Case "_SaveDir"
Expand All @@ -385,7 +402,7 @@ Func _1st_run()
$ini_1stRun_open_file[$j] = @ScriptDir & "\_1st_run\" & $ini_1stRun_open_file[$j]
EndSwitch
EndIf
_ArrayAdd($ini_1stRun_file_cmd, IniRead(@ScriptDir & "\_1st_run\_1st_run.ini", "open", "file_cmd" & $j, ""))
_ArrayAdd($ini_1stRun_file_cmd, IniRead(@ScriptDir & "\_1st_run\" & $_1st_run_ini, "open", "file_cmd" & $j, ""))
If $ini_1stRun_file_cmd[$j] <> "" Then
If $CmdLineRaw <> "" Then
If $CmdLineRaw <> $ini_1stRun_file_cmd[$j] Then
Expand Down
Binary file modified UniGame_Launcher_one.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion UniGame_Launcher_one.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ___ UniGame Launcher v1.5.0 © 2017-2020, SalFisher47
# ___ UniGame Launcher v1.5.1 © 2017-2020, SalFisher47


[exe]
Expand Down
68 changes: 37 additions & 31 deletions UniGame_Launcher_one_restore.au3
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=icon.ico
#AutoIt3Wrapper_Icon=icon_restore.ico
#AutoIt3Wrapper_Outfile=UniGame_Launcher_one_restore.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UPX_Parameters=-9 --strip-relocs=0 --compress-exports=0 --compress-icons=0
#AutoIt3Wrapper_Res_Description=UniGame Launcher Restore
#AutoIt3Wrapper_Res_Fileversion=1.1.0.47
#AutoIt3Wrapper_Res_ProductVersion=1.1.0.47
#AutoIt3Wrapper_Res_Fileversion=1.1.5.47
#AutoIt3Wrapper_Res_ProductVersion=1.1.5.47
#AutoIt3Wrapper_Res_LegalCopyright=2019-2020, SalFisher47
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Run_Au3Stripper=y
Expand All @@ -18,8 +18,8 @@
#pragma compile(AutoItExecuteAllowed, True)
#pragma compile(InputBoxRes, True)
#pragma compile(Stripper, True)
#pragma compile(FileVersion, 1.1.0.47)
#pragma compile(ProductVersion, 1.1.0.47)
#pragma compile(FileVersion, 1.1.5.47)
#pragma compile(ProductVersion, 1.1.5.47)
#pragma compile(ProductName, 'UniGame Launcher Restore')
#pragma compile(FileDescription, 'Restore settings & Repack crack')
#pragma compile(LegalCopyright, '2019-2020, SalFisher47')
Expand Down Expand Up @@ -83,11 +83,16 @@ If StringInStr(@ScriptName, "UniGame_Launcher_one_restore") Then
EndIf
IniWrite($newIni, "process", "exe_real", " " & IniRead($oldIni, "process", "exe_real", ""))
If IniRead($oldIni, "savegame", "savegame_dir", "") <> "" Then
IniWrite($newIni, "Savegame", "savegame_dir", " " & "_" & IniRead($oldIni, "savegame", "savegame_dir" & "_", ""))
IniWrite($newIni, "Savegame", "savegame_subdir", " " & "_" & IniRead($oldIni, "savegame", "savegame_subdir" & "_", ""))
ElseIf IniRead($oldIni, "exe", "savegame_dir", "") <> "" Then
IniWrite($newIni, "Savegame", "savegame_dir", " " & "_" & IniRead($oldIni, "savegame", "savegame_dir" & "_", ""))
IniWrite($newIni, "Savegame", "savegame_subdir", " " & "_" & IniRead($oldIni, "savegame", "savegame_subdir" & "_", ""))
If StringLeft(IniRead($oldIni, "savegame", "savegame_dir", ""), 1) == "_" Then
IniWrite($newIni, "Savegame", "savegame_dir", " " & IniRead($oldIni, "savegame", "savegame_dir", ""))
IniWrite($newIni, "Savegame", "savegame_subdir", " " & IniRead($oldIni, "savegame", "savegame_subdir", ""))
Else
IniWrite($newIni, "Savegame", "savegame_dir", " _" & IniRead($oldIni, "savegame", "savegame_dir", "") & "_")
IniWrite($newIni, "Savegame", "savegame_subdir", " " & IniRead($oldIni, "savegame", "savegame_subdir", ""))
EndIf
Else
IniWrite($newIni, "Savegame", "savegame_dir", "")
IniWrite($newIni, "Savegame", "savegame_subdir", "")
EndIf
IniWrite($newIni, "firewall", "exe_block_inbound", " " & IniRead($oldIni, "firewall", "exe_block_inbound", ""))
IniWrite($newIni, "firewall", "exe_block_outbound", " " & IniRead($oldIni, "firewall", "exe_block_outbound", ""))
Expand All @@ -98,31 +103,32 @@ If StringInStr(@ScriptName, "UniGame_Launcher_one_restore") Then
IniWrite($newIni, "launcher", "run_admin", " " & IniRead($oldIni, "launcher", "run_admin", " 1"))
IniWrite($newIni, "launcher", "1st_run", " " & IniRead($oldIni, "launcher", "1st_run", " 0"))

If IniRead($oldIni, "launcher", "1st_run", " 0") == 1 Then FileCopy(@ScriptDir & "\_1st_run.zip", @ScriptDir & "\_DeleteMe\_crack_update\_1st_run.zip", 8)
; If IniRead($oldIni, "launcher", "1st_run", " 0") == 1 Then FileCopy(@ScriptDir & "\_1st_run.zip", @ScriptDir & "\_launcher_restore\_crack_update\_1st_run.zip", 8)
If FileExists(@ScriptDir & "\_1st_run.zip") Then FileCopy(@ScriptDir & "\_1st_run.zip", @ScriptDir & "\_launcher_restore\_crack_update\_1st_run.zip", 8)

If FileExists($sResH & "\ResourceHacker.exe") Then

If Not FileExists(@ScriptDir & "\_DeleteMe\_icon_update") Then DirCreate(@ScriptDir & "\_DeleteMe\_icon_update")
If Not FileExists(@ScriptDir & "\_launcher_restore\_icon_update") Then DirCreate(@ScriptDir & "\_launcher_restore\_icon_update")

FileInstall("_FileInstall\rh_scripts\rh_extract.ini", @ScriptDir & "\_DeleteMe\_icon_update\_rh_extract.ini", 1)
IniWrite(@ScriptDir & "\_DeleteMe\_icon_update\_rh_extract.ini", "FILENAMES", "Open", '"' & $oldExe & '"')
IniWrite(@ScriptDir & "\_DeleteMe\_icon_update\_rh_extract.ini", "FILENAMES", "Save", '')
IniWrite(@ScriptDir & "\_DeleteMe\_icon_update\_rh_extract.ini", "FILENAMES", "Log", '')
RunWait($sResH & '\ResourceHacker.exe -script ' & '"' & @ScriptDir & '\_DeleteMe\_icon_update\_rh_extract.ini"')
;FileDelete(@ScriptDir & "\_DeleteMe\_icon_update\_rh_extract.ini")
FileInstall("_FileInstall\rh_scripts\rh_extract.ini", @ScriptDir & "\_launcher_restore\_icon_update\_rh_extract.ini", 1)
IniWrite(@ScriptDir & "\_launcher_restore\_icon_update\_rh_extract.ini", "FILENAMES", "Open", '"' & $oldExe & '"')
IniWrite(@ScriptDir & "\_launcher_restore\_icon_update\_rh_extract.ini", "FILENAMES", "Save", '')
IniWrite(@ScriptDir & "\_launcher_restore\_icon_update\_rh_extract.ini", "FILENAMES", "Log", '')
RunWait($sResH & '\ResourceHacker.exe -script ' & '"' & @ScriptDir & '\_launcher_restore\_icon_update\_rh_extract.ini"')
;FileDelete(@ScriptDir & "\_launcher_restore\_icon_update\_rh_extract.ini")

FileInstall("_FileInstall\rh_scripts\rh_update.ini", @ScriptDir & "\_DeleteMe\_icon_update\_rh_update.ini", 1)
IniWrite(@ScriptDir & "\_DeleteMe\_icon_update\_rh_update.ini", "FILENAMES", "Open", '"' & $newExe & '"')
IniWrite(@ScriptDir & "\_DeleteMe\_icon_update\_rh_update.ini", "FILENAMES", "Save", '"' & $newExe & '"')
IniWrite(@ScriptDir & "\_DeleteMe\_icon_update\_rh_update.ini", "FILENAMES", "Log", '')
RunWait($sResH & '\ResourceHacker.exe -script ' & '"' & @ScriptDir & '\_DeleteMe\_icon_update\_rh_update.ini"')
;FileDelete(@ScriptDir & "\_DeleteMe\_icon_update\_rh_update.ini")
FileInstall("_FileInstall\rh_scripts\rh_update.ini", @ScriptDir & "\_launcher_restore\_icon_update\_rh_update.ini", 1)
IniWrite(@ScriptDir & "\_launcher_restore\_icon_update\_rh_update.ini", "FILENAMES", "Open", '"' & $newExe & '"')
IniWrite(@ScriptDir & "\_launcher_restore\_icon_update\_rh_update.ini", "FILENAMES", "Save", '"' & $newExe & '"')
IniWrite(@ScriptDir & "\_launcher_restore\_icon_update\_rh_update.ini", "FILENAMES", "Log", '')
RunWait($sResH & '\ResourceHacker.exe -script ' & '"' & @ScriptDir & '\_launcher_restore\_icon_update\_rh_update.ini"')
;FileDelete(@ScriptDir & "\_launcher_restore\_icon_update\_rh_update.ini")

_DirRemoveContent(@ScriptDir & "\_DeleteMe\_icon_update")
_DirRemoveContent(@ScriptDir & "\_launcher_restore\_icon_update")

Else
; Resource Hacker is not installed
MsgBox(16, "Error", "Resource Hacker is not installed")
MsgBox(16, "Error", "Can't update icon for '" & $a2[$j] & "'" & @CRLF & "Resource Hacker is not installed")
EndIf

FileDelete($oldIni)
Expand All @@ -137,28 +143,28 @@ Next
For $k = 1 To UBound($a2)-1
If FileExists($s7Zip & "\7z.exe") Then
If FileExists(@ScriptDir & "\" & StringTrimRight($a2[$k], 4) & ".7z") Then
$7zOldDir = @ScriptDir & "\_DeleteMe\_crack_update"
$7zOldDir = @ScriptDir & "\_launcher_restore\_crack_update"
$7zList = _7zList(@ScriptDir & "\" & StringTrimRight($a2[$k], 4) & ".7z", 0)
For $i = 1 To $7zList[0]
FileCopy(@ScriptDir & "\" & $7zList[$i], $7zOldDir & "\" & $7zList[$i], 9)
Next
;FileMove(@ScriptDir & "\" & StringTrimRight($a2[$k], 4) & ".7z", @ScriptDir & "\_DeleteMe\" & StringTrimRight($a2[$k], 4) & ".7z" & "_backup.7z", 1)
;FileMove(@ScriptDir & "\" & StringTrimRight($a2[$k], 4) & ".7z", @ScriptDir & "\_launcher_restore\" & StringTrimRight($a2[$k], 4) & ".7z" & "_backup.7z", 1)
FileDelete(@ScriptDir & "\" & StringTrimRight($a2[$k], 4) & ".7z")
RunWait($s7Zip & '\7z.exe a "..\..\' & StringTrimRight($a2[$k], 4) & '.7z" -r *.*', $7zOldDir, @SW_HIDE)

_DirRemoveContent($7zOldDir)
EndIf
Else
; 7-Zip is not installed
MsgBox(16, "Error", "7-Zip is not installed")
MsgBox(16, "Error", "Can't repack cracked files to '" & StringTrimRight($a2[$k], 4) & ".7z" & "'" & @CRLF & "7-Zip is not installed")
EndIf
Next

FileDelete(@ScriptDir & "\" & StringTrimRight(@ScriptName, 12) & ".ini")
FileDelete(@ScriptDir & "\" & StringTrimRight(@ScriptName, 12) & ".exe")

_DirRemoveContent(@ScriptDir & "\_DeleteMe")
DirRemove(@ScriptDir & "\_DeleteMe")
_DirRemoveContent(@ScriptDir & "\_launcher_restore")
DirRemove(@ScriptDir & "\_launcher_restore")

ShellExecute(@ComSpec, ' /c TimeOut 1 & Del /F "' & @ScriptFullPath & '"', @TempDir, "", @SW_HIDE)

Expand Down
Binary file modified UniGame_Launcher_one_restore.exe
Binary file not shown.
Loading

0 comments on commit 44c2f4c

Please sign in to comment.