简体   繁体   English

是否有小于 14 MB 的 Visual Studio 2015 C++ Redistributable (vcredist_x86.exe)?

[英]Are there smaller Visual Studio 2015 C++ Redistributable (vcredist_x86.exe) than 14 MB?

I have a Windows x86 32 bit desktop application built using Visual Studio 2015 written in C and C++ using the MFC framework for the User Interface. I have a Windows x86 32 bit desktop application built using Visual Studio 2015 written in C and C++ using the MFC framework for the User Interface. For the installer I am using NSIS compiler with an NSIS script to generate the installation.exe used to install the application which is composed of some 10 different components, .exes and.dlls that are created by the build.对于安装程序,我使用带有 NSIS 脚本的 NSIS 编译器来生成用于安装应用程序的 installation.exe,该应用程序由构建创建的大约 10 个不同的组件、.exe 和 .dll 组成。

My desktop application is a point of sale application that runs under 32 bit or 64 bit versions of POSReady 7 (Windows 7) as well as Windows 10 and Windows 10 IoT Enterprise (not Windows IoT Core) on Intel x86/x64 compatible CPUs. My desktop application is a point of sale application that runs under 32 bit or 64 bit versions of POSReady 7 (Windows 7) as well as Windows 10 and Windows 10 IoT Enterprise (not Windows IoT Core) on Intel x86/x64 compatible CPUs.

When I changed from Visual Studio 2005 to Visual Studio 2015, I was struck by the larger size of the installation executable, from a size of roughly 8 MB to a size of 16 MB.当我从 Visual Studio 2005 更改为 Visual Studio 2015 时,我对安装可执行文件的更大尺寸感到震惊,从大约 8 MB 的大小到 16 MB 的大小。 The size difference seems to be due to the Visual Studio 2015 C++ Redistributable that I am including in the desktop application installer.大小差异似乎是由于我包含在桌面应用程序安装程序中的 Visual Studio 2015 C++ Redistributable。

The NSIS script has the following lines: NSIS 脚本有以下几行:

# The location of the Visual Studio 2005 C++ Runtime Redistributable depends on the version of
# Windows being used to build the application. Beginning with Windows 7 there are now two different
# folder hierarchies for installed programs.
File "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\1033\vcredist_x86.exe"

ExecWait '"$INSTDIR\vcredist_x86.exe" /q:a /c:"msiexec /i vcredist.msi /qb!"'   #dialog with no cancel

When I compile the desktop application with Visual Studio 2015 and run the NSIS script with the File directive containing the vcredist_x86.exe commented out, the size of the resulting installer is 2,220 KB.当我使用 Visual Studio 2015 编译桌面应用程序并运行 NSIS 脚本时,包含注释掉的vcredist_x86.exeFile指令,生成的安装程序的大小为 2,220 KB。 When I uncomment the File directive containing the vcredist_x86.exe , the size of the resulting installer is 16,140 KB.当我取消注释包含vcredist_x86.exeFile指令时,生成的安装程序的大小为 16,140 KB。

Looking in the folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\1033 I see three different redistributables: vcredist_arm.exe size 2,639 KB, vcredist_x64.exe size 14,957 KB, and vcredist_x86.exe size 14,130 KB.查看文件夹C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\1033我看到三个不同的可再发行文件: vcredist_arm.exe大小 2,639 KB, vcredist_x64.exe大小 14,957 KB 和vcredist_x86.exe大小.

Is there a different Visual Studio 2015 redistributable that is smaller than 14 MB?是否有其他小于 14 MB 的 Visual Studio 2015 可再发行组件?

Or is there a different method I can use to provide vcredist_x86.exe where I do not need to include it within my application installer?或者我可以使用其他方法来提供vcredist_x86.exe ,而我不需要将它包含在我的应用程序安装程序中? A different method would need to be as automatic as the current solution which installs the application components then starts up the Visual Studio 2015 redistributable installer.一种不同的方法需要像当前解决方案一样自动安装应用程序组件,然后启动 Visual Studio 2015 可再发行安装程序。

