| 1 | # General info: |
|---|
| 2 | !ifdef Debug |
|---|
| 3 | OutFile "Debug\pdns-install.exe" |
|---|
| 4 | Name "PowerDNS 2.9.5 (DEBUG)" |
|---|
| 5 | !else |
|---|
| 6 | OutFile "Release\pdns-install.exe" |
|---|
| 7 | Name "PowerDNS 2.9.5" |
|---|
| 8 | !endif |
|---|
| 9 | |
|---|
| 10 | BrandingText " " |
|---|
| 11 | Icon "release-scripts\pdns.ico" |
|---|
| 12 | WindowIcon "on" |
|---|
| 13 | BGGradient 0080c0 0080c0 ffffff |
|---|
| 14 | CRCCheck "on" |
|---|
| 15 | |
|---|
| 16 | # Install info: |
|---|
| 17 | InstallDir "$PROGRAMFILES\PowerDNS\" |
|---|
| 18 | InstallDirRegKey HKLM SOFTWARE\PowerDNS "" |
|---|
| 19 | |
|---|
| 20 | ComponentText "This will install PowerDNS for Windows onto your computer." |
|---|
| 21 | InstType "Full" |
|---|
| 22 | InstType "Minimal" |
|---|
| 23 | LicenseText "Please read the PowerDNS license before installing." |
|---|
| 24 | LicenseData "..\LICENSE" |
|---|
| 25 | EnabledBitmap "release-scripts\enabled.bmp" |
|---|
| 26 | DisabledBitmap "release-scripts\disabled.bmp" |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | # Directory info: |
|---|
| 30 | DirShow "show" |
|---|
| 31 | DirText "Select directory to install PowerDNS:" |
|---|
| 32 | AllowRootDirInstall "true" |
|---|
| 33 | |
|---|
| 34 | # Install page info: |
|---|
| 35 | AutoCloseWindow "true" |
|---|
| 36 | #UninstallIcon "release-scripts\pdns.ico" |
|---|
| 37 | ShowInstDetails "nevershow" |
|---|
| 38 | ShowUninstDetails "nevershow" |
|---|
| 39 | |
|---|
| 40 | # Compiler info: |
|---|
| 41 | SetCompress "auto" |
|---|
| 42 | |
|---|
| 43 | # Install section: |
|---|
| 44 | Section "PowerDNS Executeable (required)" |
|---|
| 45 | SectionIn "RO" |
|---|
| 46 | |
|---|
| 47 | SetOutPath $INSTDIR |
|---|
| 48 | |
|---|
| 49 | # Check if the directory exists. |
|---|
| 50 | IfFileExists "$INSTDIR\*.*" NoDir |
|---|
| 51 | NoDir: |
|---|
| 52 | CreateDirectory "$INSTDIR" |
|---|
| 53 | |
|---|
| 54 | # Add files. |
|---|
| 55 | SetOverwrite on |
|---|
| 56 | |
|---|
| 57 | !ifdef Debug |
|---|
| 58 | File /oname=$INSTDIR\pdns.exe "Debug\pdns.exe" |
|---|
| 59 | File /oname=$INSTDIR\pdnsmsg.dll "Debug\pdnsmsg.dll" |
|---|
| 60 | File /oname=$INSTDIR\zone2sql.exe "Debug\zone2sql.exe" |
|---|
| 61 | File /oname=$INSTDIR\pdns_control.exe "Debug\pdns_control.exe" |
|---|
| 62 | File /oname=$INSTDIR\pdns_recursor.exe "Debug\pdns_recursor.exe" |
|---|
| 63 | |
|---|
| 64 | !else |
|---|
| 65 | File /oname=$INSTDIR\pdns.exe "Release\pdns.exe" |
|---|
| 66 | File /oname=$INSTDIR\pdnsmsg.dll "Release\pdnsmsg.dll" |
|---|
| 67 | File /oname=$INSTDIR\zone2sql.exe "Release\zone2sql.exe" |
|---|
| 68 | File /oname=$INSTDIR\pdns_control.exe "Release\pdns_control.exe" |
|---|
| 69 | File /oname=$INSTDIR\pdns_recursor.exe "Release\pdns_recursor.exe" |
|---|
| 70 | |
|---|
| 71 | !endif |
|---|
| 72 | |
|---|
| 73 | File /oname=$INSTDIR\pdns.ico "release-scripts\pdns.ico" |
|---|
| 74 | |
|---|
| 75 | WriteUninstaller $INSTDIR\uninst-pdns.exe |
|---|
| 76 | |
|---|
| 77 | FileOpen $R2 "$INSTDIR\pdns.exe.local" "w" |
|---|
| 78 | FileClose $R2 |
|---|
| 79 | FileOpen $R2 "$INSTDIR\zone2sql.exe.local" "w" |
|---|
| 80 | FileClose $R2 |
|---|
| 81 | FileOpen $R2 "$INSTDIR\pdns_control.exe.local" "w" |
|---|
| 82 | FileClose $R2 |
|---|
| 83 | FileOpen $R2 "$INSTDIR\pdns_recursor.exe.local" "w" |
|---|
| 84 | FileClose $R2 |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | SetOverwrite ifnewer |
|---|
| 88 | File /oname=$INSTDIR\pthreadVCE.dll C:\WINNT\System32\pthreadVCE.dll |
|---|
| 89 | File /oname=$INSTDIR\msvcrt.dll C:\WINNT\System32\msvcrt.dll |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | WriteRegStr HKLM SOFTWARE\PowerDNS "" $INSTDIR |
|---|
| 93 | |
|---|
| 94 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerDNS" \ |
|---|
| 95 | "DisplayName" "PowerDNS Nameserver (remove only)" |
|---|
| 96 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerDNS" \ |
|---|
| 97 | "UninstallString" "$INSTDIR\uninst-pdns.exe" |
|---|
| 98 | |
|---|
| 99 | # Create default pdns configuration file. |
|---|
| 100 | IfFileExists "$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 | |
|---|
| 124 | NoConfWrite: |
|---|
| 125 | |
|---|
| 126 | SectionEnd |
|---|
| 127 | |
|---|
| 128 | |
|---|
| 129 | # Start menu section: |
|---|
| 130 | Section "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 | |
|---|
| 148 | SectionEnd |
|---|
| 149 | |
|---|
| 150 | |
|---|
| 151 | # Example section. |
|---|
| 152 | Section "Example zone" |
|---|
| 153 | SectionIn 1 |
|---|
| 154 | |
|---|
| 155 | IfFileExists $INSTDIR\powerdns.mdb Ask |
|---|
| 156 | Goto OverwriteZone |
|---|
| 157 | |
|---|
| 158 | Ask: |
|---|
| 159 | MessageBox MB_YESNO "powerdns.mdb already exists, overwrite?" IDNO StatusEnd |
|---|
| 160 | SetOverwrite on |
|---|
| 161 | |
|---|
| 162 | OverwriteZone: |
|---|
| 163 | File /oname=$INSTDIR\powerdns.mdb "..\modules\odbcbackend\powerdns.mdb" |
|---|
| 164 | |
|---|
| 165 | StatusEnd: |
|---|
| 166 | SectionEnd |
|---|
| 167 | |
|---|
| 168 | |
|---|
| 169 | # Uninstall section. |
|---|
| 170 | Section "Uninstall" |
|---|
| 171 | MessageBox MB_YESNO "Are you sure you want to uninstall PowerDNS?" IDYES Proceed |
|---|
| 172 | Quit |
|---|
| 173 | |
|---|
| 174 | Proceed: |
|---|
| 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 | |
|---|
| 179 | Skip: |
|---|
| 180 | ExecWait '"$INSTDIR\pdns.exe" --unregister-service' |
|---|
| 181 | |
|---|
| 182 | FSkip: |
|---|
| 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 | |
|---|
| 207 | SectionEnd |
|---|
| 208 | |
|---|
| 209 | |
|---|
| 210 | |
|---|
| 211 | Function .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 | |
|---|
| 218 | NoReg: |
|---|
| 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 | |
|---|
| 224 | NoODBC: |
|---|
| 225 | |
|---|
| 226 | FunctionEnd |
|---|