2009-09-18 188 views
0

1)哪種方法是檢測是否在使用NSIS安裝程序的系統中安裝vs2005運行時的最佳方法?NSIS:檢測是否安裝了VS2005運行時

2)如果運行時沒有檢測到這是libraries-

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

感謝

回答

2
;------------------------------- 
; 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 

當然,你需要運行嵌入式安裝,不將文件複製到增加運行時間的最佳方式你自己。針對您的VC運行時版本確認註冊表項7299052b-02a4-4627-81f2-1818da5d550d

+0

Thanks.It工作+1 – Ranjith 2009-09-18 08:54:47

+0

歡迎您更好;) – 2009-09-18 12:35:01

+0

而如果CRT出貨作爲操作系統的一部分,沒有卸載條目? – Anders 2009-09-19 23:16:50

1

前一段時間,我創造了一些sample code,檢查程序集緩存,它可能不僅僅是檢查一個卸載項