forked from crftwr/cfiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.nsi
92 lines (59 loc) · 2.16 KB
/
installer.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
84
85
86
87
88
89
90
91
92
; example1.nsi
;
; This script is perhaps one of the simplest NSIs you can make. All of the
; optional settings are left to their default settings. The installer simply
; prompts the user asking them where to install, and drops a copy of example1.nsi
; there.
;--------------------------------
; The name of the installer
Name "cfiler"
; The file to write
OutFile "dist\cfiler_000.exe"
; Build Unicode installer
Unicode True
; The default installation directory
InstallDir $PROGRAMFILES\cfiler
InstallDirRegKey HKLM "Software\cfiler" "InstallDir"
; Request application privileges for Windows Vista
RequestExecutionLevel admin
;--------------------------------
; Pages
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------
; The stuff to install
Section "cfiler (required)"
SectionIn RO
!include instfiles.nsh
WriteUninstaller "uninstall.exe"
; Write the installation path into the registry
WriteRegStr HKLM Software\cfiler "InstallDir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\cfiler" "DisplayName" "cfiler"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\cfiler" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\cfiler" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\cfiler" "NoRepair" 1
WriteUninstaller "uninstall.exe"
SectionEnd ; end the section
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\cfiler"
SetOutPath $INSTDIR
CreateShortCut "$SMPROGRAMS\cfiler\cfiler.lnk" "$INSTDIR\cfiler.exe" "" "$INSTDIR\cfiler.exe" 0
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\cfiler"
DeleteRegKey HKLM SOFTWARE\cfiler
!include uninstfiles.nsh
Delete $INSTDIR\uninstall.exe
; Remove shortcuts, if any
Delete "$SMPROGRAMS\cfiler\*.*"
; Remove directories used
RMDir "$SMPROGRAMS\cfiler"
RMDir "$INSTDIR"
SectionEnd