forked from bartvdbraak/blender
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
This commit is contained in:
parent
e85f145c19
commit
1b7cc5602f
@ -5,6 +5,8 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
!include "MUI.nsh"
|
!include "MUI.nsh"
|
||||||
|
!include "FileFunc.nsh"
|
||||||
|
!include "WordFunc.nsh"
|
||||||
|
|
||||||
Name "Blender VERSION"
|
Name "Blender VERSION"
|
||||||
|
|
||||||
@ -32,6 +34,9 @@ Page custom DataLocation
|
|||||||
!insertmacro MUI_UNPAGE_INSTFILES
|
!insertmacro MUI_UNPAGE_INSTFILES
|
||||||
!insertmacro MUI_UNPAGE_FINISH
|
!insertmacro MUI_UNPAGE_FINISH
|
||||||
|
|
||||||
|
!insertmacro Locate
|
||||||
|
!insertmacro VersionCompare
|
||||||
|
|
||||||
|
|
||||||
Icon "00.installer.ico"
|
Icon "00.installer.ico"
|
||||||
UninstallIcon "00.installer.ico"
|
UninstallIcon "00.installer.ico"
|
||||||
@ -153,8 +158,43 @@ Function GetWindowsVersion
|
|||||||
|
|
||||||
FunctionEnd
|
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 BLENDERHOME
|
||||||
Var winversion
|
Var winversion
|
||||||
|
Var DLL_found
|
||||||
|
|
||||||
Function SetWinXPPath
|
Function SetWinXPPath
|
||||||
StrCpy $BLENDERHOME "$PROFILE\Application Data\Blender Foundation\Blender"
|
StrCpy $BLENDERHOME "$PROFILE\Application Data\Blender Foundation\Blender"
|
||||||
@ -171,6 +211,37 @@ Function .onInit
|
|||||||
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "data.ini"
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "data.ini"
|
||||||
FunctionEnd
|
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 HWND
|
||||||
Var DLGITEM
|
Var DLGITEM
|
||||||
Var is2KXP
|
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" "DisplayName" "Blender (remove only)"
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
||||||
WriteUninstaller "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
|
SectionEnd
|
||||||
|
|
||||||
Section "Add Start Menu shortcuts" Section2
|
Section "Add Start Menu shortcuts" Section2
|
||||||
|
Loading…
Reference in New Issue
Block a user