diff --git a/launcher/NapCatWinBootHook.dll b/launcher/NapCatWinBootHook.dll index ee797fc9..4f03788b 100644 Binary files a/launcher/NapCatWinBootHook.dll and b/launcher/NapCatWinBootHook.dll differ diff --git a/launcher/NapCatWinBootMain.exe b/launcher/NapCatWinBootMain.exe index 50992702..be02e30e 100644 Binary files a/launcher/NapCatWinBootMain.exe and b/launcher/NapCatWinBootMain.exe differ diff --git a/launcher/launcher-win10.bat b/launcher/launcher-win10.bat new file mode 100644 index 00000000..6c1dbb5d --- /dev/null +++ b/launcher/launcher-win10.bat @@ -0,0 +1,39 @@ +@echo off +chcp 65001 +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 'cmd.exe' -ArgumentList '/c cd /d \"%cd%\" && \"%~f0\"' -Verb runAs" + exit +) + +set NAPCAT_PATCH_PATH=%cd%\patchNapCat.js +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 +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 +) + +:napcat_boot +for %%a in (%RetString%) do ( + set "pathWithoutUninstall=%%~dpa" +) + +SET QQPath=%pathWithoutUninstall%QQ.exe + +REM 拿不到QQ路径则退出 +if not exist "%QQpath%" ( + echo provided QQ path is invalid: %QQpath% + pause + exit /b +) +set NAPCAT_MAIN_PATH=%NAPCAT_MAIN_PATH:\=/% +echo (async () =^> {await import("file:///%NAPCAT_MAIN_PATH%")})() > %NAPCAT_LOAD_PATH% + +"%NAPCAT_LAUNCHER_PATH%" "%QQPath%" "%NAPCAT_INJECT_PATH%" \ No newline at end of file diff --git a/manifest.json b/manifest.json index a01452e1..8d322fc5 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "name": "NapCatQQ", "slug": "NapCat.Framework", "description": "高性能的 OneBot 11 协议实现", - "version": "2.2.47", + "version": "2.3.0", "icon": "./logo.png", "authors": [ { diff --git a/package.json b/package.json index 78d802a1..c7c3631e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "napcat", "private": true, "type": "module", - "version": "2.2.47", + "version": "2.3.0", "scripts": { "build:framework": "vite build --mode framework", "build:shell": "vite build --mode shell", diff --git a/src/common/version.ts b/src/common/version.ts index 3c1caf38..c849f8ee 100644 --- a/src/common/version.ts +++ b/src/common/version.ts @@ -1 +1 @@ -export const napCatVersion = '2.2.47'; +export const napCatVersion = '2.3.0'; diff --git a/src/webui/ui/NapCat.ts b/src/webui/ui/NapCat.ts index 3f77f79b..5206028b 100644 --- a/src/webui/ui/NapCat.ts +++ b/src/webui/ui/NapCat.ts @@ -30,7 +30,7 @@ async function onSettingWindowCreated(view: Element) { SettingItem( 'Napcat', undefined, - SettingButton('V2.2.47', 'napcat-update-button', 'secondary'), + SettingButton('V2.3.0', 'napcat-update-button', 'secondary'), ), ]), SettingList([ diff --git a/static/assets/renderer.js b/static/assets/renderer.js index 7df30e44..820815dd 100644 --- a/static/assets/renderer.js +++ b/static/assets/renderer.js @@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) { SettingItem( 'Napcat', void 0, - SettingButton("V2.2.47", "napcat-update-button", "secondary") + SettingButton("V2.3.0", "napcat-update-button", "secondary") ) ]), SettingList([