From 7c81912a5864e938c275f1da2e78bd5951efd272 Mon Sep 17 00:00:00 2001 From: xxanqw Date: Wed, 26 Nov 2025 12:13:41 +0200 Subject: Refactor NSIS script to call uninstall-specific string replacement function and remove redundant code --- .github/workflows/package-win.yml | 40 +-------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/.github/workflows/package-win.yml b/.github/workflows/package-win.yml index 68e8dc3..2b2f607 100644 --- a/.github/workflows/package-win.yml +++ b/.github/workflows/package-win.yml @@ -124,48 +124,10 @@ jobs: Push "${String}" Push "${SubString}" Push "${RepString}" - Call StrRep + Call un.StrRep Pop "${ResultVar}" !macroend - Function StrRep - Exch $R2 - Exch - Exch $R1 - Exch - Exch $R0 - Push $R3 - Push $R4 - Push $R5 - Push $R6 - Push $R7 - StrCpy $R3 0 - StrLen $R4 $R1 - StrLen $R6 $R0 - Start: - StrCpy $R5 $R0 $R4 $R3 - StrCmp $R5 $R1 Found - IntOp $R3 $R3 + 1 - IntCmp $R3 $R6 End End Start - Found: - StrCpy $R5 $R0 $R3 - IntOp $R7 $R3 + $R4 - StrCpy $R7 $R0 "" $R7 - StrCpy $R0 "$R5$R2$R7" - StrLen $R6 $R0 - IntOp $R3 $R3 + $R4 - Goto Start - End: - Pop $R7 - Pop $R6 - Pop $R5 - Pop $R4 - Pop $R3 - Pop $R2 - Pop $R1 - Exch $R0 - FunctionEnd - ; --- Uninstall-Specific Functions --- !macro un.StrRep ResultVar String SubString RepString Push "${String}" -- cgit v1.3-2-g0d8e