1)的检测是否VS2005运行时使用NSIS安装安装在系统中的最佳方式?

2)如果未检测运行时,其是添加运行时库的最佳方式 -

     a)running an embedded vcredist or 
     b)copying dlls to the installation folder

由于

有帮助吗?

解决方案

;-------------------------------
; Test if Visual Studio Redistributables 2005+ SP1 installed
; Returns -1 if there is no VC redistributables intstalled
Function CheckVCRedist
   Push $R0
   ClearErrors
   ReadRegDword $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7299052b-02a4-4627-81f2-1818da5d550d}" "Version"

   ; if VS 2005+ redist SP1 not installed, install it
   IfErrors 0 VSRedistInstalled
   StrCpy $R0 "-1"

VSRedistInstalled:
   Exch $R0
FunctionEnd

当然,你需要运行嵌入式安装,而不是自己复制文件。确认注册表项7299052b-02a4-4627-81f2-1818da5d550d对你的VC运行库的版本。

其他提示

前一段时间,我创造了一些示例代码,检查程序集缓存,它可能比好只是检查一个卸载条目

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top