Howto: Deploy VC2008 apps without installing vcredist_x86.exe

There are several reasons for xcopy deployment of an application (also known as application local). One main reason is that you are independent of what the target computer has installed.
Also your application always uses the “correct” (or better: tested) version of DLLs, regardless of what MS installed or updated (see: .NET2 SP1 update breaks old apps!?).

The easiest way to overcome the problem is to link static against the CRT/MFC. But in some scenarios this is not an option and not possible.

But to be independent from OS updates or from vcredist_x86.exe installations of other apps, you need to do the following steps:

  • Remove the auto-generation of manifests (from all DLLs) and change the manifest generation form your EXE to an external manifest; you can do this by choosing: Project|Properties|Configuration Properties|Manifest Tool|Input and Output|Embed Manifest: No
  • Recompile your application and modify the external manifest as follows:
  • Copy your application and the external manifest to your deployment directory
  • Open the manifest-file (appname.exe.manifest) and remove the “publicKeyToken” from all MFC/CRT/ATL/OpenMP entries. Please leave the publicKeyToken to the “Microsoft.Windows.Common-Controls” entry.
  • Copy all neccessary directories under %ProgramFiles%\Microsoft Visual Studio 9.0\VC\redist\x86 to your deployment directory
  • In all sub-directories (Microsoft.VC90.CRT, optional: Microsoft.VC90.MFC, Microsoft.VC90.ATL, Microsoft.VC90.OPENMP, Microsoft.VC90.MFCLOC) open the manifest-file and also remove the publicKeyToken
  • Also lookup the version info from these manifest files and correct the version-info of the corresponding entries in your application manifest file
  • Save all manifests and let your program run; it should now run on all supported OS without installing anything…

After doing all these manifest stuff you can also embed the manifest into your application (EXE). And of course: The same can be done with x64 and IA64 apps.

I have made an example of the default MFC app (4.6 MB) for reference.

The (simple) manifests for the new MFC feature pack and the application looks like:

Application.exe.manifest


Microsoft.VC90.CRT.manifest


Microsoft.VC90.MFC.manifest


Instead of putting the “Microsoft.VC90.MFC” and “Microsoft.VC90.CRT” directories into the application folder, you can also just put the files from these folders into the application directory. The main advantage is, that your app will also work on W2k-SP4.

Here is also my older post for VS2005.

 

 

from:http://blog.kalmbach-software.de/2008/05/03/howto-deploy-vc2008-apps-without-installing-vcredist_x86exe/

时间: 2024-09-13 00:49:57

Howto: Deploy VC2008 apps without installing vcredist_x86.exe的相关文章

vs2008编译出来的程序不能运行或需要安装vcredist_x86.exe才能运行解决办法

Howto: Deploy VC2008 apps without installing vcredist_x86.exe There are several reasons for xcopy deployment of an application (also known as application local). One main reason is that you are independent of what the target computer has installed.Al

Deploy Web Apps with High Availability, Fault Tolerance, and Load Balancing on Alibaba Cloud

By Ngoi Se Keng, Alibaba Cloud Tech Share Author 1. Introduction High Availability (HA), Fault Tolerance (FT), and Horizontal Scale Friendly (HSF) are as equally important as to functionality for web applications to run and succeed today. Existing or

vc2008程序发布指南

vc2008程序发布指南 2008-05-03 17:46 vc2008开发的程序的发布方式可以有5种方式: 1. 采用静态链接到crt和MFC. 只要你拥有组成程序的所有源代码,你就可以采用这种方式,   这种方式除了程序变大一点,好处多多:    1) 不必重新发布vc2008基础库vcredist_x86.exe(安装到WinSxS).   2) 不必产生,嵌入manifest.   3) 也不把vc2008基础库放在程序所在目录. 2. exe(嵌入manifest) + vcredis

vcredistx86.exe是什么

  vcredist_x86.exe是C++开发环境的一个支持插件,如果缺少了它,一些应用程序打开后就会出错,如打开binQQ.exe将提示应用程序出错.vcredist_x86.exe也是Windows系统文件夹中的重要文件,对于系统正常运行来说非常重要,通常在安装系统过程中会自动创建.所以一般正常情况下不要对这类文件进行随意修改为.因为它对计算机系统的稳定具有重要作用. vcredist_x86.exe无法安装解决办法: 1.右键点击我的电脑--管理--服务和应用程序--服务 2.找到Win

VCRedist.exe静默安装方法

我们打包基于VC++开发的应用程序,我们会一同打包一个VC运行库,否则安装到一些非开发环境中,你的应用程序依然可以正确运行. Visual C++ 2008 Redistributable Package 包括了(VCRedist_x86.exe,VCRedist_x64.exe以及VCRedist_ia64.exe).   就是一个简单的VCRedist.exe安装集成,结果下载了之后安装,安装完成后在系统或某个盘的根目录下留下一堆的临时文件: 临时文件列表 调查后发现,这是Microsoft

VS2008编译的程序在某些机器上运行提示“由于应用程序配置不正确,应用程序未能启动”的问题

  使用VS2008编译了一个程序,使用到自己编译的DLL,丢到某些机子上无法运行,提示"由于应用程序配置不正确,应用程序未能启动"的错误,装了vcredist_x86也没有用,开始以为是DLL的问题,后来换个简单的程序,仍然不行,百撕不得其解,后来上网找,下面有说了很多解决办法.         我最终的解决办法是复制本机中的.manifest文件,修改里面的版本号,复制到提示错误的机子上,与可执行程序放在同一目录就可以了.在计算机中管理的系统工具,事件查看器可以查看应用程序的消息,

VS2008生成的程序无法在其它电脑上运行,提示系统无法执行指定的程序

经过一番查找,最给力的参考是 http://www.cnblogs.com/visoeclipse/archive/2010/02/27/1674866.html -----------------------以下为转载-------------------------------------------------------------- 首先感谢这位几仁兄的几篇博客: http://hi.baidu.com/fairysky/blog/item/130dda13db7b050a5aaf53

Free Apache Tomcat Hosting in the Cloud for Java Applications? It's Called OpenShift!

原文:https://openshift.redhat.com/community/blogs/free-apache-tomcat-hosting-in-the-cloud-for-java-applications-its-called-openshift If you are a Java developer, you have probably struggled with finding a reliable host for your Tomcat based java projec

VS2008发布程序

下列附有VS2008发布程序介绍:vc2008程序发布指南2008-05-03 17:46vc2008开发的程序的发布方式可以有5种方式: 1. 采用静态链接到crt和MFC. 只要你拥有组成程序的所有源代码,你就可以采用这种方式,这种方式除了程序变大一点,好处多多: 1) 不必重新发布vc2008基础库vcredist_x86.exe(安装到WinSxS).2) 不必产生,嵌入manifest.3) 也不把vc2008基础库放在程序所在目录. 2. exe(嵌入manifest) + vcre