Rebuild sync updater script

This commit is contained in:
DSR! 2023-08-01 20:12:16 -03:00
parent fd610e1d60
commit 59e1e8e1e8
2 changed files with 14 additions and 3 deletions

View File

@ -24,6 +24,7 @@ VIAddVersionKey /LANG=1033 "ProductName" "auto-config-ini"
VIAddVersionKey /LANG=1033 "FileDescription" "Indetectables Toolkit updater auto config tools.ini"
VIAddVersionKey /LANG=1033 "LegalCopyright" "2023"
Function .onInit
; read exe params
${GetParameters} $RAW_PARAMS
@ -55,22 +56,29 @@ Function .onInit
${EndIf}
FunctionEnd
; script default action
; Autoloader
Section ""
; debug
;MessageBox MB_OK "$CHECK_TYPE"
;MessageBox MB_OK "$CONFIG_PATH"
; Synchronizes the updater configuration
${If} $CHECK_TYPE == "sync"
Call ConfigSectionSync
${GetSectionNames} "$CONFIG_PATH" "ReadSectionSyncCallback"
; Set the default updater configuration
${ElseIf} $CHECK_TYPE == "toolkit"
Call ConfigToolkitDefault
; Eliminate the tools that are not installed
${Else}
${GetSectionNames} "$CONFIG_PATH" "ReadSectionCleanCallback"
${EndIf}
SectionEnd
; Synchronizes the updater configuration with the one the user had on their machine
Function ConfigSectionSync
; sync "disable_clean" from old file to new
@ -94,13 +102,15 @@ Function ConfigSectionSync
WriteINIStr "$CONFIG_PATH" "UpdaterConfig" "use_github_api" "$R0"
FunctionEnd
; Set the default updater configuration within the toolkit
; Set the default updater configuration
Function ConfigToolkitDefault
; this is the correct updater configuration for use in the toolkit
; this is the correct updater configuration for use in the installed version of toolkit
WriteINIStr "$CONFIG_PATH" "UpdaterConfig" "disable_clean" "True"
WriteINIStr "$CONFIG_PATH" "UpdaterConfig" "disable_repack" "True"
FunctionEnd
; Callback to synchronize the state of the tools
Function ReadSectionSyncCallback
; analyze all except the updater config and updater self updater
@ -125,6 +135,7 @@ Function ReadSectionSyncCallback
Push $0
FunctionEnd
; Callback to eliminate the tools that are not installed in the system
Function ReadSectionCleanCallback
; analyze all except the updater config and updater self updater

Binary file not shown.