-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Testing * Testing * Adding script to remove directories and files * Adding script to remove directories and files * Adding script to remove directories and files * Adding script to remove directories and files * Adding script to remove directories and files * Adding script to remove directories and files * Adding script to remove directories and files * Adding script to remove directories and files * Adding script to remove directories and files * Adding snippet * Adding snippet * Adding snippet * Adding snippet * Adding snippet * Adding snippet * Adding snippet * Adding snippet * Adding snippet * Adding snippet * Adding snippet * Adding snippet * trying define * trying define * trying define * trying define * trying define * trying define * Final code * Correcting path * fixing path * fixing path --------- Co-authored-by: Oto Ciulis <[email protected]>
- Loading branch information
1 parent
85e553b
commit ef8df3d
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
!include 'LogicLib.nsh' | ||
|
||
; The following is used to add the "/SD" flag to MessageBox so that the | ||
; machine can restart if the uninstaller fails. | ||
!macro customUnInstallCheckCommon | ||
IfErrors 0 +3 | ||
DetailPrint `Uninstall was not successful. Not able to launch uninstaller!` | ||
Return | ||
|
||
${if} $R0 != 0 | ||
MessageBox MB_OK|MB_ICONEXCLAMATION "$(uninstallFailed): $R0" /SD IDOK | ||
DetailPrint `Uninstall was not successful. Uninstaller error code: $R0.` | ||
SetErrorLevel 2 | ||
Quit | ||
${endif} | ||
!macroend | ||
|
||
!macro customUnInstallCheck | ||
!insertmacro customUnInstallCheckCommon | ||
!macroend | ||
|
||
!macro customUnInstallCheckCurrentUser | ||
!insertmacro customUnInstallCheckCommon | ||
!macroend | ||
|
||
!macro customRemoveFiles | ||
${ifNot} ${isUpdated} | ||
ClearErrors | ||
FileOpen $0 "$APPDATA\ComfyUI\extra_models_config.yaml" r | ||
var /global line | ||
var /global lineLength | ||
var /global prefix | ||
var /global prefixLength | ||
var /global prefixFirstLetter | ||
|
||
FileRead $0 $line | ||
|
||
StrCpy $prefix "base_path: " ; Space at the end is important to strip away correct number of letters | ||
StrLen $prefixLength $prefix | ||
StrCpy $prefixFirstLetter $prefix 1 | ||
|
||
StrCpy $R3 $R0 | ||
StrCpy $R0 -1 | ||
IntOp $R0 $R0 + 1 | ||
StrCpy $R2 $R3 1 $R0 | ||
StrCmp $R2 "" +2 | ||
StrCmp $R2 $R1 +2 -3 | ||
|
||
StrCpy $R0 -1 | ||
|
||
${DoUntil} ${Errors} | ||
StrCpy $R3 0 ; Whitespace padding counter | ||
StrLen $lineLength $line | ||
|
||
${Do} ; Find first letter of prefix | ||
StrCpy $R4 $line 1 $R3 | ||
|
||
${IfThen} $R4 == $prefixFirstLetter ${|} ${ExitDo} ${|} | ||
${IfThen} $R3 > $lineLength ${|} ${ExitDo} ${|} | ||
|
||
IntOp $R3 $R3 + 1 | ||
${Loop} | ||
|
||
StrCpy $R2 $line $prefixLength $R3 ; Copy part from first letter to length of prefix | ||
|
||
${If} $R2 == $prefix | ||
StrCpy $2 $line 1024 $R3 ; Strip off whitespace padding | ||
StrCpy $3 $2 1024 $prefixLength ; Strip off prefix | ||
|
||
; $3 now contains value of base_path | ||
RMDir /r /REBOOTOK "$3\.venv" | ||
RMDir /r /REBOOTOK "$3\uv-cache" | ||
|
||
${ExitDo} ; No need to continue, break the cycle | ||
${EndIf} | ||
FileRead $0 $line | ||
${LoopUntil} 1 = 0 | ||
|
||
FileClose $0 | ||
Delete "$APPDATA\ComfyUI\extra_models_config.yaml" | ||
${endIf} | ||
!macroend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters