Skip to content

Commit c7aedd2

Browse files
MinyazevRiakov
andauthored
Win32 wrapper: Fix issue with PATH containing close parenthesis (#1890)
Use proper SET syntax to handle parenthes and spaces --------- Co-authored-by: iakov <iakov@users.noreply.github.com>
1 parent 8a01af3 commit c7aedd2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

installer/platform/trik-studio-safe.cmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ SETLOCAL ENABLEEXTENSIONS
33
IF ERRORLEVEL 1 ECHO Failed to enable extensions
44
TITLE TRIK Studio Safe Mode
55
rem if JAVA_HOME is missing try to find the first Java executable in PATH
6-
IF DEFINED JAVA_HOME (ECHO JAVA_HOME is "%JAVA_HOME%" && set JAVA_PATH=%JAVA_HOME%\bin) ^
6+
IF DEFINED JAVA_HOME (ECHO JAVA_HOME is "%JAVA_HOME%" && set "JAVA_PATH=%JAVA_HOME%\bin") ^
77
ELSE (
88
java -version 2>NUL
99
IF ERRORLEVEL 1 ECHO Missing working java.exe in PATH="%PATH%"
10-
FOR /f "usebackq tokens=1* delims=:" %%F IN (`where java 2^>NUL ^| findstr /n "^"`) DO @IF %%F == 1 ( ECHO Using Java: "%%G" && SET JAVA_PATH=%%~dpG)
10+
FOR /f "usebackq tokens=1* delims=:" %%F IN (`where java 2^>NUL ^| findstr /n "^"`) DO @IF %%F == 1 ( ECHO Using Java: "%%G" && SET "JAVA_PATH=%%~dpG")
1111
)
1212
rem Clear PATH after Java detection attempt
13-
SET PATH=%SystemRoot%;%SystemRoot%\system32
14-
IF "%JAVA_PATH%" == "" ( ECHO Failed to detect Java/JRE ) ELSE (SET PATH=%PATH%;%JAVA_PATH%&& java -version)
13+
SET "PATH=%SystemRoot%;%SystemRoot%\system32"
14+
IF "%JAVA_PATH%" == "" ( ECHO Failed to detect Java/JRE ) ELSE (SET "PATH=%PATH%;%JAVA_PATH%" && java -version)
1515
ENDLOCAL
1616

1717
%~dp0trik-studio.exe "%*"

0 commit comments

Comments
 (0)