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/

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

  1. Deployment of VC2008 apps without installing anything

    If you create a default CRT/MFC application with VS2008, this application will not run on other comp ...

  2. 【转载】inno setup 水波纹效果,检测安装vcredist_x86.exe等

    以下inno setup脚本,实现了:1.水波纹效果 2.安装时检测是否安装其他版本,并在欢迎页面添加文字提示 4.检测安装vcredist_x86.exe  3.卸载时添加提示 ; 脚本由 Inno ...

  3. vcredist_x86.exe 静默安装方法

    我们打包基于VC++开发的应用程序,我们会一同打包一个VC运行库,否则安装到一些非开发环境中,你的应用程序依然可以正确运行. Visual C++ 2008 Redistributable Packa ...

  4. vcredist_x64.exe vcredist_x86.exe 静默安装方法收集

    vcredist_x64.exe /install /quiet /norestart 更多方法参考如下: http://www.cnblogs.com/lidabo/archive/2013/01/ ...

  5. VCRedist_x86.exe Vcredist_x64.exe

    Update for Visual C++ 2013 and Visual C++ Redistributable Package https://support.microsoft.com/en-u ...

  6. 部署vc2008开发的程序(vcredist_x86是其中一个办法)

    如果你编译了一个VC2008的默认的CRT/MFC的应用程序,如果目标部署电脑上没有安装相应的VC2008的动态库,当运行你的程序的时 个,会出现如下错误信息.   这是因为程序使用了基于VC2008 ...

  7. vc2008程序发布指南

    vc2008程序发布指南 2008-05-03 17:46 vc2008开发的程序的发布方式可以有5种方式: 1. 采用静态链接到crt和MFC. 只要你拥有组成程序的所有源代码,你就可以采用这种方式 ...

  8. VCRedist.exe静默安装方法(转)

    INNO setup 制作安装包  的时候,发布VC++运行时 [Run]Filename: {app}vcredist_x86.exe; Parameters: /q; WorkingDir: {t ...

  9. 部署vc2008开发的程序(三种办法,但是我觉得这种办法最不好)

    如果你编译了一个VC2008的默认的CRT/MFC的应用程序,如果目标部署电脑上没有安装相应的VC2008的动态库,当运行你的程序的时 个,会出现如下错误信息.   这是因为程序使用了基于VC2008 ...

随机推荐

  1. javascript对象初读

    <script type="text/javascript"> function baseClass() { this.showMsg = function() { a ...

  2. IOS-UI-UIDynamic(一)

    UIDynamic是从iOS7开始引入的技术 属于UIkit框架 可以模拟显示生活中的物理现象 如碰撞 抖动 摆动等 一. 使用UIDynamic步骤: 1.创建一个动力效果器UIDynamicAni ...

  3. NodeJS缓存机制:畅销货,就多囤一点呗

    上一篇文章,我们已经实现了客户端向NodeJS服务器发出请求时,服务器从磁盘读取文件内容后,向客户端返回文件的数据.而对于爱莲(iLinkIT)的1对n的场景,即将文件共享出来之后,让多个用户同时下载 ...

  4. ajax — get? or post?

    ajax - get? or post? 与 POST 相比,GET 更简单也更快,并且在大部分情况下都能用. 然而,在以下情况中,请使用 POST 请求: 无法使用缓存文件(更新服务器上的文件或数据 ...

  5. axure注册码

    ahjesus Axure RP 7.0注册码 用户名:axureuser 序列号:8wFfIX7a8hHq6yAy6T8zCz5R0NBKeVxo9IKu+kgKh79FL6IyPD6lK7G6+t ...

  6. 如何在Android SDK 下查看应用程序输出日志的方法

          该文章源于安卓教程网(http://android.662p.com),转载时要注明文章的来自和地址,感谢你的支持. 在Android程序中可以使用 android.util.Log 类来 ...

  7. object-c实现的 在PHP中oauth加密算法

    说起这个算法,在php中我是这么实现的 function generateSig ($params, $secret = '') {     if (empty($secret)) {         ...

  8. 如何使用Git——(二)

    8.首次安装git,然后要把创建好的仓库放到github上,首先,你要先做一些基本设置,继续设置吧~~. 在git黑框框中输入  ssh-keygen -t rsa -C "your ema ...

  9. HTTP的长短连接、长短轮询的区别(转载)

    引言 最近刚到公司不到一个月,正处于熟悉项目和源码的阶段,因此最近经常会看一些源码.在研究一个项目的时候,源码里面用到了HTTP的长轮询.由于之前没太接触过,因此LZ便趁着这个机会,好好了解了一下HT ...

  10. discuz!X2.5技术文档

    discuz!系统常量: DISCUZ_ROOT //网站根目录 TIMESTAMP   //程序执行的时间戳 CHARSET     //程序的编码类型 FORMHASH    //HASH值 其余 ...