From d64209a869dd9fc252f847014d544a6407f9fa47 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 14 Mar 2018 13:25:06 +0100 Subject: [PATCH] fixes #0002516: Microsoft Visual C++ 2013 is included in the setup package --- .../FreeCAD_WindowsInstaller.nsi | 27 ++++++++++++++----- .../FreeCAD_x64_WindowsInstaller.nsi | 19 ++++++++----- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/WindowsInstaller/FreeCAD_WindowsInstaller.nsi b/src/WindowsInstaller/FreeCAD_WindowsInstaller.nsi index 605528b41f..6de0e75ed2 100644 --- a/src/WindowsInstaller/FreeCAD_WindowsInstaller.nsi +++ b/src/WindowsInstaller/FreeCAD_WindowsInstaller.nsi @@ -70,6 +70,7 @@ ${EndIf} function .onInit setShellVarContext all !insertmacro VerifyUserIsAdmin + Call unSelectInstallOptions functionEnd section "install" @@ -82,13 +83,10 @@ section "install" setOutPath $INSTDIR\doc file /r "..\..\doc\" setOutPath $INSTDIR\data - file /r /X CMakeFiles /X *.cmake /X *.dir /X *.vcproj /X CMakeLists.txt /X *.am "..\..\data\" + file /r /X CMakeFiles /X *.cmake /X *.dir /X *.vcproj /X CMakeLists.txt /X *.am "..\..\data\" setOutPath $INSTDIR - file "vcredist_x86.exe" + file "vcredist_x86.exe" - # Install the Visual Studio redistributable - ExecWait '"$INSTDIR\vcredist_x86.exe" /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /i vcredist.msi /qb!"" "' - # Uninstaller - See function un.onInit and section "uninstall" for configuration writeUninstaller "$INSTDIR\uninstall.exe" @@ -117,7 +115,24 @@ section "install" # Set PYTHONPATH for FreeCAD #WriteRegStr HKLM "Software\Python\PythonCore\2.7\PythonPath\${FULLNAME}" "" "$INSTDIR\bin" sectionEnd - + +section "Install redistributable" VCRedistSection + # Install the Visual Studio redistributable + ExecWait '"$INSTDIR\vcredist_x86.exe" /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /i vcredist.msi /qb!"" "' +sectionEnd + +# http://forums.winamp.com/showthread.php?t=255747 +function unSelectInstallOptions + !insertmacro UnselectSection ${VCRedistSection} +functionEnd + +LangString DESC_VCRedistSection ${LANG_ENGLISH} "Install the Visual Studio redistributable." + +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${VCRedistSection} $(DESC_VCRedistSection) +!insertmacro MUI_FUNCTION_DESCRIPTION_END + + # Uninstaller function un.onInit diff --git a/src/WindowsInstaller/FreeCAD_x64_WindowsInstaller.nsi b/src/WindowsInstaller/FreeCAD_x64_WindowsInstaller.nsi index 940dc607a6..c33eb52fbd 100644 --- a/src/WindowsInstaller/FreeCAD_x64_WindowsInstaller.nsi +++ b/src/WindowsInstaller/FreeCAD_x64_WindowsInstaller.nsi @@ -81,7 +81,7 @@ ${EndIf} function .onInit setShellVarContext all !insertmacro VerifyUserIsAdmin - Call unSelectPythonPath + Call unSelectInstallOptions functionEnd section "FreeCAD (Required)" @@ -97,12 +97,9 @@ section "FreeCAD (Required)" setOutPath $INSTDIR\doc file /r "..\..\doc\" setOutPath $INSTDIR\data - file /r /X CMakeFiles /X *.cmake /X *.dir /X *.vcproj /X CMakeLists.txt /X *.am "..\..\data\" + file /r /X CMakeFiles /X *.cmake /X *.dir /X *.vcproj /X CMakeLists.txt /X *.am "..\..\data\" setOutPath $INSTDIR - file "vcredist_x64.exe" - - # Install the Visual Studio redistributable - ExecWait '"$INSTDIR\vcredist_x64.exe" /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /i vcredist.msi /qb!"" "' + file "vcredist_x64.exe" # Uninstaller - See function un.onInit and section "uninstall" for configuration WriteUninstaller "$INSTDIR\Uninstall.exe" @@ -140,16 +137,24 @@ section "Add to PYTHONPATH" PythonPathSection WriteRegStr HKLM "Software\Python\PythonCore\2.7\PythonPath\${FULLNAME}" "" "$INSTDIR\bin" sectionEnd +section "Install redistributable" VCRedistSection + # Install the Visual Studio redistributable + ExecWait '"$INSTDIR\vcredist_x64.exe" /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /i vcredist.msi /qb!"" "' +sectionEnd + # http://forums.winamp.com/showthread.php?t=255747 -function unSelectPythonPath +function unSelectInstallOptions # Deselect the PYTHONPATH option !insertmacro UnselectSection ${PythonPathSection} + !insertmacro UnselectSection ${VCRedistSection} functionEnd LangString DESC_PythonPathSection ${LANG_ENGLISH} "Add the FreeCAD installation directory to PYTHONPATH in the registry." +LangString DESC_VCRedistSection ${LANG_ENGLISH} "Install the Visual Studio redistributable." !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${PythonPathSection} $(DESC_PythonPathSection) + !insertmacro MUI_DESCRIPTION_TEXT ${VCRedistSection} $(DESC_VCRedistSection) !insertmacro MUI_FUNCTION_DESCRIPTION_END