File: InstallerScript2.nsi

package info (click to toggle)
gentle 1.9+cvs20100605+dfsg-2
  • links: PTS, VCS
  • area: contrib
  • in suites: squeeze
  • size: 12,264 kB
  • ctags: 5,235
  • sloc: cpp: 41,571; ansic: 3,978; sh: 1,420; makefile: 291
file content (172 lines) | stat: -rw-r--r-- 3,966 bytes parent folder | download | duplicates (6)
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
; GENtle.nsi
;
; This script is based on example1.nsi, but it remember the directory, 
; has uninstall support and (optionally) installs start menu shortcuts.
;
; It will install GENtle.exe into a directory that the user selects,

;--------------------------------

; The name of the installer
Name "GENtle"

; The file to write
OutFile "GENtleSetup.exe"

;Section
;SectionEnd

; The default installation directory
InstallDir $PROGRAMFILES\GENtle

SetCompressor "lzma"

; Registry key to check for directory (so if you install again, it will 
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\GENtle" "Install_Dir"

;--------------------------------

LicenseData "gpl.txt"
DirText "Choose a directory to install in to:"
LicenseText "GENtle is released under the General Public License (GPL)"


; Pages

Page components
Page license
Page directory
Page instfiles

UninstPage uninstConfirm
UninstPage instfiles

;--------------------------------

; The stuff to install
Section "GENtle (required)"

  SectionIn RO



  MessageBox MB_YESNO "Install or update GENtle?" IDYES yeslabel IDNO nolabel
  yeslabel:
;  MessageBox MB_OK "You pressed yes"
  Goto done
  nolabel:
;  MessageBox MB_OK "You pressed no"
  Quit ;
  done:


  
  ; Set output path to the installation directory.
  SetOutPath $INSTDIR
  
  ; Put file there
  File "GENtle.exe"
;  File "blastcl3.exe"
;  File "clustalw.exe"
;  File "sqlite.exe"
  File "sqlite.dll"
  File "sqlite3.dll"
  File "libmySQL.dll"
  
  File "libpng13.dll"
  File "jpeg62.dll"
  File "zlib1.dll"
  File "libtiff3.dll"
  
  File "commonvectors.db"
  File "codon_catalog.csv"
  File "default.tab"
  File "GENtle.ico"
  File "variables.csv"
  File "blank.db"
  File "gpl.txt"
  File "MySQL template.txt"
  File "marker.txt"
  File "tips_de.txt"
  File "tips_en.txt"

  SetOutPath "$INSTDIR\wav"
  File "wav\*.wav"
  File "wav\*.txt"

  SetOutPath "$INSTDIR\help"
  File "help\*.htm"
  File "help\*.png"
  File "help\*.css"
  
  SetOutPath "$INSTDIR\bitmaps"
  File "bitmaps\*.bmp"
  File "bitmaps\*.png"
  
  SetOutPath "$INSTDIR"

;create desktop shortcut
  CreateShortCut "$DESKTOP\GENtle.lnk" "$INSTDIR\GENtle.exe" ""
  
  ; Write the installation path into the registry
  WriteRegStr HKLM SOFTWARE\GENtle "Install_Dir" "$INSTDIR"
  
  ; Write the uninstall keys for Windows
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GENtle" "DisplayName" "GENtle"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GENtle" "UninstallString" '"$INSTDIR\uninstall.exe"'
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GENtle" "NoModify" 1
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GENtle" "NoRepair" 1
  WriteUninstaller "uninstall.exe"
  
SectionEnd

; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"

  CreateDirectory "$SMPROGRAMS\GENtle"
  CreateShortCut "$SMPROGRAMS\GENtle\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
  CreateShortCut "$SMPROGRAMS\GENtle\GENtle.lnk" "$INSTDIR\GENtle.exe" "" "$INSTDIR\GENtle.exe" 0
  
  Exec "$INSTDIR\GENtle.exe"
  
SectionEnd

;--------------------------------

; Uninstaller

Section "Uninstall"
  
  ; Remove registry keys
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GENtle"
  DeleteRegKey HKLM SOFTWARE\NSIS_GENtle

  ; Remove files and uninstaller
;  Delete $INSTDIR\GENtle.exe
;  Delete $INSTDIR\uninstall.exe
  Delete $INSTDIR\help\*.*
  Delete $INSTDIR\bitmaps\*.*
  RmDir $INSTDIR\help
  RmDir $INSTDIR\bitmaps
  Delete $INSTDIR\*.*
  RmDir $INSTDIR

  Delete "$DESKTOP\GENtle.lnk"
  Delete "$SMPROGRAMS\GENtle\*.*"
  RmDir  "$SMPROGRAMS\GENtle"

  ; Remove shortcuts, if any
  Delete "$SMPROGRAMS\GENtle\*.*"

  ; Remove directories used
  RMDir "$SMPROGRAMS\GENtle"

;Delete Files 
  RMDir /r "$INSTDIR\*.*"    
 
;Remove the installation directory
  RMDir "$INSTDIR"


SectionEnd