From b66c07bd967f99fc96b2809d3ee6c3f26d547725 Mon Sep 17 00:00:00 2001 From: huzibaca Date: Fri, 1 Nov 2024 08:37:22 +0800 Subject: [PATCH] chore: update (+1 squashed commit) Squashed commits: [78899ef] fix: bbr2 not working in windows 11(24H2) --- packages/windows/nsis_hooks.sh | 38 ------------------- .../linux}/clash-verge.desktop | 0 .../packages}/linux/post-install.sh | 0 .../packages}/linux/pre-remove.sh | 0 .../windows}/installer.nsi | 4 +- src-tauri/tauri.linux.conf.json | 8 ++-- src-tauri/tauri.windows.conf.json | 3 +- src-tauri/webview2.arm64.json | 2 +- src-tauri/webview2.x64.json | 2 +- src-tauri/webview2.x86.json | 2 +- 10 files changed, 10 insertions(+), 49 deletions(-) delete mode 100644 packages/windows/nsis_hooks.sh rename src-tauri/{template => packages/linux}/clash-verge.desktop (100%) rename {packages => src-tauri/packages}/linux/post-install.sh (100%) rename {packages => src-tauri/packages}/linux/pre-remove.sh (100%) rename src-tauri/{template => packages/windows}/installer.nsi (99%) diff --git a/packages/windows/nsis_hooks.sh b/packages/windows/nsis_hooks.sh deleted file mode 100644 index 65f76a7c..00000000 --- a/packages/windows/nsis_hooks.sh +++ /dev/null @@ -1,38 +0,0 @@ -!define ORIGINAL_PROVIDER_FILE "$TEMP\clash_verge_original_congestion_provider.txt" - -!define NSIS_HOOK_POSTINSTALL "NSIS_HOOK_POSTINSTALL_" - -!macro NSIS_HOOK_POSTINSTALL_ -ExecWait 'netsh int tcp show global | findstr /R "^ *CongestionProvider" > "${ORIGINAL_PROVIDER_FILE}"' - -FileOpen $0 "${ORIGINAL_PROVIDER_FILE}" r -FileRead $0 $1 -FileClose $0 - -StrCpy $1 $1 "" 20 -StrCmp $1 "bbr2" 0 +5 -ExecWait 'netsh int tcp set supplemental template=internet congestionprovider=CUBIC' -ExecWait 'netsh int tcp set supplemental template=internetcustom congestionprovider=CUBIC' -ExecWait 'netsh int tcp set supplemental template=Compat congestionprovider=NewReno' -ExecWait 'netsh int tcp set supplemental template=Datacenter congestionprovider=CUBIC' -ExecWait 'netsh int tcp set supplemental template=Datacentercustom congestionprovider=CUBIC' -!macroend - -!define NSIS_HOOK_PREUNINSTALL "NSIS_HOOK_PREUNINSTALL_" - -!macro NSIS_HOOK_PREUNINSTALL_ -FileOpen $0 "${ORIGINAL_PROVIDER_FILE}" r -FileRead $0 $1 -FileClose $0 - -StrCpy $1 $1 "" 20 -StrCmp $1 "bbr2" 0 +5 -ExecWait 'netsh int tcp set supplemental template=internet congestionprovider=$1' -ExecWait 'netsh int tcp set supplemental template=internetcustom congestionprovider=$1' -ExecWait 'netsh int tcp set supplemental template=Compat congestionprovider=NewReno' -ExecWait 'netsh int tcp set supplemental template=Datacenter congestionprovider=$1' -ExecWait 'netsh int tcp set supplemental template=Datacentercustom congestionprovider=$1' - -Delete "${ORIGINAL_PROVIDER_FILE}" -ExecWait '"$INSTDIR\uninstall-service.exe"' -!macroend diff --git a/src-tauri/template/clash-verge.desktop b/src-tauri/packages/linux/clash-verge.desktop similarity index 100% rename from src-tauri/template/clash-verge.desktop rename to src-tauri/packages/linux/clash-verge.desktop diff --git a/packages/linux/post-install.sh b/src-tauri/packages/linux/post-install.sh similarity index 100% rename from packages/linux/post-install.sh rename to src-tauri/packages/linux/post-install.sh diff --git a/packages/linux/pre-remove.sh b/src-tauri/packages/linux/pre-remove.sh similarity index 100% rename from packages/linux/pre-remove.sh rename to src-tauri/packages/linux/pre-remove.sh diff --git a/src-tauri/template/installer.nsi b/src-tauri/packages/windows/installer.nsi similarity index 99% rename from src-tauri/template/installer.nsi rename to src-tauri/packages/windows/installer.nsi index 6b90a091..8ee0c0b1 100644 --- a/src-tauri/template/installer.nsi +++ b/src-tauri/packages/windows/installer.nsi @@ -1,6 +1,6 @@ ; This file is copied from https://github.com/tauri-apps/tauri/blob/tauri-v1.5/tooling/bundler/src/bundle/windows/templates/installer.nsi ; and edit to fit the needs of the project. the latest tauri 2.x has a different base nsi script. - +RequestExecutionLevel admin Unicode true ; Set the compression algorithm. Default is LZMA. !if "{{compression}}" == "" @@ -690,7 +690,7 @@ SectionEnd Section Install SetOutPath $INSTDIR - + nsExec::Exec 'netsh int tcp res' !insertmacro CheckIfAppIsRunning !insertmacro CheckAllVergeProcesses ; Copy main executable diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json index f07a789b..5a942c7a 100644 --- a/src-tauri/tauri.linux.conf.json +++ b/src-tauri/tauri.linux.conf.json @@ -6,7 +6,7 @@ "linux": { "deb": { "depends": ["openssl"], - "desktopTemplate": "./template/clash-verge.desktop", + "desktopTemplate": "./packages/linux/clash-verge.desktop", "provides": ["clash-verge"], "conflicts": ["clash-verge"], "replaces": ["clash-verge"], @@ -15,12 +15,12 @@ }, "rpm": { "depends": ["openssl"], - "desktopTemplate": "./template/clash-verge.desktop", + "desktopTemplate": "./packages/linux/clash-verge.desktop", "provides": ["clash-verge"], "conflicts": ["clash-verge"], "obsoletes": ["clash-verge"], - "postInstallScript": "../packages/linux/post-install.sh", - "preRemoveScript": "../packages/linux/pre-remove.sh" + "postInstallScript": "./packages/linux/post-install.sh", + "preRemoveScript": "./packages/linux/pre-remove.sh" } }, "externalBin": [ diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json index bf46ee2d..db8de0f6 100644 --- a/src-tauri/tauri.windows.conf.json +++ b/src-tauri/tauri.windows.conf.json @@ -16,8 +16,7 @@ "installerIcon": "icons/icon.ico", "languages": ["SimpChinese", "English"], "installMode": "perMachine", - "template": "./template/installer.nsi", - "installerHooks": "../packages/windows/nsis_hooks.sh" + "template": "./packages/windows/installer.nsi" } } }, diff --git a/src-tauri/webview2.arm64.json b/src-tauri/webview2.arm64.json index 27bf4ebb..4c903432 100644 --- a/src-tauri/webview2.arm64.json +++ b/src-tauri/webview2.arm64.json @@ -16,7 +16,7 @@ "installerIcon": "icons/icon.ico", "languages": ["SimpChinese", "English"], "installMode": "perMachine", - "template": "./template/installer.nsi" + "template": "./packages/windows/installer.nsi" } } }, diff --git a/src-tauri/webview2.x64.json b/src-tauri/webview2.x64.json index 325ef64d..1d52ce0b 100644 --- a/src-tauri/webview2.x64.json +++ b/src-tauri/webview2.x64.json @@ -16,7 +16,7 @@ "installerIcon": "icons/icon.ico", "languages": ["SimpChinese", "English"], "installMode": "perMachine", - "template": "./template/installer.nsi" + "template": "./packages/windows/installer.nsi" } } }, diff --git a/src-tauri/webview2.x86.json b/src-tauri/webview2.x86.json index 03a955fe..ecb2cd87 100644 --- a/src-tauri/webview2.x86.json +++ b/src-tauri/webview2.x86.json @@ -16,7 +16,7 @@ "installerIcon": "icons/icon.ico", "languages": ["SimpChinese", "English"], "installMode": "perMachine", - "template": "./template/installer.nsi" + "template": "./packages/windows/installer.nsi" } } },