forked from ChrisVeigl/BrainBay
-
Notifications
You must be signed in to change notification settings - Fork 1
/
BrainBay_installer.nsi
139 lines (106 loc) · 3.81 KB
/
BrainBay_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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
;NSIS Modern User Interface
;Basic Example Script
;Written by Joost Verburg
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;General
;Name and file
Name "BrainBay"
OutFile "Setup_BrainBay.exe"
;Default installation folder
InstallDir $PROGRAMFILES\BrainBay
;Get installation folder from registry if available
InstallDirRegKey HKLM "Software\BrainBay" "Install_Dir"
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE "Readme_License.txt"
!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 "Application" SecApp
SectionIn RO
SetOutPath "$INSTDIR"
File "debug\*.exe"
File "debug\*.dll"
File "debug\*.txt"
File "debug\*.sys"
File "debug\*.xml"
SetOutPath $INSTDIR\ARCHIVES
File "debug\ARCHIVES\adxl202.arc"
File "debug\ARCHIVES\alpha.arc"
File "debug\ARCHIVES\Calib.edf"
File "debug\ARCHIVES\Osas2002.edf"
File "debug\ARCHIVES\heart.arc"
File "debug\ARCHIVES\muskel_training1.arc"
File "debug\ARCHIVES\emg.arc"
File "debug\ARCHIVES\monolith1.arc"
File "debug\ARCHIVES\psytask_test.edf"
File "debug\ARCHIVES\ekg_chn1.arc"
File "debug\ARCHIVES\2_channel_test.arc"
SetOutPath $INSTDIR\CONFIGURATIONS
File /r "debug\CONFIGURATIONS\*.*"
SetOutPath $INSTDIR\GRAPHICS
File "debug\GRAPHICS\*.*"
SetOutPath $INSTDIR\HELPPAGES
File /r "debug\HELPPAGES\*.*"
SetOutPath $INSTDIR\MOVIES
File "debug\MOVIES\face.avi"
SetOutPath $INSTDIR\NETWORK
File "debug\NETWORK\*.*"
SetOutPath $INSTDIR\PALETTES
File "debug\PALETTES\*.*"
SetOutPath $INSTDIR\PATTERNS
File "debug\PATTERNS\*.*"
SetOutPath $INSTDIR\SKINDIALOGS
File "debug\SKINDIALOGS\*.*"
SetOutPath $INSTDIR\SOUNDS
File "debug\SOUNDS\*.*"
SetOutPath $INSTDIR\TONESCALES
File "debug\TONESCALES\*.*"
SetOutPath $INSTDIR\NeurobitRuntime
File "debug\NeurobitRuntime\*.*"
SetOutPath $INSTDIR\dictionary
File "debug\dictionary\*.*"
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\BrainBay "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BrainBay" "DisplayName" "Brainbay Application"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BrainBay" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BrainBay" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BrainBay" "NoRepair" 1
WriteUninstaller "uninstall.exe"
SectionEnd
; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\BrainBay"
CreateShortCut "$SMPROGRAMS\BrainBay\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\BrainBay\BrainBay.lnk" "$INSTDIR\brainbay.exe" "" "$INSTDIR\brainbay.exe" 0
CreateShortCut "$SMPROGRAMS\BrainBay\Readme.lnk" "$INSTDIR\ReadMe_BrainBay.txt" "" "$INSTDIR\ReadMe_BrainBay.txt" 0
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BrainBay"
DeleteRegKey HKLM SOFTWARE\BrainBay
; Remove files and uninstaller
Delete $INSTDIR\*.*
; Delete $INSTDIR\uninstall.exe
; Remove shortcuts, if any
Delete "$SMPROGRAMS\BrainBay\*.*"
; Remove directories used
RMDir "$SMPROGRAMS\BrainBay"
RMDir /r "$INSTDIR"
SectionEnd