| 1 | # General info: |
|---|
| 2 | !ifdef Debug |
|---|
| 3 | OutFile "Debug\pdns-install.exe" |
|---|
| 4 | !else |
|---|
| 5 | OutFile "Release\pdns-install.exe" |
|---|
| 6 | !endif |
|---|
| 7 | |
|---|
| 8 | Name "PowerDNS 2.9.3" |
|---|
| 9 | BrandingText " " |
|---|
| 10 | Icon "release-scripts\pdns.ico" |
|---|
| 11 | WindowIcon "on" |
|---|
| 12 | BGGradient 0080c0 0080c0 ffffff |
|---|
| 13 | CRCCheck "on" |
|---|
| 14 | |
|---|
| 15 | # Install info: |
|---|
| 16 | InstallDir "$PROGRAMFILES\PowerDNS\" |
|---|
| 17 | InstallDirRegKey HKLM SOFTWARE\PowerDNS "" |
|---|
| 18 | |
|---|
| 19 | ComponentText "This will install PowerDNS for Windows onto your computer." |
|---|
| 20 | InstType "Full" |
|---|
| 21 | InstType "Minimal" |
|---|
| 22 | LicenseText "Please read the PowerDNS license before installing." |
|---|
| 23 | LicenseData "..\LICENSE" |
|---|
| 24 | EnabledBitmap "release-scripts\enabled.bmp" |
|---|
| 25 | DisabledBitmap "release-scripts\disabled.bmp" |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | # Directory info: |
|---|
| 29 | DirShow "show" |
|---|
| 30 | DirText "Select directory to install PowerDNS:" |
|---|
| 31 | AllowRootDirInstall "true" |
|---|
| 32 | |
|---|
| 33 | # Install page info: |
|---|
| 34 | AutoCloseWindow "true" |
|---|
| 35 | #UninstallIcon "release-scripts\pdns.ico" |
|---|
| 36 | ShowInstDetails "nevershow" |
|---|
| 37 | ShowUninstDetails "nevershow" |
|---|
| 38 | |
|---|
| 39 | # Compiler info: |
|---|
| 40 | SetCompress "auto" |
|---|
| 41 | |
|---|
| 42 | # Install section: |
|---|
| 43 | Section "PowerDNS Executeable (required)" |
|---|
| 44 | SectionIn "RO" |
|---|
| 45 | |
|---|
| 46 | SetOutPath $INSTDIR |
|---|
| 47 | |
|---|
| 48 | # Check if the directory exists. |
|---|
| 49 | IfFileExists "$INSTDIR\*.*" NoDir |
|---|
| 50 | NoDir: |
|---|
| 51 | CreateDirectory "$INSTDIR" |
|---|
| 52 | |
|---|
| 53 | # Add files. |
|---|
| 54 | SetOverwrite on |
|---|
| 55 | |
|---|
| 56 | !ifdef Debug |
|---|
| 57 | File /oname=$INSTDIR\pdns.exe "Debug\pdns.exe" |
|---|
| 58 | File /oname=$INSTDIR\pdnsmsg.dll "Debug\pdnsmsg.dll" |
|---|
| 59 | File /oname=$INSTDIR\zone2sql.exe "Debug\zone2sql.exe" |
|---|
| 60 | |
|---|
| 61 | !else |
|---|
| 62 | File /oname=$INSTDIR\pdns.exe "Release\pdns.exe" |
|---|
| 63 | File /oname=$INSTDIR\pdnsmsg.dll "Release\pdnsmsg.dll" |
|---|
| 64 | File /oname=$INSTDIR\zone2sql.exe "Release\zone2sql.exe" |
|---|
| 65 | |
|---|
| 66 | !endif |
|---|
| 67 | |
|---|
| 68 | File /oname=$INSTDIR\pdns.ico "release-scripts\pdns.ico" |
|---|
| 69 | |
|---|
| 70 | WriteUninstaller $INSTDIR\uninst-pdns.exe |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | SetOverwrite ifnewer |
|---|
| 74 | File /oname=$INSTDIR\pthreadVCE.dll C:\WIN2000\System32\pthreadVCE.dll |
|---|
| 75 | File /oname=$INSTDIR\msvcrt.dll C:\WIN2000\System32\msvcrt.dll |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | WriteRegStr HKLM SOFTWARE\PowerDNS "" $INSTDIR |
|---|
| 79 | |
|---|
| 80 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerDNS" \ |
|---|
| 81 | "DisplayName" "PowerDNS Nameserver (remove only)" |
|---|
| 82 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerDNS" \ |
|---|
| 83 | "UninstallString" "$INSTDIR\uninst-pdns.exe" |
|---|
| 84 | |
|---|
| 85 | # Create default pdns configuration file. |
|---|
| 86 | IfFileExists "$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 | |
|---|
| 113 | NoConfWrite: |
|---|
| 114 | |
|---|
| 115 | SectionEnd |
|---|
| 116 | |
|---|
| 117 | |
|---|
| 118 | # Start menu section: |
|---|
| 119 | Section "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 | |
|---|
| 143 | SectionEnd |
|---|
| 144 | |
|---|
| 145 | |
|---|
| 146 | # Example section. |
|---|
| 147 | Section "Example zone" |
|---|
| 148 | SectionIn 1 |
|---|
| 149 | |
|---|
| 150 | IfFileExists $INSTDIR\powerdns.mdb Ask |
|---|
| 151 | Goto OverwriteZone |
|---|
| 152 | |
|---|
| 153 | Ask: |
|---|
| 154 | MessageBox MB_YESNO "powerdns.mdb already exists, overwrite?" IDNO StatusEnd |
|---|
| 155 | SetOverwrite on |
|---|
| 156 | |
|---|
| 157 | OverwriteZone: |
|---|
| 158 | File /oname=$INSTDIR\powerdns.mdb "..\modules\odbcbackend\powerdns.mdb" |
|---|
| 159 | |
|---|
| 160 | StatusEnd: |
|---|
| 161 | SectionEnd |
|---|
| 162 | |
|---|
| 163 | |
|---|
| 164 | # Uninstall section. |
|---|
| 165 | Section "Uninstall" |
|---|
| 166 | MessageBox MB_YESNO "Are you sure you want to uninstall PowerDNS?" IDYES Proceed |
|---|
| 167 | Quit |
|---|
| 168 | |
|---|
| 169 | Proceed: |
|---|
| 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 | |
|---|
| 174 | Skip: |
|---|
| 175 | ExecWait '"$INSTDIR\pdns.exe" --unregister-service' |
|---|
| 176 | |
|---|
| 177 | FSkip: |
|---|
| 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 | |
|---|
| 196 | SectionEnd |
|---|
| 197 | |
|---|
| 198 | |
|---|
| 199 | |
|---|
| 200 | Function .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 | |
|---|
| 207 | NoReg: |
|---|
| 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 | |
|---|
| 213 | NoODBC: |
|---|
| 214 | |
|---|
| 215 | FunctionEnd |
|---|