From 27fb7370bed65f8df970895689abcedc6e254c1e Mon Sep 17 00:00:00 2001 From: crschnick Date: Thu, 29 Feb 2024 09:09:50 +0000 Subject: [PATCH] Fix windows updater being broken --- .../java/io/xpipe/app/update/AppInstaller.java | 15 ++++++++------- dist/licenses/graalvm.properties | 2 +- setup.sh | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/update/AppInstaller.java b/app/src/main/java/io/xpipe/app/update/AppInstaller.java index 94d98dd76..8e10ad23c 100644 --- a/app/src/main/java/io/xpipe/app/update/AppInstaller.java +++ b/app/src/main/java/io/xpipe/app/update/AppInstaller.java @@ -71,11 +71,12 @@ public class AppInstaller { .resolve(XPipeInstallation.getDaemonExecutablePath(OsType.getLocal())).toString(); var logsDir = FileNames.join(XPipeInstallation.getDataDir().toString(), "logs"); var logFile = FileNames.join(logsDir, "installer_" + FileNames.getFileName(file) + ".log"); - var script = ScriptHelper.createExecScript( - shellProcessControl, - LocalShell.getShell().getShellDialect().equals(ShellDialects.CMD) ? - getCmdCommand(file, logFile, exec) : getPowershellCommand(file, logFile, exec)); - TerminalLauncher.openDirect("XPipe Updater", LocalShell.getShell(), script); + var command = LocalShell.getShell().getShellDialect().equals(ShellDialects.CMD) ? + getCmdCommand(file, logFile, exec) : getPowershellCommand(file, logFile, exec); + var toRun = LocalShell.getShell().getShellDialect().equals(ShellDialects.CMD) ? + "start \"XPipe Updater\" /min cmd /c \"" + ScriptHelper.createLocalExecScript(command) + "\"" : + "Start-Process -WindowStyle Minimized -FilePath powershell -ArgumentList \"-ExecutionPolicy\", \"Bypass\", \"-File\", \"`\"" + ScriptHelper.createLocalExecScript(command) + "`\"\""; + shellProcessControl.executeSimpleCommand(toRun); } private String getCmdCommand(String file, String logFile, String exec) { @@ -84,7 +85,7 @@ public class AppInstaller { echo Installing %s ... cd /D "%%HOMEDRIVE%%%%HOMEPATH%%" echo + msiexec /i "%s" /lv "%s" /qr - start "" /wait msiexec /i "%s" /lv "%s" /qr + start "" /wait msiexec /i "%s" /lv "%s" /qb echo Starting XPipe ... echo + "%s" start "" "%s" @@ -98,7 +99,7 @@ public class AppInstaller { echo Installing %s ... cd "$env:HOMEDRIVE\\$env:HOMEPATH" echo '+ msiexec /i "%s" /lv "%s" /qr' - Start-Process msiexec -Wait -ArgumentList "/i", "`"%s`"", "/lv", "`"%s`"", "/qr" + Start-Process msiexec -Wait -ArgumentList "/i", "`"%s`"", "/lv", "`"%s`"", "/qb" echo 'Starting XPipe ...' echo '+ "%s"' Start-Process -FilePath "%s" diff --git a/dist/licenses/graalvm.properties b/dist/licenses/graalvm.properties index 0f02199ec..97bb40924 100644 --- a/dist/licenses/graalvm.properties +++ b/dist/licenses/graalvm.properties @@ -1,4 +1,4 @@ name=GraalVM Community -version=21.0.2 +version=21.0.1 license=GPL2 with the Classpath Exception link=https://www.graalvm.org/ \ No newline at end of file diff --git a/setup.sh b/setup.sh index 1844c1d83..3d762428d 100755 --- a/setup.sh +++ b/setup.sh @@ -10,5 +10,5 @@ if [ $? -ne 0 ]; then . "$HOME/.sdkman/bin/sdkman-init.sh" fi; -sdk install java 21.0.2-graalce -sdk default java 21.0.2-graalce +sdk install java 21.0.1-graalce +sdk default java 21.0.1-graalce