如何将VC ++ Redistributables(适用于VS 2013)打包到cab文件中?

时间:2014-12-16 15:29:09

标签: visual-c++ mfc activex

如何将VC ++ Redistributable运行时库(对于Visual Studio 2013可用here)打包到cab文件中,该文件只有在客户端计算机上需要时才会自动下载?

msdn给出的样品包装没有帮助,因为他们没有在相似的网址上提供mfc120.cab,就像他们在样本中对mfc42所做的那样。

作为一种解决方法(可行)我从vcredist_x86.exe创建了一个cab(vcredist_x86.cab),并且只有在任何相关的运行时库不可用时才调用它。但我相信可能有一种直接的做事方式,而不是走这种奇怪的方式。

这是inf(受msdn样本的启发):

[version]
    signature="$CHICAGO$"
    AdvancedINF=2.0

[Add.Code]
myModule.ocx=myModule.ocx
mfc120u.dll=mfc120u.dll
msvcr120.dll=msvcr120.dll
msvcp120.dll=msvcp120.dll

[myModule.ocx]
file-win32-x86=thiscab
clsid={C4B5FFD0-6DE6-D47E-A9B1-5CF1D3EE869C}
FileVersion=1.5.0.12
RegisterServer=yes

[mfc120u.dll]
    FileVersion=12,00,21005,1
    hook=mfc120installer

[msvcr120.dll]
    FileVersion=12,00,21005,1
    hook=mfc120installer

[msvcp120.dll]
    FileVersion=12,00,21005,1
    hook=mfc120installer

[mfc120installer]
    file-win32-x86=vcredist_x86.cab
    run=%EXTRACT_DIR%\vcredist_x86.exe \Q

知道正确的VS 2013特定版本的包装方式会很棒 - 与给出的样本类似。我不想在服务器上复制vcredist_x86.exe或dll,以便它在msdn示例中给出的工作正常。

0 个答案:

没有答案
相关问题