-
Notifications
You must be signed in to change notification settings - Fork 0
/
win32_installer.nsi
81 lines (55 loc) · 2.23 KB
/
win32_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
; The name of the installer
Name "bwEnc"
; The file to write
OutFile "windows-version\bwenc_1.3.0_installer_win32.exe"
; The default installation directory
InstallDir "$PROGRAMFILES\bwEnc"
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\bwEnc" "Install_Dir"
; Request application privileges for Windows Vista
RequestExecutionLevel admin
;--------------------------------
; Pages
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------
; The stuff to install
Section "bwEnc (required)"
SectionIn RO
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put application files there
File "build\*.*"
; Write the installation path into the registry
WriteRegStr HKLM "SOFTWARE\bwEnc" "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\bwEnc" "DisplayName" "bwEnc"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\bwEnc" "UninstallString" '"$INSTDIR\Uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\bwEnc" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\bwEnc" "NoRepair" 1
WriteUninstaller "Uninstall.exe"
SectionEnd
; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\bwEnc"
CreateShortCut "$SMPROGRAMS\bwEnc\bwEnc.lnk" "$INSTDIR\bwEnc.exe" "" "$INSTDIR\bwEnc.exe" 0
CreateShortCut "$SMPROGRAMS\bwEnc\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\bwEnc"
DeleteRegKey HKLM "SOFTWARE\bwEnc"
; Remove files
Delete "$INSTDIR\*.*"
; Remove shortcuts, if any
Delete "$SMPROGRAMS\bwEnc\*.*"
; Remove directories used
RMDir "$SMPROGRAMS\bwEnc"
RMDir "$INSTDIR"
SectionEnd