diff options
author | Simon Clitherow <aphex@nildram.co.uk> | 2007-05-06 20:43:50 +0400 |
---|---|---|
committer | Simon Clitherow <aphex@nildram.co.uk> | 2007-05-06 20:43:50 +0400 |
commit | 1b7cc5602f569d0c8bbbe60e33ed949e73be0d0d (patch) | |
tree | 2ea9f4d53bc27990eb0cf2a503e0f406dde004c1 /release/windows | |
parent | e85f145c19b8a59d7d9b12005865b06033fcb36d (diff) |
Added a check to installer for runtime dlls required to run blender. If
not found on their system, it will open a browser window to point them
at the download site.
DEV NOTES: Anyone building the NSIS installer will need the Moreinfo
plugin - http://nsis.sourceforge.net/MoreInfo_plug-in
Diffstat (limited to 'release/windows')
-rw-r--r-- | release/windows/installer/00.sconsblender.nsi | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/release/windows/installer/00.sconsblender.nsi b/release/windows/installer/00.sconsblender.nsi index 4e604f40a6e..cd68312e69f 100644 --- a/release/windows/installer/00.sconsblender.nsi +++ b/release/windows/installer/00.sconsblender.nsi @@ -5,6 +5,8 @@ ; !include "MUI.nsh" +!include "FileFunc.nsh" +!include "WordFunc.nsh" Name "Blender VERSION" @@ -32,6 +34,9 @@ Page custom DataLocation !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH +!insertmacro Locate +!insertmacro VersionCompare + Icon "00.installer.ico" UninstallIcon "00.installer.ico" @@ -153,8 +158,43 @@ Function GetWindowsVersion FunctionEnd +# Uses $0 +Function openLinkNewWindow + Push $3 + Push $2 + Push $1 + Push $0 + ReadRegStr $0 HKCR "http\shell\open\command" "" +# Get browser path + DetailPrint $0 + StrCpy $2 '"' + StrCpy $1 $0 1 + StrCmp $1 $2 +2 # if path is not enclosed in " look for space as final char + StrCpy $2 ' ' + StrCpy $3 1 + loop: + StrCpy $1 $0 1 $3 + DetailPrint $1 + StrCmp $1 $2 found + StrCmp $1 "" found + IntOp $3 $3 + 1 + Goto loop + + found: + StrCpy $1 $0 $3 + StrCmp $2 " " +2 + StrCpy $1 '$1"' + + Pop $0 + Exec '$1 $0' + Pop $1 + Pop $2 + Pop $3 +FunctionEnd + Var BLENDERHOME Var winversion +Var DLL_found Function SetWinXPPath StrCpy $BLENDERHOME "$PROFILE\Application Data\Blender Foundation\Blender" @@ -171,6 +211,37 @@ Function .onInit !insertmacro MUI_INSTALLOPTIONS_EXTRACT "data.ini" FunctionEnd +!define DLL_VER "8.00.50727.42" + +Function LocateCallback + + MoreInfo::GetProductVersion "$R9" + Pop $0 + + ${VersionCompare} "$0" "${DLL_VER}" $R1 + + StrCmp $R1 0 0 new + new: + StrCmp $R1 1 0 old + old: + StrCmp $R1 2 0 end + ; Found DLL is older + Call DownloadDLL + + end: + StrCpy "$0" StopLocate + StrCpy $DLL_found "true" + Push "$0" + +FunctionEnd + +Function DownloadDLL + MessageBox MB_OK "You will need to download the Microsoft Visual C++ 2005 Redistributable Package in order to run Blender. Pressing OK will take you to the download page, please follow the instructions on the page that appears." + StrCpy $0 "http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en" + Call openLinkNewWindow +FunctionEnd + + Var HWND Var DLGITEM Var is2KXP @@ -267,6 +338,15 @@ Section "Blender-VERSION (required)" SecCopyUI WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayName" "Blender (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteUninstaller "uninstall.exe" + + ; Check for msvcr80.dll - give notice to download if not found + MessageBox MB_OK "The installer will now check your system for the required system dlls." + StrCpy $1 $WINDIR + StrCpy $DLL_found "false" + ${Locate} "$1" "/L=F /M=MSVCR80.DLL /S=0B" "LocateCallback" + StrCmp $DLL_found "false" 0 +2 + Call DownloadDLL + SectionEnd Section "Add Start Menu shortcuts" Section2 |