-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch.bat
More file actions
66 lines (55 loc) · 1.83 KB
/
Copy pathlaunch.bat
File metadata and controls
66 lines (55 loc) · 1.83 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@echo off
setlocal
title Database Import Studio
cd /d "%~dp0"
REM Automatically remove Windows Zone.Identifier security block if present
powershell -Command "Unblock-File -Path '%~dp0DatabaseImportStudio.exe' -ErrorAction SilentlyContinue; Unblock-File -Path '%~dp0dist\DatabaseImportStudio\DatabaseImportStudio.exe' -ErrorAction SilentlyContinue" >nul 2>&1
REM 1. Try standalone portable executable in root folder
if exist "%~dp0DatabaseImportStudio.exe" (
echo Starting Database Import Studio (Standalone)...
start "" "%~dp0DatabaseImportStudio.exe"
goto :end
)
REM 2. Try portable directory folder mode (bypasses Smart App Control temp blocks)
if exist "%~dp0dist\DatabaseImportStudio\DatabaseImportStudio.exe" (
echo Starting Database Import Studio (Folder Mode)...
start "" "%~dp0dist\DatabaseImportStudio\DatabaseImportStudio.exe"
goto :end
)
REM 3. Fallback to Python if installed
where python >nul 2>&1
if %errorlevel% equ 0 (
echo Starting Database Import Studio (Python)...
python "%~dp0db_import_server.py" 7321
goto :end
)
where python3 >nul 2>&1
if %errorlevel% equ 0 (
echo Starting Database Import Studio (Python3)...
python3 "%~dp0db_import_server.py" 7321
goto :end
)
REM 4. Fallback to Git Bash or WSL if python isn't installed
set "GIT_BASH=C:\Program Files\Git\bin\bash.exe"
if exist "%GIT_BASH%" (
"%GIT_BASH%" "%~dp0db_import.sh" %*
goto :end
)
where git >nul 2>&1
if %errorlevel% equ 0 (
for /f "tokens=*" %%i in ('where git') do (
set "GIT_PATH=%%~dpi"
)
if exist "%GIT_PATH%..\bin\bash.exe" (
"%GIT_PATH%..\bin\bash.exe" "%~dp0db_import.sh" %*
goto :end
)
)
where wsl >nul 2>&1
if %errorlevel% equ 0 (
wsl bash "%~dp0db_import.sh" %*
goto :end
)
echo ERROR: Could not find DatabaseImportStudio.exe, Python, or Git Bash.
pause
:end