Merge pull request #20 from swordcube/main

Fix some updating things on Linux
This commit is contained in:
YoshiCrafter29
2022-12-23 19:23:25 +01:00
committed by GitHub
2 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -160,7 +160,7 @@ class AsyncUpdater {
#if windows
path = '${Sys.getEnv("TEMP")}\\Codename Engine\\Updater\\';
#else
path = '.\\.temp\\';
path = '.temp/';
#end
FileSystem.createDirectory(path);
@@ -187,4 +187,4 @@ abstract UpdaterStep(Int) {
var DOWNLOADING_ASSETS = 1;
var DOWNLOADING_EXECUTABLE = 2;
var INSTALLING = 3;
}
}
+7 -1
View File
@@ -123,7 +123,13 @@ class UpdateScreen extends MusicBeatState {
FlxG.camera.fade(0xFF000000, overSound.length / 1000, false, function() {
if (updater.executableReplaced) {
// the executable has been replaced, restart the game entirely
#if windows
Sys.command('start /B ${AsyncUpdater.executableName}');
#else
// We have to make the new executable allowed to execute
// before we can execute it!
Sys.command('chmod +x ./${AsyncUpdater.executableName} && ./${AsyncUpdater.executableName}');
#end
openfl.system.System.exit(0);
} else {
// assets update, switch back to TitleState.
@@ -133,4 +139,4 @@ class UpdateScreen extends MusicBeatState {
bf.clipRect = null;
}
}
}
}