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

Revision 95, 5.7 KB (checked in by ahu, 10 years ago)

build fixes for debian
win32 fixes

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