From 17f847ab6cba89ad2180f0d8218f34cf20b5e335 Mon Sep 17 00:00:00 2001 From: Gogodr Date: Tue, 7 Jun 2022 16:09:13 -0500 Subject: [PATCH] update and relaunch procedure --- README.md | 3 +++ compile.py | 1 + file_version_info.txt | 8 ++++---- index.py | 17 +++++++++++++---- modules/config.py | 2 +- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3d63181..cba77ad 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,9 @@ Audio files from [MixKit](https://mixkit.co/) ### Changelog +### 1.2.4.1 +- Update and relaunch procedure rework + ### 1.2.3.1 - Logging update - Launcher version check diff --git a/compile.py b/compile.py index 2256efe..b540b15 100644 --- a/compile.py +++ b/compile.py @@ -12,4 +12,5 @@ PyInstaller.__main__.run([ 'compile.spec', + '--clean' ]) \ No newline at end of file diff --git a/file_version_info.txt b/file_version_info.txt index e39bd57..2fe6a52 100644 --- a/file_version_info.txt +++ b/file_version_info.txt @@ -7,8 +7,8 @@ VSVersionInfo( ffi=FixedFileInfo( # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4) # Set not needed items to zero 0. Must always contain 4 elements. - filevers=(1,2,1,1), - prodvers=(1,2,1,1), + filevers=(1,2,3,1), + prodvers=(1,2,3,1), # Contains a bitmask that specifies the valid bits 'flags'r mask=0x3f, # Contains a bitmask that specifies the Boolean attributes of the file. @@ -32,12 +32,12 @@ VSVersionInfo( u'040904B0', [StringStruct(u'CompanyName', u'Lost Ark Market Online'), StringStruct(u'FileDescription', u'Lost Ark Market Online Launcher App'), - StringStruct(u'FileVersion', u'1.2.1.1'), + StringStruct(u'FileVersion', u'1.2.3.1'), StringStruct(u'InternalName', u'Launcher App'), StringStruct(u'LegalCopyright', u'© Lost Ark Market Online'), StringStruct(u'OriginalFilename', u'lamo-launcher.exe'), StringStruct(u'ProductName', u'Lost Ark Market Online Launcher App'), - StringStruct(u'ProductVersion', u'1.2.1.1')]) + StringStruct(u'ProductVersion', u'1.2.3.1')]) ]), VarFileInfo([VarStruct(u'Translation', [1033, 1200])]) ] diff --git a/index.py b/index.py index d56474b..bb6ebfa 100644 --- a/index.py +++ b/index.py @@ -30,7 +30,6 @@ def __init__(self, *args, **kwargs): self.launcher_check_config() # Launcher Version Check - def launcher_check_config(self): Config().check_launcher_version() AppLogger().info( @@ -41,7 +40,7 @@ def launcher_check_config(self): self.download = LostArkMarketLauncherDownload({ "url": f'https://github.com/gogodr/LostArk-Market-Launcher/releases/download/{Config().launcher_version}/{Config().launcher_file}.exe', "title": f'New version of the Lost Ark Market Launcher Found: v{Config().launcher_version}', - "file": f'{Config().launcher_file}.exe' + "file": f'{Config().launcher_file}.exe.new' }) self.download.launch.connect(self.launch_launcher) self.download.finished_download.connect(self.launcher_downloaded) @@ -49,8 +48,18 @@ def launcher_check_config(self): self.session_check() def launch_launcher(self): - os.startfile(sys.argv[0]) - sys.exit() + f = open("update-launcher.bat", "w") + f.write("""@echo off +taskkill /f /im lamo-launcher.exe >nul +timeout /t 1 /nobreak >nul +del lamo-launcher.exe +timeout /t 1 /nobreak >nul +ren lamo-launcher.exe.new lamo-launcher.exe +timeout /t 1 /nobreak >nul +start /b lamo-launcher.exe +(goto) 2>nul & del "%~f0""") + f.close() + os.system("update-launcher.bat") def launcher_downloaded(self): playDownloadComplete() diff --git a/modules/config.py b/modules/config.py index a7ff57f..da3fcd4 100644 --- a/modules/config.py +++ b/modules/config.py @@ -7,7 +7,7 @@ class Config(metaclass=Singleton): - version = "1.2.3.1" + version = "1.2.4.1" debug = False id_token: str = None refresh_token: str = None