-
Notifications
You must be signed in to change notification settings - Fork 4
/
warp-journal.nsi
68 lines (48 loc) · 1.98 KB
/
warp-journal.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
66
67
68
!include "MUI2.nsh"
!define MUI_ICON "icon.ico"
Name "Warp Journal"
OutFile "warp-journal-1.0.1.exe"
Unicode True
RequestExecutionLevel admin
InstallDir "$PROGRAMFILES\Warp Journal"
InstallDirRegKey HKLM "Software\WarpJournal" "InstallDir"
;--------------------------------
; Pages
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
; Section
Section "Warp Journal"
SectionIn RO
SetOutPath $INSTDIR
; Kill Warp Journal if it's already running
nsExec::Exec 'taskkill /f /im warp-journal.exe'
; Files to install
File /r "warp-journal.dist\*.*"
; Write the installation path into the registry
WriteRegStr HKLM "Software\WarpJournal" "InstallDir" "$INSTDIR"
; start menu shortcut
CreateDirectory "$SMPROGRAMS\Warp Journal"
CreateShortcut "$SMPROGRAMS\Warp Journal\Warp Journal.lnk" "$INSTDIR\warp-journal.exe"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WarpJournal" "DisplayName" "Warp Journal"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WarpJournal" "DisplayIcon" '"$INSTDIR\warp-journal.exe"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WarpJournal" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WarpJournal" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WarpJournal" "NoRepair" 1
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WarpJournal"
DeleteRegKey HKLM "Software\WarpJournal"
Delete "$SMPROGRAMS\Warp Journal\*.lnk"
RMDir "$SMPROGRAMS\Warp Journal"
RMDir /r "$INSTDIR"
SectionEnd