Browse Source

Update installer to support 64-bit

pull/90/head
Adam Johnson 7 years ago
parent
commit
faaff8f882
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 77
      installer/Installer.nsi
  2. 11
      installer/README.md

77
installer/Installer.nsi

@ -46,6 +46,13 @@ VIProductVersion "0.0.0.0"
Var BlenderDir Var BlenderDir
Var BlenderVer Var BlenderVer
;;;;;;;;;;;;;;;;;
; Install Types ;
;;;;;;;;;;;;;;;;;
InstType "Korman (32-bits)"
InstType "Korman (64-bits)"
InstType /NOCUSTOM
;;;;;;;;;;;;; ;;;;;;;;;;;;;
; Functions ; ; Functions ;
;;;;;;;;;;;;; ;;;;;;;;;;;;;
@ -67,18 +74,32 @@ FunctionEnd
; Checks the install dir... ; Checks the install dir...
Function .onVerifyInstDir Function .onVerifyInstDir
IfFileExists "$INSTDIR\..\blender.exe" verify_python ; Test for valid Blender
Abort IfFileExists "$INSTDIR\..\blender.exe" 0 fail
IfFileExists "$INSTDIR\..\${PYTHON_DLL}" 0 fail
; Try to guess if we're x64--it doesn't have BlendThumb.dll
IfFileExists "$INSTDIR\..\BlendThumb64.dll" 0 done
IfFileExists "$INSTDIR\..\BlendThumb.dll" blender_x86 blender_x64
verify_python: fail:
IfFileExists "$INSTDIR\..\${PYTHON_DLL}" done
Abort Abort
blender_x86:
SetCurInstType 0
Goto done
blender_x64:
SetCurInstType 1
Goto done
done: done:
FunctionEnd FunctionEnd
; Tries to find the Blender directory in the registry. ; Tries to find the Blender directory in the registry.
Function FindBlenderDir Function FindBlenderDir
; To prevent overwriting user data, we will only do this once
StrCmp $BlenderDir "" 0 done
; Try to grab the Blender directory from the default registry... ; Try to grab the Blender directory from the default registry...
ReadRegStr $BlenderDir HKLM "Software\BlenderFoundation" "Install_Dir" ReadRegStr $BlenderDir HKLM "Software\BlenderFoundation" "Install_Dir"
ReadRegStr $BlenderVer HKLM "Software\BlenderFoundation" "ShortVersion" ReadRegStr $BlenderVer HKLM "Software\BlenderFoundation" "ShortVersion"
@ -121,6 +142,7 @@ FunctionEnd
!insertmacro MUI_PAGE_LICENSE "GPLv3.txt" !insertmacro MUI_PAGE_LICENSE "GPLv3.txt"
!define MUI_PAGE_CUSTOMFUNCTION_PRE FindBlenderDir !define MUI_PAGE_CUSTOMFUNCTION_PRE FindBlenderDir
!insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH !insertmacro MUI_PAGE_FINISH
@ -136,25 +158,47 @@ FunctionEnd
;;;;;;;;;;;; ;;;;;;;;;;;;
; Sections ; ; Sections ;
;;;;;;;;;;;; ;;;;;;;;;;;;
Section "Runtimes" Section "Visual C++ Runtime"
SectionIn 1 2 RO
SetOutPath "$TEMP\Korman" SetOutPath "$TEMP\Korman"
File "Files\vcredist_x86.exe" File "Files\x86\vcredist_x86.exe"
ExecWait "$TEMP\Korman\vcredist_x86.exe /q /norestart" ExecWait "$TEMP\Korman\vcredist_x86.exe /q /norestart"
${If} ${RunningX64}
File "Files\x64\vcredist_x64.exe"
ExecWait "$TEMP\Korman\vcredist_x64.exe /q /norestart"
${EndIf}
RMdir "$TEMP\Korman" RMdir "$TEMP\Korman"
SectionEnd SectionEnd
Section "Files" SectionGroup /e "Korman"
; The entire Korman Section "Python Addon"
SetOutPath "$INSTDIR\scripts\addons" SectionIn 1 2 RO
File /r /x "__pycache__" /x "*.pyc" /x "*.komodo*" "..\korman"
SetOutPath "$INSTDIR\scripts\addons"
File /r /x "__pycache__" /x "*.pyc" /x "*.komodo*" /x ".vs" "..\korman"
SectionEnd
Section "x86 Libraries"
SectionIn 1 RO
SetOutPath "$INSTDIR\python\lib\site-packages"
File "Files\x86\HSPlasma.dll"
File "Files\x86\PyHSPlasma.pyd"
File "Files\x86\_korlib.pyd"
SectionEnd
Section "x64 Libraries"
SectionIn 2 RO
; Libraries SetOutPath "$INSTDIR\python\lib\site-packages"
SetOutPath "$INSTDIR\python\lib\site-packages" File "Files\x64\HSPlasma.dll"
File "Files\HSPlasma.dll" File "Files\x64\PyHSPlasma.pyd"
File "Files\PyHSPlasma.pyd" File "Files\x64\_korlib.pyd"
File "Files\NxCooking.dll" SectionEnd
File "Files\_korlib.pyd" SectionGroupEnd
Section #TheRemover
WriteRegStr HKLM "Software\Korman" "" $INSTDIR WriteRegStr HKLM "Software\Korman" "" $INSTDIR
WriteUninstaller "$INSTDIR\korman_uninstall.exe" WriteUninstaller "$INSTDIR\korman_uninstall.exe"
SectionEnd SectionEnd
@ -164,6 +208,7 @@ Section "Uninstall"
RMDir /r "$INSTDIR\scripts\addons\korman" RMDir /r "$INSTDIR\scripts\addons\korman"
Delete "$INSTDIR\python\lib\site-packages\HSPlasma.dll" Delete "$INSTDIR\python\lib\site-packages\HSPlasma.dll"
Delete "$INSTDIR\python\lib\site-packages\PyHSPlasma.pyd" Delete "$INSTDIR\python\lib\site-packages\PyHSPlasma.pyd"
; Leaving the NxCooking reference in for posterity
Delete "$INSTDIR\python\lib\site-packages\NxCooking.dll" Delete "$INSTDIR\python\lib\site-packages\NxCooking.dll"
Delete "$INSTDIR\python\lib\site-packages\_korlib.pyd" Delete "$INSTDIR\python\lib\site-packages\_korlib.pyd"
DeleteRegKey /ifempty HKLM "Software\Korman" DeleteRegKey /ifempty HKLM "Software\Korman"

11
installer/README.md

@ -1,14 +1,13 @@
## Korman NSIS Installer ## Korman NSIS Installer
In order to facillitate usage by non-technical users, Korman has a NSIS installer. Currently, the In order to facillitate usage by non-technical users, Korman has a NSIS installer.
installer only supports 32-bit Blenders because of PhysX limitations when exporting to MOUL. 64-bit
installers should not be produced until the PhysX dependency is removed.
## Building the Installer ## Building the Installer
You are responsible for supplying the following items in the Files directory: You are responsible for supplying the following items in the *x86* and*x64* subdirectories
of the **Files** directory, as applicable:
- libHSPlasma libraries (**HSPlasma.dll** and **PyHSPlasma.pyd**) - libHSPlasma libraries (**HSPlasma.dll** and **PyHSPlasma.pyd**)
- Visual C++ Redistributable package (**vcredist_x86.exe**) - Visual C++ Redistributable package (**vcredist_x86.exe** or **vc_redist_x64.exe**)
- **NxCooking.dll** *(if applicable)* - Optionally, the C korlib (**\_korlib.pyd**)
Given that PyHSPlasma can only be used with ABI-compatible Python releases (generally minor version Given that PyHSPlasma can only be used with ABI-compatible Python releases (generally minor version
levels), it is recommended that you define the name of the Python DLL (**PYTHON_DLL**) you expect for levels), it is recommended that you define the name of the Python DLL (**PYTHON_DLL**) you expect for

Loading…
Cancel
Save