1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
4 !include "LogicLib.nsh"
\r
5 !include WordFunc.nsh
\r
6 !include "FileFunc.nsh"
\r
7 !insertmacro VersionCompare
\r
9 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
11 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
12 SetOverwrite on ; overwrite files
\r
13 SetCompress auto ; compress iff saves space
\r
14 SetCompressor /solid lzma ; compress whole installer as one block
\r
15 SetDatablockOptimize off ; only saves us 0.1%, not worth it
\r
16 XPStyle on ; add an XP manifest to the installer
\r
17 RequestExecutionLevel admin ; on Vista we must be admin because we write to Program Files
\r
19 LangString LanguageCode ${LANG_ENGLISH} "en"
\r
20 !define DOTNET_URL "http://download.microsoft.com/download/0/6/1/061F001C-8752-4600-A198-53214C69B51F/dotnetfx35setup.exe"
\r
21 !define MSI31_URL "http://download.microsoft.com/download/1/4/7/147ded26-931c-4daf-9095-ec7baf996f46/WindowsInstaller-KB893803-v2-x86.exe"
\r
23 !define APPNAME "Radegast"
\r
24 !define VERSION "2.19"
\r
25 !define MAINEXEC "${APPNAME}.exe"
\r
26 !define DOTNET_VERSION "3.5"
\r
27 !define VOICEPACK "RadegastVoicepack-1.0.exe"
\r
28 !define UNINST_REG "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
\r
30 ; The name of the installer
\r
34 OutFile "..\${APPNAME}-${VERSION}-installer.exe"
\r
36 ; The default installation directory
\r
37 InstallDir "$PROGRAMFILES\${APPNAME}"
\r
39 ; Registry key to check for directory (so if you install again, it will
\r
40 ; overwrite the old one automatically)
\r
41 InstallDirRegKey HKLM "Software\${APPNAME}" "Install_Dir"
\r
43 ;--------------------------------
\r
45 LicenseText "Please review the license terms before installing Radegast"
\r
46 LicenseData "license.txt"
\r
54 UninstPage uninstConfirm
\r
55 UninstPage instfiles
\r
57 ;--------------------------------
\r
58 ; Check MSI and .NET
\r
59 Section ".NET check"
\r
60 ; Comment out below if not mandatory
\r
63 ; Set output path to the installation directory.
\r
65 ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" "SP"
\r
72 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
74 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
75 GetDLLVersion "$SYSDIR\msi.dll" $R0 $R1
\r
76 IntOp $R2 $R0 / 0x00010000 ; $R2 now contains major version
\r
77 IntOp $R3 $R0 & 0x0000FFFF ; $R3 now contains minor version
\r
78 IntOp $R4 $R1 / 0x00010000 ; $R4 now contains release
\r
79 IntOp $R5 $R1 & 0x0000FFFF ; $R5 now contains build
\r
80 StrCpy $0 "$R2.$R3.$R4.$R5" ; $0 now contains string like "1.2.0.192"
\r
81 DetailPrint "MSI version $0"
\r
85 ${ElseIf} $R2 == '3'
\r
86 DetailPrint "MSI3.x"
\r
91 DetailPrint "MSI3.1 already installed"
\r
99 MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \
\r
100 "Your MSI version: $0.$\nRequired Version: 3.1 or greater.$\nDownload MSI version from www.microsoft.com?" \
\r
101 /SD IDYES IDYES DownloadMSI IDNO DownloadDotNET
\r
102 goto GiveUpDotNET ;IDCANCEL
\r
105 DetailPrint "Beginning download of MSI3.1."
\r
106 NSISDL::download ${MSI31_URL} "$TEMP\WindowsInstaller-KB893803-v2-x86.exe"
\r
107 DetailPrint "Completed download."
\r
109 ${If} $0 == "cancel"
\r
110 MessageBox MB_YESNO|MB_ICONEXCLAMATION \
\r
111 "Download cancelled. Continue Installation?" \
\r
112 IDYES DownloadDotNET IDNO GiveUpDotNET
\r
113 ${ElseIf} $0 != "success"
\r
114 MessageBox MB_YESNO|MB_ICONEXCLAMATION \
\r
115 "Download failed:$\n$0$\n$\nContinue Installation?" \
\r
116 IDYES DownloadDotNET IDNO GiveUpDotNET
\r
118 DetailPrint "Pausing installation while downloaded MSI3.1 installer runs."
\r
119 ExecWait '$TEMP\WindowsInstaller-KB893803-v2-x86.exe /quiet /norestart' $0
\r
120 DetailPrint "Completed MSI3.1 install/update. Exit code = '$0'. Removing MSI3.1 installer."
\r
121 Delete "$TEMP\WindowsInstaller-KB893803-v2-x86.exe"
\r
122 DetailPrint "MSI3.1 installer removed."
\r
123 goto DownloadDotNET
\r
126 DetailPrint "Beginning download of .NET 3.5SP1."
\r
127 NSISdl::download /TIMEOUT=30000 ${DOTNET_URL} "$TEMP\dotnetfx35.exe" /END
\r
129 DetailPrint "Result: $0"
\r
130 StrCmp $0 "success" InstallDotNet
\r
131 StrCmp $0 "cancel" GiveUpDotNET
\r
132 NSISdl::download /TIMEOUT=30000 /NOPROXY ${DOTNET_URL} "$TEMP\dotnetfx35.exe" /END
\r
134 DetailPrint "Result: $0"
\r
135 StrCmp $0 "success" InstallDotNet
\r
137 MessageBox MB_ICONSTOP "Download failed: $0"
\r
141 DetailPrint "Installation cancelled by user."
\r
145 DetailPrint "Completed download."
\r
147 ${If} $0 == "cancel"
\r
148 MessageBox MB_YESNO|MB_ICONEXCLAMATION \
\r
149 "Download cancelled. Continue Installation?" \
\r
150 IDYES NewDotNET IDNO GiveUpDotNET
\r
152 DetailPrint "Pausing installation while downloaded .NET Framework installer runs."
\r
153 MessageBox MB_OKCANCEL "Setup will now install .NET Framework$\nThis will take a while." \
\r
154 IDOK +1 IDCANCEL GiveUpDotNET
\r
155 ExecWait '$TEMP\dotnetfx35.exe /q /norestart /c:"install /q"'
\r
156 DetailPrint "Completed .NET Framework install/update. Removing .NET Framework installer."
\r
157 Delete "$TEMP\dotnetfx35.exe"
\r
158 DetailPrint ".NET Framework installer removed."
\r
162 DetailPrint ".NET Framework check complete."
\r
167 ;--------------------------------
\r
168 ; The stuff to install
\r
170 ;--------------------------------
\r
171 Section "${APPNAME} core (required)"
\r
175 ; Set output path to the installation directory.
\r
176 SetOutPath $INSTDIR
\r
179 File /r /x *.nsi /x *.bak /x *.mdb /x *.application /x *vshost*.* /x *installer*.* /x *.so /x *.dylib *.*
\r
180 ; File Radegast.exe
\r
182 ; Write the installation path into the registry
\r
183 WriteRegStr HKLM "SOFTWARE\${APPNAME}" "Install_Dir" "$INSTDIR"
\r
185 ; Write the uninstall keys for Windows
\r
186 WriteRegStr HKLM ${UNINST_REG} "DisplayName" "${APPNAME} ${VERSION}"
\r
187 WriteRegStr HKLM ${UNINST_REG} "UninstallString" '"$INSTDIR\uninstall.exe"'
\r
188 WriteRegStr HKLM ${UNINST_REG} "QuietUninstallString" '"$INSTDIR\uninstall.exe" /S'
\r
189 WriteRegStr HKLM ${UNINST_REG} "Publisher" "Radegast Development Team"
\r
190 WriteRegStr HKLM ${UNINST_REG} "DisplayVersion" "${VERSION}"
\r
191 WriteRegStr HKLM ${UNINST_REG} "DisplayIcon" "$INSTDIR\${MAINEXEC}"
\r
192 ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
\r
193 IntFmt $0 "0x%08X" $0
\r
194 WriteRegDWORD HKLM "${UNINST_REG}" "EstimatedSize" "$0"
\r
195 WriteRegDWORD HKLM ${UNINST_REG} "NoModify" 1
\r
196 WriteRegDWORD HKLM ${UNINST_REG} "NoRepair" 1
\r
197 WriteUninstaller "uninstall.exe"
\r
201 ;--------------------------------
\r
202 ; Voice pack download and install
\r
203 Section /o "${APPNAME} Voice Pack (extra download)"
\r
205 IfFileExists "$INSTDIR\SLVoice.exe" voice_download_exists
\r
206 NSISdl::download /TIMEOUT=30000 "http://radegast.googlecode.com/files/${VOICEPACK}" "$INSTDIR\${VOICEPACK}"
\r
208 StrCmp $R0 "success" voice_download_success voice_download_failed
\r
210 voice_download_success:
\r
211 ExecWait '"$INSTDIR\${VOICEPACK}" /D=$INSTDIR' $0
\r
212 Delete "$INSTDIR\${VOICEPACK}"
\r
213 goto voice_download_end
\r
215 voice_download_failed:
\r
216 MessageBox MB_OK "Download failed: $R0. Skipping installation of voice."
\r
217 goto voice_download_end
\r
219 voice_download_exists:
\r
220 DetailPrint "Voice pack already present, skipping the install"
\r
221 goto voice_download_end
\r
223 voice_download_end:
\r
226 ;--------------------------------
\r
228 Section "Start Menu Shortcuts"
\r
230 CreateDirectory "$SMPROGRAMS\${APPNAME}"
\r
231 CreateShortCut "$SMPROGRAMS\${APPNAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
\r
232 CreateShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk" "$INSTDIR\${MAINEXEC}" "" "$INSTDIR\${MAINEXEC}" 0
\r
236 ;--------------------------------
\r
238 Section "Desktop shortcut"
\r
240 CreateShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\${MAINEXEC}" "" "$INSTDIR\${MAINEXEC}" 0
\r
244 ;--------------------------------
\r
247 Section "Uninstall"
\r
248 IfFileExists "$INSTDIR\uninstall_voice.exe" +1 +2
\r
249 ExecWait '"$INSTDIR\uninstall_voice.exe" /S' $0
\r
251 ; Remove registry keys
\r
252 DeleteRegKey HKLM ${UNINST_REG}
\r
253 DeleteRegKey HKLM "SOFTWARE\${APPNAME}"
\r
255 ; Remove files and uninstaller
\r
256 Delete $INSTDIR\*.*
\r
257 Delete $INSTDIR\aiml\*.*
\r
258 RMDir $INSTDIR\aiml
\r
259 Delete $INSTDIR\aiml_config\*.*
\r
260 RMDir $INSTDIR\aiml_config
\r
261 Delete $INSTDIR\character\*.*
\r
262 RMDir $INSTDIR\character
\r
263 Delete $INSTDIR\openmetaverse_data\static_assets\*.*
\r
264 RMDir $INSTDIR\openmetaverse_data\static_assets
\r
265 RMDir $INSTDIR\openmetaverse_data
\r
266 Delete $INSTDIR\openmetaverse_data\*.*
\r
267 RMDir $INSTDIR\openmetaverse_data
\r
268 Delete $INSTDIR\shader_data\*.*
\r
269 RMDir $INSTDIR\shader_data
\r
271 ; Remove shortcuts, if any
\r
272 Delete "$DESKTOP\${APPNAME}.lnk"
\r
273 Delete "$SMPROGRAMS\${APPNAME}\*.*"
\r
275 ; Remove directories used
\r
276 RMDir "$SMPROGRAMS\${APPNAME}"
\r