mirror of
https://github.com/Zaarrg/stremio-community-v5.git
synced 2026-04-20 16:42:02 +00:00
Adjusted installer to remove everything from Webview2 except "Default" User Profile
- Adjusted installer to remove everything from Webview2 except "Default" User Profile to ensure fresh cache on update
This commit is contained in:
parent
51df3c1956
commit
c0d7d1e9d2
1 changed files with 56 additions and 1 deletions
|
|
@ -229,10 +229,64 @@ Function fin_pg_leave
|
|||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
!macro RemoveAllExceptDefaultProfile un
|
||||
Function ${un}RemoveAllExceptDefaultProfile
|
||||
; Hardcoded values for your scenario
|
||||
StrCpy $R0 "Default" ; Directory to exclude
|
||||
StrCpy $R1 "$INSTDIR\stremio.exe.WebView2\EBWebView" ; Root directory to operate on
|
||||
|
||||
Push $R2
|
||||
Push $R3
|
||||
Push $R4
|
||||
|
||||
ClearErrors
|
||||
FindFirst $R3 $R2 "$R1\*.*"
|
||||
IfErrors Exit
|
||||
|
||||
Top:
|
||||
; Skip special directories "." and ".."
|
||||
StrCmp $R2 "." Next
|
||||
StrCmp $R2 ".." Next
|
||||
|
||||
; Skip the excluded directory
|
||||
StrCmp $R2 $R0 Next
|
||||
|
||||
; Build full path for the current item
|
||||
StrCpy $R4 "$R1\$R2"
|
||||
|
||||
; Check if the current item is a directory
|
||||
IfFileExists "$R4\*.*" isDir notDir
|
||||
|
||||
notDir:
|
||||
; It's a file, so delete it
|
||||
Delete "$R4"
|
||||
Goto Next
|
||||
|
||||
isDir:
|
||||
; It's a directory, remove it recursively
|
||||
RMDir /r "$R4"
|
||||
Next:
|
||||
ClearErrors
|
||||
FindNext $R3 $R2
|
||||
IfErrors Exit
|
||||
Goto Top
|
||||
|
||||
Exit:
|
||||
FindClose $R3
|
||||
|
||||
Pop $R4
|
||||
Pop $R3
|
||||
Pop $R2
|
||||
FunctionEnd
|
||||
!macroend
|
||||
|
||||
!insertmacro RemoveAllExceptDefaultProfile ""
|
||||
!insertmacro RemoveAllExceptDefaultProfile "un."
|
||||
|
||||
|
||||
; ---------------------------------------------------
|
||||
; Removes everything from $INSTDIR except the
|
||||
; "stremio.exe.WebView2" folder.
|
||||
; "stremio.exe.WebView2\stremio.exe.WebView2\EBWebView" and "portable_config" folder.
|
||||
; ---------------------------------------------------
|
||||
!macro RemoveAllExceptWebView2 un
|
||||
Function ${un}RemoveAllExceptWebView2
|
||||
|
|
@ -286,6 +340,7 @@ Function ${un}RemoveAllExceptWebView2
|
|||
Pop $R4
|
||||
Pop $R3
|
||||
Pop $R2
|
||||
Call ${un}RemoveAllExceptDefaultProfile
|
||||
FunctionEnd
|
||||
!macroend
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue