Browse Source

Install vcredist from windows installer

Tobias Hieta 9 years ago
parent
commit
3b4f3b7b3a

+ 0 - 21
CMakeModules/CPackConfiguration.cmake

@@ -45,27 +45,6 @@ include(CPack)
 
 cpack_add_component(Core DISPLAY_NAME "Plex Media Player" DESCRIPTION "Plex Media Player (Core Application)" REQUIRED)
 
-# borrowed from https://github.com/peersafe/PeerSafe/blob/master/cmake_modules/package.cmake
-if(WIN32)
-  string(REPLACE "." "" VCVER $ENV{VisualStudioVersion})
-  if(MSVC)
-    if(CMAKE_CL_64)
-      set(VC_RUNTIME_DIR "$ENV{VCInstallDir}/redist/x64/Microsoft.VC${VCVER}.CRT")
-    else()
-      set(VC_RUNTIME_DIR "$ENV{VCInstallDir}/redist/x86/Microsoft.VC${VCVER}.CRT")
-    endif()
-    find_file(MSVCP NAMES msvcp${VCVER}.dll PATHS ${VC_RUNTIME_DIR} NO_DEFAULT_PATH)
-    #find_file(MSVCR NAMES msvcr${VCVER}.dll PATHS ${VC_RUNTIME_DIR} NO_DEFAULT_PATH)
-    find_file(VCCORLIB NAMES vccorlib${VCVER}.dll PATHS ${VC_RUNTIME_DIR} NO_DEFAULT_PATH)
-    if(NOT MSVCP)
-      set(ERROR_MESSAGE "\nCould not find library msvcp${VCVER}.dll.\nRun cmake from a Visual Studio Command Prompt.")
-      message(FATAL_ERROR "${ERROR_MESSAGE}")
-    endif()
-  endif()
-
-  install(FILES ${MSVCP} ${VCCORLIB} DESTINATION .)
-endif()
-
 if(WIN32 AND DEFINED DEPENDENCY_ROOT)
   install(FILES ${CMAKE_SOURCE_DIR}/bundle/win/qt.conf DESTINATION .)
   #add_custom_command(TARGET package POST_BUILD COMMAND ${CMAKE_SOURCE_DIR}/scripts/WindowsSign.cmd  ${CPACK_PACKAGE_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}.exe WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )

+ 2 - 1
CMakeModules/CompleteBundleWin.cmake.in

@@ -12,6 +12,7 @@ get_filename_component(CEC_DIR @CEC_LIBRARY@ DIRECTORY)
 list(APPEND SEARCHDIRS ${CEC_DIR})
 
 fixup_bundle("${CMAKE_INSTALL_PREFIX}/PlexMediaPlayer.exe" "" "${SEARCHDIRS}") 
+#install(PROGRAMS ${VCREDIST_DIR}/vc_redist_2015_x64.exe DESTINATION .)
 
 if(@DO_SIGN@)
   file(GLOB_RECURSE EXES ${CMAKE_INSTALL_PREFIX}/*.exe ${CMAKE_INSTALL_PREFIX}/*.dll)
@@ -20,4 +21,4 @@ if(@DO_SIGN@)
     message("-- Signing: ${CMAKE_SOURCE_DIR}/scripts/WindowsSign.cmd ${e}")
     execute_process(COMMAND ${CMAKE_SOURCE_DIR}/scripts/WindowsSign.cmd "${e}" RESULT_VARIABLE RES)
   endforeach()
-endif()
+endif()

+ 1 - 9
CMakeModules/Win32Configuration.cmake

@@ -11,12 +11,4 @@ find_library(VERLIB version)
 find_library(DWMLIB dwmapi)
 set(OS_LIBS ${WINMM} ${IMMLIB} ${VERLIB} ${DWMLIB})
 
-# Add install rules for required system runtimes such as MSVCRxx.dll
-SET (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP ON)
-INCLUDE(InstallRequiredSystemLibraries)
-IF (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
-  INSTALL(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
-    DESTINATION ${INSTALL_BIN_DIR}
-    PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ
-    COMPONENT Runtime)
-ENDIF (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
+set(OS_LIBS ${WINMM} ${IMMLIB} ${VERLIB})

+ 2 - 0
bundle/win/shortcut.qs

@@ -69,5 +69,7 @@ Component.prototype.createOperations = function()
   if (systemInfo.productType === "windows") {
     component.addOperation("CreateShortcut", "@TargetDir@/PlexMediaPlayer.exe", "@StartMenuDir@/Plex Media Player.lnk");
     component.addOperation("CreateShortcut", "@TargetDir@/maintenancetool.exe", "@StartMenuDir@/Maintain Plex Media Player.lnk");
+    component.addOperation("Execute", "@TargetDir@/vcredist_x64.exe", "/q", "/norestart");
+    component.addOperation("Delete", "@TargetDir@/vcredist_x64.exe");
   }
 }