chore: update

This commit is contained in:
huzibaca 2024-11-01 06:03:01 +08:00
parent 953153ea1a
commit d8d0a59371
No known key found for this signature in database
GPG Key ID: D4364EE4851DC302

View File

@ -1,5 +1,38 @@
!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_" !define NSIS_HOOK_PREUNINSTALL "NSIS_HOOK_PREUNINSTALL_"
!macro 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"' ExecWait '"$INSTDIR\uninstall-service.exe"'
!macroend !macroend