fix(shell): preserve Windows launcher paths and elevation arguments
macOS QQ runtime / runtime (arm64, macos-15) (push) Canceled after 0s
macOS QQ runtime / runtime (x64, macos-15-intel) (push) Canceled after 0s
Windows launcher / launchers (push) Canceled after 0s
Release Tag / validate-version (push) Canceled after 0s
Release Tag / trigger-release (push) Canceled after 0s
macOS native compatibility / native (arm64, macos-15) (push) Canceled after 0s
macOS native compatibility / native (x64, macos-15-intel) (push) Canceled after 0s
macOS QQ runtime / runtime (arm64, macos-15) (push) Canceled after 0s
macOS QQ runtime / runtime (x64, macos-15-intel) (push) Canceled after 0s
Windows launcher / launchers (push) Canceled after 0s
Release Tag / validate-version (push) Canceled after 0s
Release Tag / trigger-release (push) Canceled after 0s
macOS native compatibility / native (arm64, macos-15) (push) Canceled after 0s
macOS native compatibility / native (x64, macos-15-intel) (push) Canceled after 0s
This commit is contained in:
1 parent
f8786c65de
commit
ff9a829e29
8 files changed
+210
-23
No files matched your search
@@ -3,24 +3,26 @@ setlocal DisableDelayedExpansion
|
||||
cd /d "%~dp0" || exit /b 1
|
||||
chcp 65001 >nul
|
||||
net session >nul 2>&1
|
||||
if %ERRORLEVEL% == 0 (
|
||||
echo Administrator mode detected.
|
||||
) else (
|
||||
echo Please run this script in administrator mode.
|
||||
powershell -Command "Start-Process 'wt.exe' -ArgumentList 'cmd /c cd /d \"%cd%\" && \"%~f0\" %*' -Verb runAs"
|
||||
exit
|
||||
)
|
||||
if not errorlevel 1 goto :napcat_admin
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0launcher-elevate.ps1" wt.exe "%~f0" %*
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
:napcat_admin
|
||||
echo Administrator mode detected.
|
||||
|
||||
set "NAPCAT_PATCH_PACKAGE=%cd%\qqnt.json"
|
||||
set "NAPCAT_LOAD_PATH=%cd%\loadNapCat.js"
|
||||
set "NAPCAT_INJECT_PATH=%cd%\NapCatWinBootHook.dll"
|
||||
set "NAPCAT_LAUNCHER_PATH=%cd%\NapCatWinBootMain.exe"
|
||||
set "NAPCAT_MAIN_PATH=%cd%\napcat.mjs"
|
||||
:loop_read
|
||||
set "RetString="
|
||||
for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" /v "UninstallString"') do (
|
||||
set "RetString=%%~b"
|
||||
goto :napcat_boot
|
||||
)
|
||||
echo QQ installation was not found in the registry.
|
||||
pause
|
||||
exit /b 1
|
||||
|
||||
:napcat_boot
|
||||
for %%a in ("%RetString%") do (
|
||||
@@ -32,7 +34,8 @@ set "QQPath=%pathWithoutUninstall%QQ.exe"
|
||||
if not exist "%QQPath%" (
|
||||
echo provided QQ path is invalid
|
||||
pause
|
||||
exit /b
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
"%NAPCAT_LAUNCHER_PATH%" "%QQPath%" "%NAPCAT_INJECT_PATH%" %*
|
||||
exit /b %ERRORLEVEL%
|
||||
Reference in new issue
Block a user