diff --git a/Randosu.exe b/Randosu.exe index 355dbf7..b63c1e5 100644 Binary files a/Randosu.exe and b/Randosu.exe differ diff --git a/randosu.py b/randosu.py index eea726e..6cfc0a6 100644 --- a/randosu.py +++ b/randosu.py @@ -12,7 +12,7 @@ from functions import intro, crash, choose, exit -version = '0.1.0' +version = '0.1.1' date = '2019-11-08' # Change window title @@ -26,6 +26,8 @@ if IsEXE: os.chdir(os.path.dirname(sys.executable)) +currentdir = os.getcwd() + print(f'Rand(osu!) v{version}') print(date) print(intro() + '\n') @@ -85,32 +87,32 @@ progress.close() # Writing temporary batch file - with tempfile.NamedTemporaryFile('w', delete=False) as bat: + with tempfile.NamedTemporaryFile('w', encoding='utf-8', delete=False) as bat: batpath = bat.name bat.write('\n'.join([ '@echo off', - 'Applying update . . .' - # Waiting for potentially unfinished download - 'timeout /t 1 /nobreak >nul', + # In case of unicode filenames you need this + # Thank you google + '@chcp 65001 1> NUL 2> NUL', # Remove original exe # If ran from script, this will have no effect - f'del "{filename}"', + f'del "{currentdir}\\{filename}"', # Rename the downloaded file then move - f'rename "{tmppath}" "{filename}"' - f'move /y "{os.path.dirname(tmppath)}\\{filename}" "{filename}"', + f'rename "{tmppath}" "{filename}"', + f'move /y "{os.path.dirname(tmppath)}\\{filename}" "{currentdir}\\{filename}"', 'cls', # Executing the updated exe - f'"{filename}" --:update {batpath}.bat {sys.argv[1] if len(sys.argv)>1 else ""}' + f'"{currentdir}\\{filename}" --:update {batpath}.bat {sys.argv[1] if len(sys.argv)>1 else ""}' ])) - # Rename tmp file to make it have .bat extension - os.rename(batpath, batpath + '.bat') - - sys.exit() + # Rename tmp file to make it have .bat extension + os.rename(batpath, batpath + '.bat') + os.startfile(batpath + '.bat') + sys.exit() except Exception as e: print(f'Connection to GitHub failed: {e}\n') diff --git a/version.txt b/version.txt index 17e51c3..6da28dd 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.1.1 +0.1.1 \ No newline at end of file