-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsw.nsi
65 lines (51 loc) · 1.4 KB
/
sw.nsi
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
!include "MUI2.nsh"
Name "sw"
OutFile "{}"
Unicode True
InstallDir "$ProgramFiles\sw"
InstallDirRegKey HKLM "Software\sw" ""
RequestExecutionLevel admin
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE "{}\LICENSE.GPLv3"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "!CLI"
SectionIn RO
SetOutPath "$INSTDIR"
File /oname=sw.exe "{}"
DetailPrint "Running sw setup"
nsExec::Exec '"$INSTDIR\sw.exe" setup -path'
SectionEnd
{}
Section
WriteRegStr HKLM "Software\sw" "" $INSTDIR
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
; this could be dangerous, do not use at the moment
;DetailPrint "Running sw setup -uninstall"
;nsExec::Exec '"$INSTDIR\sw.exe" setup -uninstall'
RMDir /r "$INSTDIR\.sw" ; just in case
Delete "$INSTDIR\sw.exe"
;Delete "$INSTDIR\swgui.exe"
Delete "$INSTDIR\Uninstall.exe"
Sleep 1000
RMDir "$INSTDIR"
Sleep 1000
RMDir /r "$INSTDIR"
DeleteRegKey /ifempty HKLM "Software\sw"
SectionEnd