Split LaunchConsole into Native & ConEmu parts
This commit is contained in:
parent
ec97e4deb3
commit
bd649f2189
1 changed files with 19 additions and 5 deletions
|
|
@ -92,23 +92,37 @@ if /i "%L_TYPE%" == "PyScript" (goto LaunchPyScript)
|
||||||
goto Usage
|
goto Usage
|
||||||
|
|
||||||
:LaunchConsole
|
:LaunchConsole
|
||||||
rem Check for a 64-bit version and set args
|
|
||||||
set "con_args=-new_console:n"
|
|
||||||
if defined DEBUG (set "con_args=%con_args% -new_console:c")
|
|
||||||
if defined L_ELEV (set "con_args=%con_args% -new_console:a")
|
|
||||||
rem Test L_PATH and set %_path%
|
rem Test L_PATH and set %_path%
|
||||||
call :TestPath || goto ErrorProgramNotFound
|
call :TestPath || goto ErrorProgramNotFound
|
||||||
|
|
||||||
rem Check for 64-bit prog (if running on 64-bit system)
|
rem Check for 64-bit prog (if running on 64-bit system)
|
||||||
set "prog=%_path%\%L_ITEM%"
|
set "prog=%_path%\%L_ITEM%"
|
||||||
if %ARCH% equ 64 (
|
if %ARCH% equ 64 (
|
||||||
if exist "%_path%\%L_ITEM:.=64.%" set "prog=%_path%\%L_ITEM:.=64.%"
|
if exist "%_path%\%L_ITEM:.=64.%" set "prog=%_path%\%L_ITEM:.=64.%"
|
||||||
)
|
)
|
||||||
if not exist "%prog%" goto ErrorProgramNotFound
|
if not exist "%prog%" goto ErrorProgramNotFound
|
||||||
|
|
||||||
|
rem Run program
|
||||||
popd && pushd "%_path%"
|
popd && pushd "%_path%"
|
||||||
rem Run program in console emulator %CON% and catch error(s)
|
if defined L_NCMD (
|
||||||
|
goto LaunchConsoleNative
|
||||||
|
) else (
|
||||||
|
goto LaunchConsoleConEmu
|
||||||
|
)
|
||||||
|
|
||||||
|
:LaunchConsoleConEmu
|
||||||
|
rem Set args
|
||||||
|
set "con_args=-new_console:n"
|
||||||
|
if defined DEBUG (set "con_args=%con_args% -new_console:c")
|
||||||
|
if defined L_ELEV (set "con_args=%con_args% -new_console:a")
|
||||||
|
|
||||||
start "" "%CON%" -run "%prog%" %L_ARGS% %con_args% || goto ErrorUnknown
|
start "" "%CON%" -run "%prog%" %L_ARGS% %con_args% || goto ErrorUnknown
|
||||||
goto Exit
|
goto Exit
|
||||||
|
|
||||||
|
:LaunchConsoleNative
|
||||||
|
start "" /wait "%prog%" %L_ARGS% || goto ErrorUnknown
|
||||||
|
goto Exit
|
||||||
|
|
||||||
:LaunchFolder
|
:LaunchFolder
|
||||||
rem Test L_PATH and set %_path% (extracts archive in necessary)
|
rem Test L_PATH and set %_path% (extracts archive in necessary)
|
||||||
call :TestPath || goto ErrorProgramNotFound
|
call :TestPath || goto ErrorProgramNotFound
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue