root/trunk/pdns/pdns/release-scripts/pdns.nsi @ 142

Revision 142, 6.4 KB (checked in by ahu, 10 years ago)

lots

  • Property svn:eol-style set to native
  • Property svn:keywords set to author date id revision
Line 
1# General info:
2!ifdef Debug
3OutFile      "Debug\pdns-install.exe"
4Name         "PowerDNS 2.9.5 (DEBUG)"
5!else
6OutFile      "Release\pdns-install.exe"
7Name         "PowerDNS 2.9.5"
8!endif
9
10BrandingText " "
11Icon         "release-scripts\pdns.ico"
12WindowIcon   "on"
13BGGradient   0080c0 0080c0 ffffff
14CRCCheck     "on"
15
16# Install info:
17InstallDir   "$PROGRAMFILES\PowerDNS\"
18InstallDirRegKey HKLM SOFTWARE\PowerDNS ""
19
20ComponentText  "This will install PowerDNS for Windows onto your computer."
21InstType       "Full"
22InstType       "Minimal"
23LicenseText    "Please read the PowerDNS license before installing."
24LicenseData    "..\LICENSE"
25EnabledBitmap  "release-scripts\enabled.bmp"
26DisabledBitmap "release-scripts\disabled.bmp"
27
28
29# Directory info:
30DirShow             "show"
31DirText             "Select directory to install PowerDNS:"
32AllowRootDirInstall "true"
33
34# Install page info:
35AutoCloseWindow   "true"
36#UninstallIcon   "release-scripts\pdns.ico"
37ShowInstDetails   "nevershow"
38ShowUninstDetails "nevershow"
39
40# Compiler info:
41SetCompress  "auto"
42
43# Install section:
44Section   "PowerDNS Executeable (required)"
45SectionIn "RO"
46
47SetOutPath $INSTDIR
48
49# Check if the directory exists.
50IfFileExists "$INSTDIR\*.*" NoDir
51NoDir:
52  CreateDirectory "$INSTDIR"
53
54# Add files.
55SetOverwrite on
56
57!ifdef Debug
58File /oname=$INSTDIR\pdns.exe "Debug\pdns.exe"
59File /oname=$INSTDIR\pdnsmsg.dll "Debug\pdnsmsg.dll"
60File /oname=$INSTDIR\zone2sql.exe "Debug\zone2sql.exe"
61File /oname=$INSTDIR\pdns_control.exe "Debug\pdns_control.exe"
62File /oname=$INSTDIR\pdns_recursor.exe "Debug\pdns_recursor.exe"
63
64!else
65File /oname=$INSTDIR\pdns.exe "Release\pdns.exe"
66File /oname=$INSTDIR\pdnsmsg.dll "Release\pdnsmsg.dll"
67File /oname=$INSTDIR\zone2sql.exe "Release\zone2sql.exe"
68File /oname=$INSTDIR\pdns_control.exe "Release\pdns_control.exe"
69File /oname=$INSTDIR\pdns_recursor.exe "Release\pdns_recursor.exe"
70
71!endif
72
73File /oname=$INSTDIR\pdns.ico "release-scripts\pdns.ico"
74
75WriteUninstaller $INSTDIR\uninst-pdns.exe
76
77FileOpen $R2 "$INSTDIR\pdns.exe.local" "w"
78FileClose $R2
79FileOpen $R2 "$INSTDIR\zone2sql.exe.local" "w"
80FileClose $R2
81FileOpen $R2 "$INSTDIR\pdns_control.exe.local" "w"
82FileClose $R2
83FileOpen $R2 "$INSTDIR\pdns_recursor.exe.local" "w"
84FileClose $R2
85
86
87SetOverwrite ifnewer
88File /oname=$INSTDIR\pthreadVCE.dll C:\WINNT\System32\pthreadVCE.dll
89File /oname=$INSTDIR\msvcrt.dll C:\WINNT\System32\msvcrt.dll
90
91
92WriteRegStr HKLM SOFTWARE\PowerDNS "" $INSTDIR
93
94WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerDNS" \
95                   "DisplayName" "PowerDNS Nameserver (remove only)"
96WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerDNS" \
97                   "UninstallString" "$INSTDIR\uninst-pdns.exe"
98
99# Create default pdns configuration file.
100IfFileExists "$INSTDIR\pdns.conf" NoConfWrite
101  FileOpen $R1 "$INSTDIR\pdns.conf" "w"
102 
103  FileWrite $R1 "# PDNS configuration file.$\r$\n$\r$\n"
104
105  FileWrite $R1 "# Use NT logging when running as a service:$\r$\n"
106  FileWrite $R1 "use-ntlog=yes$\r$\n$\r$\n"
107
108  FileWrite $R1 "# Backends to launch at startup:$\r$\n"
109  FileWrite $R1 "launch=odbc$\r$\n$\r$\n"
110
111  FileWrite $R1 "odbc-datasource=PowerDNS$\r$\n"
112  FileWrite $R1 "odbc-user=PowerDNS$\r$\n"
113  FileWrite $R1 "odbc-pass=PowerDNS$\r$\n"
114  FileWrite $R1 "odbc-table=records$\r$\n$\r$\n"
115
116  FileWrite $R1 "# Launch a statistical webserver:$\r$\n"
117  FileWrite $R1 "webserver=yes$\r$\n"
118  FileWrite $R1 "webserver-port=8081$\r$\n$\r$\n"
119
120  FileWrite $R1 "# EOF$\r$\n"
121
122  FileClose $R1
123
124NoConfWrite:
125
126SectionEnd
127
128
129# Start menu section:
130Section "Start menu + shortcuts"
131  SectionIn 1
132
133  CreateDirectory "$SMPROGRAMS\PowerDNS"
134
135  WriteINIStr "$SMPROGRAMS\PowerDNS\PowerDNS Homepage.url" \
136              "InternetShortcut" "URL" "http://www.powerdns.com/"
137
138  WriteINIStr "$SMPROGRAMS\PowerDNS\PowerDNS Documentation.url" \
139              "InternetShortcut" "URL" "http://downloads.powerdns.com/documentation/html/"
140
141  CreateShortCut "$SMPROGRAMS\PowerDNS\PowerDNS.lnk" \
142                 "$INSTDIR\pdns.exe" "" \
143                 "$INSTDIR\pdns.ico"
144
145  CreateShortCut "$SMPROGRAMS\PowerDNS\Uninstall PowerDNS.lnk" \
146                 "$INSTDIR\uninst-pdns.exe"
147 
148SectionEnd
149
150
151# Example section.
152Section "Example zone"
153  SectionIn 1
154
155  IfFileExists $INSTDIR\powerdns.mdb Ask
156    Goto OverwriteZone
157
158Ask:
159  MessageBox MB_YESNO "powerdns.mdb already exists, overwrite?" IDNO StatusEnd
160    SetOverwrite on
161
162OverwriteZone:
163  File /oname=$INSTDIR\powerdns.mdb "..\modules\odbcbackend\powerdns.mdb"
164
165StatusEnd:
166SectionEnd
167
168
169# Uninstall section.
170Section "Uninstall"
171  MessageBox MB_YESNO "Are you sure you want to uninstall PowerDNS?" IDYES Proceed
172    Quit
173 
174Proceed:
175  IfFileExists $INSTDIR\pdns.exe Skip
176    MessageBox MB_YESNO "It does not appear that PowerDNS is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)" IDYES FSkip
177      Quit
178
179Skip:
180  ExecWait '"$INSTDIR\pdns.exe" --unregister-service'
181
182FSkip:
183
184  DeleteRegKey HKLM "System\CurrentControlSet\Services\PDNS"
185  DeleteRegKey HKLM "System\CurrentControlSet\Services\Eventlog\Application\PDNS"
186  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerDNS"
187  DeleteRegKey HKLM "SOFTWARE\PowerDNS"
188
189  RMDir /r $SMPROGRAMS\PowerDNS
190
191  Delete $INSTDIR\pthreadVCE.dll
192  Delete $INSTDIR\msvcrt.dll
193  Delete $INSTDIR\pdnsmsg.dll
194  Delete $INSTDIR\uninst-pdns.exe
195  Delete $INSTDIR\pdns.ico
196  Delete $INSTDIR\pdns.exe
197  Delete $INSTDIR\pdns.exe.local
198  Delete $INSTDIR\zone2sql.exe
199  Delete $INSTDIR\zone2sql.exe.local
200  Delete $INSTDIR\pdns_control.exe
201  Delete $INSTDIR\pdns_control.exe.local
202  Delete $INSTDIR\pdns_recursor.exe
203  Delete $INSTDIR\pdns_recursor.exe.local
204
205  RMDir $INSTDIR
206
207SectionEnd
208
209
210
211Function .onInstSuccess
212
213  Sleep 500
214
215  MessageBox MB_YESNO "Do you want to register PDNS as a NT service?" IDNO NoReg
216    Exec '"$INSTDIR\pdns.exe" --register-service'
217
218NoReg:
219  Sleep 500
220
221  MessageBox MB_YESNO "Installation successful!$\r$\n$\r$\nTo use the ODBC functionality in PowerDNS you need to create a ODBC data source.$\r$\nFor more information about the ODBC backend please examine the documentation.$\r$\n$\r$\nDo you want to create a data source now?" IDNO NoODBC
222    Exec '"rundll32.exe" shell32.dll,Control_RunDLL odbccp32.cpl'
223
224NoODBC:
225
226FunctionEnd
Note: See TracBrowser for help on using the browser.