Changeset 7524
- Timestamp:
- Sep 23, 2009, 2:11:31 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
installation_files/windows/installer.nsi
r7517 r7524 26 26 Var MinGWDir # mingw install root ($programfiles\mingw) 27 27 Var NetCDFDir # netcdf binaries ($commonfiles\netcdf) 28 Var ScientificPythonInst #has ScientificPython been installed 29 Var NumpyInst #has Numpy been installed 30 Var MatplotlibInst #has matplotlib beeen installed 28 31 # support variables for user dialogs 29 32 Var Dialog … … 72 75 # installer 73 76 77 Section "$(section_mvcrp)" sec_mvcrp 78 #SectionIn RO # read only, it's required 79 SetOutPath "${TemporaryFilesDir}" 80 File "${FileSource}\prereqs\${MVCRPInst}" 81 ExecWait "${TemporaryFilesDir}\${MVCRPInst} /Q" 82 SectionEnd 83 74 84 Section "$(section_netcdf)" sec_ncdf 75 SectionIn RO # read only, it's required85 #SectionIn RO # read only, it's required 76 86 # install netcdf to default, no custom selection here 77 87 StrCpy $NetCDFDir "${NetCDFDefaultFolder}" … … 99 109 Section "!$(section_anuga_install)" sec_install # anuga main 100 110 SectionIn RO 101 # update path environment 102 ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" 103 StrCpy $0 "$PythonDir;$MinGWDir\bin;$NetCDFDir;$0" 104 WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $0 111 # update path environment 112 ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$PythonDir" 113 ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$MinGWDir\bin" 114 ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$NetCDFDir" 115 #ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" 116 #StrCpy $0 "$0;$PythonDir;$MinGWDir\bin;$NetCDFDir;" 117 #WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $0 105 118 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 106 107 119 StrCpy $PackagesDir "$PythonDir\Lib\site-packages" 108 120 … … 120 132 #Set MingG\bin environment path only for the installer to access gcc for compile all 121 133 ReadEnvStr $R0 "PATH" 122 StrCpy $R0 "$R0;$MinGWDir\bin "134 StrCpy $R0 "$R0;$MinGWDir\bin;$PythonDir\DLLs" 123 135 System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("PATH", R0).r2' 124 136 ReadEnvStr $R0 "PATH" … … 140 152 Exec '"$PythonDir\python.exe" "$OUTDIR\validate_all.py"' 141 153 SectionEnd 142 154 155 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN 156 !insertmacro MUI_DESCRIPTION_TEXT ${sec_mvcrp} $(description_mvcrp) 157 !insertmacro MUI_DESCRIPTION_TEXT ${sec_ncdf} $(description_netcdf) 158 !insertmacro MUI_DESCRIPTION_TEXT ${sec_install} $(description_anuga_install) 159 !insertmacro MUI_DESCRIPTION_TEXT ${sec_test} $(description_anuga_test) 160 !insertmacro MUI_DESCRIPTION_TEXT ${sec_validate} $(description_anuga_validate) 161 !insertmacro MUI_DESCRIPTION_TEXT ${sec_viewer} $(description_anuga_viewer) 162 !insertmacro MUI_DESCRIPTION_TEXT ${sec_ext} $(description_anuga_viewer_extension) 163 !insertmacro MUI_FUNCTION_DESCRIPTION_END 164 165 # function executed on initialization of the installer 166 Function .onInit 167 # prevent the installer from beeing executed twice a time 168 System::Call "kernel32::CreateMutexA(i 0, i 0, t '$(^Name)') i .n ?e" # create a mutex 169 Pop $0 170 StrCmp $0 0 0 find 171 Return # launch normaly if mutex could be created = no other instance running 172 173 find: 174 StrLen $0 "$(^Name)" 175 IntOp $0 $0 + 1 176 loop: 177 FindWindow $1 '#32770' '' 0 $1 # search the installers window if another instance is already running 178 IntCmp $1 0 +4 179 System::Call /NOUNLOAD "user32.dll::GetWindowText(i r1, t .r2, i r0) i.n" 180 StrCmp $2 "$(^Name)" 0 loop # check back for correct window text 181 System::Call "user32::SetForegroundWindow(i r1) i.n" # bring it to front if found 182 Abort # then exit 183 FunctionEnd 184 185 186 Function .onGUIEnd 187 RMDir /r "${TemporaryFilesDir}" 188 FunctionEnd 189 190 191 Function EnterPython 192 # installbutton and directory selection 193 !insertmacro MUI_HEADER_TEXT "$(page_python_title)" "$(page_python_subtitle)" 194 nsDialogs::Create 1018 195 Pop $Dialog 196 StrCmp $Dialog "error" 0 +2 197 Abort 198 GetDlgItem $Control0 $HWNDPARENT 1 199 200 # get python directory 201 ReadRegStr $PythonDir HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe" "" 202 StrLen $0 $PythonDir 203 IntOp $0 $0 - 10 204 StrCpy $PythonDir $PythonDir $0 205 206 # select default, if possible from registry 207 IfFileExists "$PythonDir\python.exe" +2 208 StrCpy $PythonDir "C:\Python25" 209 210 # create dialog items 211 ${NSD_CreateLabel} 10 10 430 28 "$(page_python_install_label)" 212 ${NSD_CreateButton} 40 50 370 24 "$(page_python_install_button)" 213 Pop $Control1 214 ${NSD_CreateLabel} 10 100 430 28 "$(page_python_browse_label)" 215 ${NSD_CreateDirRequest} 40 140 290 24 "$PythonDir" 216 Pop $Control2 217 ${NSD_CreateButton} 340 140 70 24 "$(page_python_browse_button)" 218 Pop $Control3 219 ${NSD_CreateLabel} 10 190 430 28 "$(page_python_outro)" 220 221 # register dialog actions 222 ${NSD_OnClick} $Control1 RunPythonSetup 223 ${NSD_OnChange} $Control2 ValidatePythonDir 224 ${NSD_OnClick} $Control3 BrowsePythonDir 225 226 # check for valid python directory 227 Call ValidatePythonDir 228 229 # show the page 230 nsDialogs::Show 231 FunctionEnd 232 233 # extract and run the python installer 234 Function RunPythonSetup 235 SetOutPath "${TemporaryFilesDir}" 236 File "${FileSource}\prereqs\${PythonInst}" 237 ExecShell "" '"${TemporaryFilesDir}\${PythonInst}"' 238 StrCpy $PythonInst "1" 239 EnableWindow $Control0 1 # enable next button 240 FunctionEnd 241 242 # browse for the python dir with a folder dialog 243 Function BrowsePythonDir 244 nsDialogs::SelectFolderDialog "$(page_python_browse_dialog_title)" $PythonDir 245 Pop $0 246 StrCmp $0 "error" 0 +2 247 Return 248 ${NSD_SetText} $Control2 $0 249 Call ValidatePythonDir 250 FunctionEnd 251 252 # enable next button if selected python dir is valid 253 Function ValidatePythonDir 254 ${NSD_GetText} $Control2 $PythonDir 255 IfFileExists "$PythonDir\python.exe" ok 256 257 EnableWindow $Control0 0 258 Return 259 ok: 260 EnableWindow $Control0 1 261 FunctionEnd 262 263 264 Function EnterExtensions 265 # installbuttons for missing extensions 266 !insertmacro MUI_HEADER_TEXT "$(page_extensions_title)" "$(page_extensions_subtitle)" 267 nsDialogs::Create 1018 268 Pop $Dialog 269 StrCmp $Dialog "error" 0 +2 270 Abort 271 GetDlgItem $Control0 $HWNDPARENT 1 272 273 ${NSD_CreateLabel} 10 10 430 28 "$(page_extensions_intro)" 274 ${NSD_CreateLabel} 40 50 350 28 "$(page_extensions_numpy_ok)" 275 Pop $Control1 276 ${NSD_CreateLabel} 40 100 350 28 "$(page_extensions_scientific_ok)" 277 Pop $Control2 278 ${NSD_CreateLabel} 40 150 350 28 "$(page_extensions_matplotlib_ok)" 279 Pop $Control3 280 ${NSD_CreateLabel} 10 190 430 28 "$(page_extensions_outro_next)" 281 Pop $Control4 282 283 StrCpy $1 "0" 284 StrCpy $2 "0" 285 StrCpy $3 "0" 286 StrCpy $4 "0" 287 StrCpy $5 "0" 288 IfFileExists "$PackagesDir\Numpy\*.py" 0 +2 289 IntOp $1 $1 + 1 290 IfFileExists "$PackagesDir\Scientific\*.py" 0 +2 291 IntOp $2 $2 + 1 292 IfFileExists "$PackagesDir\matplotlib\*.py" 0 +2 293 IntOp $3 $3 + 1 294 IntOp $4 $2 + $1 295 IntOp $5 $4 + $3 296 297 IntCmp $1 0 0 num_ok num_ok 298 ${NSD_SetText} $Control1 "$(page_extensions_numpy_label_install)" 299 num_ok: 300 301 IntCmp $2 0 0 scien_ok scien_ok 302 ${NSD_SetText} $Control2 "$(page_extensions_scientific_label_install)" 303 scien_ok: 304 305 IntCmp $3 0 0 matp_ok matp_ok 306 ${NSD_SetText} $Control3 "$(page_extensions_matplotlib_label_install)" 307 matp_ok: 308 309 IntCmp $5 3 no_inst 310 ${NSD_SetText} $Control4 "$(page_extensions_outro_install)" 311 ${NSD_SetText} $Control0 "$(^InstallBtn)" 312 no_inst: 313 314 nsDialogs::Show 315 FunctionEnd 316 317 Function LeaveExtensions 318 IntCmp $5 0 +2 319 Return 320 321 SetOutPath "${TemporaryFilesDir}" 322 323 IntCmp $1 1 after_num 324 File "${FileSource}\prereqs\${NumpyInst}" 325 ExecWait '"${TemporaryFilesDir}\${NumpyInst}"' 326 StrCpy $NumpyInst "1" 327 after_num: 328 329 StrCmp $2 1 after_scien 330 File "${FileSource}\prereqs\${ScientificInst}" 331 ExecWait '"${TemporaryFilesDir}\${ScientificInst}"' 332 StrCpy $ScientificPythonInst "1" 333 after_scien: 334 335 StrCmp $3 1 after_matp 336 File "${FileSource}\prereqs\${MatplotlibInst}" 337 ExecWait '"${TemporaryFilesDir}\${MatplotlibInst}"' 338 StrCpy $MatplotlibInst "1" 339 after_matp: 340 341 FunctionEnd 342 343 344 Function EnterMinGW 345 # installbutton and directory selection 346 !insertmacro MUI_HEADER_TEXT "$(page_mingw_title)" "$(page_mingw_subtitle)" 347 nsDialogs::Create 1018 348 Pop $Dialog 349 StrCmp $Dialog "error" 0 +2 350 Abort 351 GetDlgItem $Control0 $HWNDPARENT 1 352 353 ReadRegStr $MinGWDir HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MinGW" "InstallLocation" 354 IfFileExists "$MinGWDir\bin\gcc.exe" +2 355 StrCpy $MinGWDir "C:\MinGW" 356 357 ${NSD_CreateLabel} 10 10 430 28 "$(page_mingw_install_label)" 358 ${NSD_CreateButton} 40 50 370 24 "$(page_mingw_install_button)" 359 Pop $Control1 360 ${NSD_CreateLabel} 10 100 430 28 "$(page_mingw_browse_label)" 361 ${NSD_CreateDirRequest} 40 140 290 24 "$MinGWDir" 362 Pop $Control2 363 ${NSD_CreateButton} 340 140 70 24 "$(page_mingw_browse_button)" 364 Pop $Control3 365 ${NSD_CreateLabel} 10 190 430 28 "$(page_mingw_outro)" 366 367 ${NSD_OnClick} $Control1 RunMinGWSetup 368 ${NSD_OnChange} $Control2 ValidateMinGWDir 369 ${NSD_OnClick} $Control3 BrowseMinGWDir 370 371 Call ValidateMinGWDir 372 nsDialogs::Show 373 FunctionEnd 374 375 Function RunMinGWSetup 376 SetOutPath "${TemporaryFilesDir}" 377 File "${FileSource}\prereqs\${MinGWInst}" 378 ExecWait '"${TemporaryFilesDir}\${MinGWInst}"' 379 StrCpy $MinGWInst "1" 380 Call ValidateMinGWDir 381 FunctionEnd 382 383 Function BrowseMinGWDir 384 nsDialogs::SelectFolderDialog "$(page_mingw_browse_dialog_title)" $MinGWDir 385 Pop $0 386 StrCmp $0 "error" 0 +2 387 Return 388 ${NSD_SetText} $Control2 $0 389 Call ValidateMinGWDir 390 FunctionEnd 391 392 Function ValidateMinGWDir 393 ${NSD_GetText} $Control2 $MinGWDir 394 IfFileExists "$MinGWDir\bin\gcc.exe" ok 395 396 EnableWindow $Control0 0 397 Return 398 ok: 399 EnableWindow $Control0 1 400 401 #Add the MingW\bin path to the envorinment variables 402 #${EnvVarUpdate} $0 "PATH" "A" "HKCU" "$MinGWDir\bin" 403 FunctionEnd 143 404 144 405 Section -uninst_registry … … 161 422 WriteRegDWORD HKLM "SOFTWARE\${ProductName}" "PythonInstalled" $PythonInst 162 423 WriteRegStr HKLM "SOFTWARE\${ProductName}" "PythonDir" $PythonDir 163 WriteRegDWORD HKLM "SOFTWARE\${ProductName}" "ScientificPythonInstalled" ""164 WriteRegDWORD HKLM "SOFTWARE\${ProductName}" "Num ericPythonInstalled" ""165 WriteRegDWORD HKLM "SOFTWARE\${ProductName}" "MatplotlibInstalled" ""166 WriteRegDWORD HKLM "SOFTWARE\${ProductName}" "MinGWInstalled" "$MinGWInst"424 WriteRegDWORD HKLM "SOFTWARE\${ProductName}" "ScientificPythonInstalled" $ScientificPythonInst 425 WriteRegDWORD HKLM "SOFTWARE\${ProductName}" "NumpyInstalled" $NumpyInst 426 WriteRegDWORD HKLM "SOFTWARE\${ProductName}" "MatplotlibInstalled" $MatplotlibInst 427 WriteRegDWORD HKLM "SOFTWARE\${ProductName}" "MinGWInstalled" $MinGWInst 167 428 WriteRegStr HKLM "SOFTWARE\${ProductName}" "MinGWDir" "$MinGWDir" 168 429 WriteRegStr HKLM "SOFTWARE\${ProductName}" "NetCDFDir" "$NetCDFDir" 169 430 SectionEnd 170 171 172 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN173 !insertmacro MUI_DESCRIPTION_TEXT ${sec_ncdf} $(description_netcdf)174 !insertmacro MUI_DESCRIPTION_TEXT ${sec_install} $(description_anuga_install)175 !insertmacro MUI_DESCRIPTION_TEXT ${sec_test} $(description_anuga_test)176 !insertmacro MUI_DESCRIPTION_TEXT ${sec_validate} $(description_anuga_validate)177 !insertmacro MUI_DESCRIPTION_TEXT ${sec_viewer} $(description_anuga_viewer)178 !insertmacro MUI_DESCRIPTION_TEXT ${sec_ext} $(description_anuga_viewer_extension)179 !insertmacro MUI_FUNCTION_DESCRIPTION_END180 181 # function executed on initialization of the installer182 Function .onInit183 # prevent the installer from beeing executed twice a time184 System::Call "kernel32::CreateMutexA(i 0, i 0, t '$(^Name)') i .n ?e" # create a mutex185 Pop $0186 StrCmp $0 0 0 find187 Return # launch normaly if mutex could be created = no other instance running188 189 find:190 StrLen $0 "$(^Name)"191 IntOp $0 $0 + 1192 loop:193 FindWindow $1 '#32770' '' 0 $1 # search the installers window if another instance is already running194 IntCmp $1 0 +4195 System::Call /NOUNLOAD "user32.dll::GetWindowText(i r1, t .r2, i r0) i.n"196 StrCmp $2 "$(^Name)" 0 loop # check back for correct window text197 System::Call "user32::SetForegroundWindow(i r1) i.n" # bring it to front if found198 Abort # then exit199 FunctionEnd200 201 202 Function .onGUIEnd203 RMDir /r "${TemporaryFilesDir}"204 FunctionEnd205 206 207 Function EnterPython208 # installbutton and directory selection209 !insertmacro MUI_HEADER_TEXT "$(page_python_title)" "$(page_python_subtitle)"210 nsDialogs::Create 1018211 Pop $Dialog212 StrCmp $Dialog "error" 0 +2213 Abort214 GetDlgItem $Control0 $HWNDPARENT 1215 216 # get python directory217 ReadRegStr $PythonDir HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe" ""218 StrLen $0 $PythonDir219 IntOp $0 $0 - 10220 StrCpy $PythonDir $PythonDir $0221 222 # select default, if possible from registry223 IfFileExists "$PythonDir\python.exe" +2224 StrCpy $PythonDir "C:\Python25"225 226 # create dialog items227 ${NSD_CreateLabel} 10 10 430 28 "$(page_python_install_label)"228 ${NSD_CreateButton} 40 50 370 24 "$(page_python_install_button)"229 Pop $Control1230 ${NSD_CreateLabel} 10 100 430 28 "$(page_python_browse_label)"231 ${NSD_CreateDirRequest} 40 140 290 24 "$PythonDir"232 Pop $Control2233 ${NSD_CreateButton} 340 140 70 24 "$(page_python_browse_button)"234 Pop $Control3235 ${NSD_CreateLabel} 10 190 430 28 "$(page_python_outro)"236 237 # register dialog actions238 ${NSD_OnClick} $Control1 RunPythonSetup239 ${NSD_OnChange} $Control2 ValidatePythonDir240 ${NSD_OnClick} $Control3 BrowsePythonDir241 242 # check for valid python directory243 Call ValidatePythonDir244 245 # show the page246 nsDialogs::Show247 FunctionEnd248 249 # extract and run the python installer250 Function RunPythonSetup251 SetOutPath "${TemporaryFilesDir}"252 File "${FileSource}\prereqs\${PythonInst}"253 ExecShell "" '"${TemporaryFilesDir}\${PythonInst}"'254 StrCpy $PythonInst "1"255 EnableWindow $Control0 1 # enable next button256 FunctionEnd257 258 # browse for the python dir with a folder dialog259 Function BrowsePythonDir260 nsDialogs::SelectFolderDialog "$(page_python_browse_dialog_title)" $PythonDir261 Pop $0262 StrCmp $0 "error" 0 +2263 Return264 ${NSD_SetText} $Control2 $0265 Call ValidatePythonDir266 FunctionEnd267 268 # enable next button if selected python dir is valid269 Function ValidatePythonDir270 ${NSD_GetText} $Control2 $PythonDir271 IfFileExists "$PythonDir\python.exe" ok272 273 EnableWindow $Control0 0274 Return275 ok:276 EnableWindow $Control0 1277 FunctionEnd278 279 280 Function EnterExtensions281 # installbuttons for missing extensions282 !insertmacro MUI_HEADER_TEXT "$(page_extensions_title)" "$(page_extensions_subtitle)"283 nsDialogs::Create 1018284 Pop $Dialog285 StrCmp $Dialog "error" 0 +2286 Abort287 GetDlgItem $Control0 $HWNDPARENT 1288 289 ${NSD_CreateLabel} 10 10 430 28 "$(page_extensions_intro)"290 ${NSD_CreateLabel} 40 50 350 28 "$(page_extensions_numpy_ok)"291 Pop $Control1292 ${NSD_CreateLabel} 40 100 350 28 "$(page_extensions_scientific_ok)"293 Pop $Control2294 ${NSD_CreateLabel} 40 150 350 28 "$(page_extensions_matplotlib_ok)"295 Pop $Control3296 ${NSD_CreateLabel} 10 190 430 28 "$(page_extensions_outro_next)"297 Pop $Control4298 299 StrCpy $1 "0"300 StrCpy $2 "0"301 StrCpy $3 "0"302 StrCpy $4 "0"303 StrCpy $5 "0"304 IfFileExists "$PackagesDir\Numpy\*.py" 0 +2305 IntOp $1 $1 + 1306 IfFileExists "$PackagesDir\Scientific\*.py" 0 +2307 IntOp $2 $2 + 1308 IfFileExists "$PackagesDir\matplotlib\*.py" 0 +2309 IntOp $3 $3 + 1310 IntOp $4 $2 + $1311 IntOp $5 $4 + $3312 313 IntCmp $1 0 0 num_ok num_ok314 ${NSD_SetText} $Control1 "$(page_extensions_numpy_label_install)"315 num_ok:316 317 IntCmp $2 0 0 scien_ok scien_ok318 ${NSD_SetText} $Control2 "$(page_extensions_scientific_label_install)"319 scien_ok:320 321 IntCmp $3 0 0 matp_ok matp_ok322 ${NSD_SetText} $Control3 "$(page_extensions_matplotlib_label_install)"323 matp_ok:324 325 IntCmp $5 3 no_inst326 ${NSD_SetText} $Control4 "$(page_extensions_outro_install)"327 ${NSD_SetText} $Control0 "$(^InstallBtn)"328 no_inst:329 330 nsDialogs::Show331 FunctionEnd332 333 Function LeaveExtensions334 IntCmp $5 0 +2335 Return336 337 SetOutPath "${TemporaryFilesDir}"338 339 IntCmp $1 1 after_num340 File "${FileSource}\prereqs\${NumpyInst}"341 ExecWait '"${TemporaryFilesDir}\${NumpyInst}"'342 after_num:343 344 StrCmp $2 1 after_scien345 File "${FileSource}\prereqs\${ScientificInst}"346 ExecWait '"${TemporaryFilesDir}\${ScientificInst}"'347 after_scien:348 349 StrCmp $3 1 after_matp350 File "${FileSource}\prereqs\${MatplotlibInst}"351 ExecWait '"${TemporaryFilesDir}\${MatplotlibInst}"'352 after_matp:353 354 FunctionEnd355 356 357 Function EnterMinGW358 # installbutton and directory selection359 !insertmacro MUI_HEADER_TEXT "$(page_mingw_title)" "$(page_mingw_subtitle)"360 nsDialogs::Create 1018361 Pop $Dialog362 StrCmp $Dialog "error" 0 +2363 Abort364 GetDlgItem $Control0 $HWNDPARENT 1365 366 ReadRegStr $MinGWDir HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MinGW" "InstallLocation"367 IfFileExists "$MinGWDir\bin\gcc.exe" +2368 StrCpy $MinGWDir "C:\MinGW"369 370 ${NSD_CreateLabel} 10 10 430 28 "$(page_mingw_install_label)"371 ${NSD_CreateButton} 40 50 370 24 "$(page_mingw_install_button)"372 Pop $Control1373 ${NSD_CreateLabel} 10 100 430 28 "$(page_mingw_browse_label)"374 ${NSD_CreateDirRequest} 40 140 290 24 "$MinGWDir"375 Pop $Control2376 ${NSD_CreateButton} 340 140 70 24 "$(page_mingw_browse_button)"377 Pop $Control3378 ${NSD_CreateLabel} 10 190 430 28 "$(page_mingw_outro)"379 380 ${NSD_OnClick} $Control1 RunMinGWSetup381 ${NSD_OnChange} $Control2 ValidateMinGWDir382 ${NSD_OnClick} $Control3 BrowseMinGWDir383 384 Call ValidateMinGWDir385 nsDialogs::Show386 FunctionEnd387 388 Function RunMinGWSetup389 SetOutPath "${TemporaryFilesDir}"390 File "${FileSource}\prereqs\${MinGWInst}"391 ExecWait '"${TemporaryFilesDir}\${MinGWInst}"'392 StrCpy $MinGWInst "1"393 Call ValidateMinGWDir394 FunctionEnd395 396 Function BrowseMinGWDir397 nsDialogs::SelectFolderDialog "$(page_mingw_browse_dialog_title)" $MinGWDir398 Pop $0399 StrCmp $0 "error" 0 +2400 Return401 ${NSD_SetText} $Control2 $0402 Call ValidateMinGWDir403 FunctionEnd404 405 Function ValidateMinGWDir406 ${NSD_GetText} $Control2 $MinGWDir407 IfFileExists "$MinGWDir\bin\gcc.exe" ok408 409 EnableWindow $Control0 0410 Return411 ok:412 EnableWindow $Control0 1413 414 #Add the MingW\bin path to the envorinment variables415 ${EnvVarUpdate} $0 "PATH" "A" "HKCU" "$MinGWDir\bin"416 FunctionEnd417 431 418 432 … … 420 434 Section "un.install" 421 435 #Remove the MingW\bin path from the envorinment variables 436 ReadRegStr $PythonDir HKEY_LOCAL_MACHINE "SOFTWARE\${ProductName}" "PythonDir" 437 ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$PythonDir" 438 ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$PythonDir\DLLs" 439 ReadRegStr $NetCDFDir HKEY_LOCAL_MACHINE "SOFTWARE\${ProductName}" "NetCDFDir" 440 ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$NetCDFDir" 422 441 ReadRegStr $MinGWDir HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MinGW" "InstallLocation" 423 ${un.EnvVarUpdate} $0 "PATH" "R" "HK CU" "$MinGWDir\bin"442 ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$MinGWDir\bin" 424 443 425 444 ReadRegStr $INSTDIR HKLM "SOFTWARE\${ProductName}" "PythonDir"
Note: See TracChangeset
for help on using the changeset viewer.