[vtkusers] VTK, MSVS and Quicktime

John Drescher drescherjm at gmail.com
Tue Mar 1 08:57:34 EST 2011


> According to the person, installing the MSVC distributables alone wasn't
> sufficient.  But now that you mention it, I seem to recall that they require
> a special installation, i.e. it isn't necessarily enough to have them in the
> same directory as the executable.
>
> I'm sure I've done this before, it's the kind of info that just seems to
> slip away :-(
>
I used to try to just copy the microsoft dlls to the application
folder but now it appears that it is much better to just run the
appropriate redistributable executable during the install with nsis to
properly install the redistributables in the  system. This way the
winsxs folder gets populated and also proper registry entries get
inserted.

Here is what I have for this in my latest project:

IF(CMAKE_CL_64)
     SET(CMAKE_MSVC_ARCH amd64)
   ELSE(CMAKE_CL_64)
     SET(CMAKE_MSVC_ARCH x86)
ENDIF(CMAKE_CL_64)

IF(MSVC80)
    FIND_PROGRAM(MSVC_REDIST NAMES
vcredist_${CMAKE_MSVC_ARCH}/vcredist_${CMAKE_MSVC_ARCH}.exe
      PATHS
      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../SDK/v2.0/BootStrapper/Packages/"
      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../SDK/v2.0/BootStrapper/Packages/"
      )
    GET_FILENAME_COMPONENT(vcredist_name "${MSVC_REDIST}" NAME)
    INSTALL(PROGRAMS ${MSVC_REDIST} COMPONENT Runtime DESTINATION bin)
    SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait
'\\\"$INSTDIR\\\\bin\\\\${vcredist_name}\\\"'")
ENDIF(MSVC80)

IF(MSVC90)
    FIND_PROGRAM(MSVC_REDIST NAMES
vcredist_${CMAKE_MSVC_ARCH}/vcredist_${CMAKE_MSVC_ARCH}.exe
      PATHS
	  "$ENV{ProgramW6432}/Microsoft SDKs/Windows/v6.0A/Bootstrapper/Packages/"
	  "$ENV{PROGRAMFILES}/Microsoft SDKs/Windows/v6.0A/Bootstrapper/Packages/"
      )
    GET_FILENAME_COMPONENT(vcredist_name "${MSVC_REDIST}" NAME)
    INSTALL(PROGRAMS ${MSVC_REDIST} COMPONENT Runtime DESTINATION bin)
    SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait
'\\\"$INSTDIR\\\\bin\\\\${vcredist_name}\\\"'")
ENDIF(MSVC90)


John



More information about the vtkusers mailing list