-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathinstaller.nsh
More file actions
45 lines (31 loc) · 1.08 KB
/
installer.nsh
File metadata and controls
45 lines (31 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
!include WinMessages.nsh
!define COPYYEAR 2025
Var VersionNumber
Section
SetDetailsPrint both
InitPluginsDir
StrCpy $VersionNumber "v2.0.0"
ExpandEnvStrings $0 %COMSPEC%
MessageBox MB_OK "RescueBox $VersionNumber $INSTDIR"
MessageBox MB_OK|MB_ICONINFORMATION "Copyright (R) ${COPYYEAR}"
SectionEnd
!macro customHeader
RequestExecutionLevel admin
!macroend
Function .onInstSuccess
Var /GLOBAL INSTDIR_DAT
Strcpy "$INSTDIR_DAT" "$INSTDIR\resources\assets\rb_server"
ExpandEnvStrings $0 %COMSPEC%
ExecWait '"$0" /C "msiexec /i $INSTDIR_DAT\winfsp-2.0.23075.msi INSTALLLEVEL=1000 /passive"'
Var /GLOBAL O_LOG
Strcpy "$O_LOG" "$AppData\RescueBox-Desktop\logs\o.log"
Exec '"$0" /C "$INSTDIR_DAT\OllamaSetup.exe /verysilent /SP /SUPPRESSMSGBOXES /log=$O_LOG"'
FunctionEnd
Section "Uninstall"
Var /GLOBAL INSTDIR_LOG
Strcpy "$INSTDIR_LOG" "$AppData\RescueBox-Desktop\logs"
FindWindow $0 "RescueBox-Desktop"
SendMessage $0 ${WM_CLOSE} 0 0
ExecWait '"$0" /k "del/f /q $INSTDIR_LOG\*.log"'
ExecWait '"$0" /K "rmdir /S /Q $INSTDIR"'
SectionEnd