Notes笔记

  1. This post has an answer of including specific Visual Studio DLLs into the components list for the installer.这篇文章的答案是将特定的 Visual Studio DLL 包含到安装程序的组件列表中。 How to avoid Visual C++ Redistributable LARGE file installing? 如何避免安装 Visual C++ Redistributable LARGE 文件?

    That would not seem to be a viable alternative due to copyright issues.由于版权问题,这似乎不是一个可行的选择。

  2. Here are links to Microsoft documentation Redistributing Visual C++ Files as well as Determining Which DLLS to Redistribute which includes an alternative of using merge modules as discussed in Redistributing Components By Using Merge Modules .以下是 Microsoft 文档的链接重新分发 Visual C++ 文件以及确定要重新分发的 DLLS,其中包括使用合并模块的替代方法,如通过使用合并模块重新分发组件中所述。 However the page on merge modules says:但是合并模块上的页面说:

    We recommend that you not use merge modules except when you don't have to service your application and you don't have dependencies on more than one version of the DLLs.我们建议您不要使用合并模块,除非您不必为您的应用程序提供服务并且您不依赖多个版本的 DLL。 Merge modules for different versions of the same DLL cannot be included in one installer, and merge modules make it difficult to service DLLs independently of your application.同一 DLL 的不同版本的合并模块不能包含在一个安装程序中,合并模块使独立于您的应用程序的 DLL 服务变得困难。 Instead, we recommend that you install a Visual C++ Redistributable Package.相反,我们建议您安装 Visual C++ Redistributable Package。

If I remember correctly, you may provide the required DLLs with your application rather than the installer.如果我没记错的话,您可能会在您的应用程序而不是安装程序中提供所需的 DLL。 Another option is to go for static linking.另一种选择是 go 用于 static 链接。

These approaches will result in a much smaller overall size, but the dependencies will never be updated for fixes unless you do so.这些方法将导致整体尺寸小得多,但除非您这样做,否则永远不会更新依赖项以进行修复。 This may be a deal breaker or not depending on the situation.这可能会破坏交易,也可能不取决于具体情况。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Api-ms-win-core-crt-l1-1-0.dll - Microsoft Visual C++ 2015 Redistributable(vc_redist.x64.exe 和 vcredist_x86.exe)无法安装 - Api-ms-win-core-crt-l1-1-0.dll - Microsoft Visual C++ 2015 Redistributable (vc_redist.x64.exe and vcredist_x86.exe) fails to install 为什么MSVS 2010 MFC项目依赖于vcredist_x86.exe for MSVS 2008? - Why does MSVS 2010 MFC project depend on vcredist_x86.exe for MSVS 2008? 将Visual Studio 2015的Visual C ++ Redistributable添加到InstallShield - Add Visual C++ Redistributable for Visual Studio 2015 to InstallShield Visual Studio 2015 的 C# 和 C++ Redistributable 缺少依赖项 - Missing dependencies with C# and C++ Redistributable for Visual Studio 2015 安装 Visual Studio 2015 时出错,关于“Microsoft Visual C++ 2015 Redistributable” - Errors in installing Visual Studio 2015, regarding "Microsoft Visual C++ 2015 Redistributable" 当我在一台机器上开发EXE并在另一台机器上运行它时,为什么安装vcredist_x86.exe不会修复SideBySide错误? - Why installing vcredist_x86.exe doesn't fix SideBySide error when I develop an EXE on one machine and run it on another one? 无法安装Visual Studio 2015(64位)的Visual C ++可再发行组件 - Cannot install Visual C++ Redistributable for Visual Studio 2015 (64-bit) 如何自动安装用于Java代码的Visual Studio 2015的Visual C ++可再发行组件 - how to automatically install Visual C++ Redistributable for Visual Studio 2015 used in a java code 我可以将 Visual Studio 2015 C++ Redistributable DLL 与我的应用程序捆绑在一起吗? - Can I bundle the Visual Studio 2015 C++ Redistributable DLL's with my application? Visual Studio 2015上的log10()性能比Visual Studio 2013 for x86慢很多 - log10() performance on Visual Studio 2015 a lot slower than Visual Studio 2013 for x86
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM