From faaff8f8822af94252359a1f9ade8c180acf61b0 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 27 Dec 2017 17:49:26 -0500 Subject: [PATCH] Update installer to support 64-bit --- installer/Installer.nsi | 77 ++++++++++++++++++++++++++++++++--------- installer/README.md | 11 +++--- 2 files changed, 66 insertions(+), 22 deletions(-) diff --git a/installer/Installer.nsi b/installer/Installer.nsi index 6d37201..2b342d1 100644 --- a/installer/Installer.nsi +++ b/installer/Installer.nsi @@ -46,6 +46,13 @@ VIProductVersion "0.0.0.0" Var BlenderDir Var BlenderVer +;;;;;;;;;;;;;;;;; +; Install Types ; +;;;;;;;;;;;;;;;;; +InstType "Korman (32-bits)" +InstType "Korman (64-bits)" +InstType /NOCUSTOM + ;;;;;;;;;;;;; ; Functions ; ;;;;;;;;;;;;; @@ -67,18 +74,32 @@ FunctionEnd ; Checks the install dir... Function .onVerifyInstDir - IfFileExists "$INSTDIR\..\blender.exe" verify_python - Abort + ; Test for valid Blender + 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: - IfFileExists "$INSTDIR\..\${PYTHON_DLL}" done + fail: Abort + blender_x86: + SetCurInstType 0 + Goto done + blender_x64: + SetCurInstType 1 + Goto done + done: FunctionEnd ; Tries to find the Blender directory in the registry. 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... ReadRegStr $BlenderDir HKLM "Software\BlenderFoundation" "Install_Dir" ReadRegStr $BlenderVer HKLM "Software\BlenderFoundation" "ShortVersion" @@ -121,6 +142,7 @@ FunctionEnd !insertmacro MUI_PAGE_LICENSE "GPLv3.txt" !define MUI_PAGE_CUSTOMFUNCTION_PRE FindBlenderDir !insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH @@ -136,25 +158,47 @@ FunctionEnd ;;;;;;;;;;;; ; Sections ; ;;;;;;;;;;;; -Section "Runtimes" +Section "Visual C++ Runtime" + SectionIn 1 2 RO + SetOutPath "$TEMP\Korman" - File "Files\vcredist_x86.exe" + File "Files\x86\vcredist_x86.exe" 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" SectionEnd -Section "Files" - ; The entire Korman - SetOutPath "$INSTDIR\scripts\addons" - File /r /x "__pycache__" /x "*.pyc" /x "*.komodo*" "..\korman" +SectionGroup /e "Korman" + Section "Python Addon" + SectionIn 1 2 RO + + 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" - File "Files\HSPlasma.dll" - File "Files\PyHSPlasma.pyd" - File "Files\NxCooking.dll" - File "Files\_korlib.pyd" + SetOutPath "$INSTDIR\python\lib\site-packages" + File "Files\x64\HSPlasma.dll" + File "Files\x64\PyHSPlasma.pyd" + File "Files\x64\_korlib.pyd" + SectionEnd +SectionGroupEnd +Section #TheRemover WriteRegStr HKLM "Software\Korman" "" $INSTDIR WriteUninstaller "$INSTDIR\korman_uninstall.exe" SectionEnd @@ -164,6 +208,7 @@ Section "Uninstall" RMDir /r "$INSTDIR\scripts\addons\korman" Delete "$INSTDIR\python\lib\site-packages\HSPlasma.dll" 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\_korlib.pyd" DeleteRegKey /ifempty HKLM "Software\Korman" diff --git a/installer/README.md b/installer/README.md index 6b93cba..b3de5ba 100644 --- a/installer/README.md +++ b/installer/README.md @@ -1,14 +1,13 @@ ## Korman NSIS Installer -In order to facillitate usage by non-technical users, Korman has a NSIS installer. Currently, the -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. +In order to facillitate usage by non-technical users, Korman has a NSIS 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**) -- Visual C++ Redistributable package (**vcredist_x86.exe**) -- **NxCooking.dll** *(if applicable)* +- Visual C++ Redistributable package (**vcredist_x86.exe** or **vc_redist_x64.exe**) +- Optionally, the C korlib (**\_korlib.pyd**) 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