-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinsta360convert.bat
More file actions
44 lines (38 loc) · 1.52 KB
/
insta360convert.bat
File metadata and controls
44 lines (38 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
@echo off
REM Set the console code page to UTF-8 to prevent issues with non-ASCII characters in paths or output.
chcp 65001 > nul
REM Change the current directory to the location of this batch file.
cd /d "%~dp0"
REM --- Auto-detect and execute Python environment (most robust method) ---
REM Attempt 1: Try the official Python Launcher with the -w flag.
REM This is the most ideal method. We directly attempt execution and check the result.
REM Error output is redirected to nul to hide "Unknown option: -w" on misconfigured systems.
(py -w insta360convert.py) >nul 2>nul
if %errorlevel% == 0 (
exit /b
)
REM Attempt 2: If the launcher fails, try pyw.exe directly.
REM This is specific to full installations from python.org and is very reliable for GUIs.
where pyw >nul 2>nul
if %errorlevel% == 0 (
start "" pyw insta360convert.py
exit /b
)
REM Attempt 3: If both fail, try python.exe.
REM This covers the Microsoft Store version and basic PATH setups.
REM "start /min" launches it in a new, minimized console window.
where python >nul 2>nul
if %errorlevel% == 0 (
start "Insta360Convert GUI" /min python insta360convert.py
exit /b
)
REM --- Error handling if no Python executable was found ---
echo.
echo =================================================================
echo Error: Could not find a working Python installation.
echo.
echo This program requires Python to run.
echo Please install it from the Microsoft Store or python.org.
echo =================================================================
echo.
pause