Skip to content

Commit f926fb2

Browse files
committed
Feat: Improve startup script for robust cross-environment execution
1 parent 1898613 commit f926fb2

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

insta360convert.bat

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,24 @@ cd /d "%~dp0"
88

99
REM --- Auto-detect and execute Python environment ---
1010

11-
REM Priority 1: Try the Python Launcher (py.exe).
12-
REM This is the standard way to run Python on Windows when installed from python.org,
13-
REM and it works even if Python is not in the system's PATH.
11+
REM Priority 1: Try the Python Launcher (py.exe). This is the best method.
1412
where py >nul 2>nul
1513
if %errorlevel% == 0 (
16-
echo Launching with Python Launcher (py.exe)...
1714
py -w insta360convert.py
1815
exit /b
1916
)
2017

21-
REM Priority 2: Try python.exe.
22-
REM This covers installations from the Windows Store or official installers where python.exe was added to the PATH.
23-
REM The "start /b" command runs the script without creating a new console window.
18+
REM Priority 2: Try python.exe. This covers the Microsoft Store version.
2419
where python >nul 2>nul
2520
if %errorlevel% == 0 (
26-
echo Launching with python.exe...
27-
start /b python insta360convert.py
21+
REM Use "start /min" to launch in a new, minimized console, allowing this batch file to exit immediately.
22+
start "Insta360Convert GUI" /min python insta360convert.py
2823
exit /b
2924
)
3025

3126
REM Priority 3: Fallback to pyw.exe directly.
32-
REM This handles rare cases where only pyw.exe is in the PATH.
33-
REM The "start """ runs the command in a new process, allowing the batch file to exit immediately.
3427
where pyw >nul 2>nul
3528
if %errorlevel% == 0 (
36-
echo Launching with pyw.exe...
3729
start "" pyw insta360convert.py
3830
exit /b
3931
)

0 commit comments

Comments
 (0)