-
Notifications
You must be signed in to change notification settings - Fork 0
/
locatorator.nsi
83 lines (55 loc) · 2.2 KB
/
locatorator.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
; Taken from example2.nsi
;--------------------------------
; The name of the installer
Name "Locatorator"
; The file to write
OutFile "locatorator_setup.exe"
; Request application privileges for Windows Vista and higher
RequestExecutionLevel user
; Build Unicode installer
Unicode True
; The default installation directory
InstallDir $APPDATA\Locatorator
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKCU "Software\GlowingPixel\Locatorator" "Install_Dir"
;--------------------------------
; Pages
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------
; The stuff to install
Section "Locatorator Application (required)"
SectionIn RO
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File /r "dist\Locatorator\*"
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\GlowingPixel\Locatorator "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Locatorator" "DisplayName" "Locatorator"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Locatorator" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Locatorator" "NoModify" 1
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Locatorator" "NoRepair" 1
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\Locatorator"
CreateShortcut "$SMPROGRAMS\Locatorator\Uninstall.lnk" "$INSTDIR\uninstall.exe"
CreateShortcut "$SMPROGRAMS\Locatorator\Locatorator.lnk" "$INSTDIR\Locatorator.exe"
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Locatorator"
DeleteRegKey HKCU SOFTWARE\GlowingPixel\Locatorator
; Remove directories
RMDir /r "$SMPROGRAMS\Locatorator"
RMDir /r "$INSTDIR"
SectionEnd