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.
Howto: Deploy VC2008 apps without installing vcredist_x86.exe的更多相关文章
- 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 ...
 - 【转载】inno setup 水波纹效果,检测安装vcredist_x86.exe等
		
以下inno setup脚本,实现了:1.水波纹效果 2.安装时检测是否安装其他版本,并在欢迎页面添加文字提示 4.检测安装vcredist_x86.exe 3.卸载时添加提示 ; 脚本由 Inno ...
 - vcredist_x86.exe 静默安装方法
		
我们打包基于VC++开发的应用程序,我们会一同打包一个VC运行库,否则安装到一些非开发环境中,你的应用程序依然可以正确运行. Visual C++ 2008 Redistributable Packa ...
 - vcredist_x64.exe vcredist_x86.exe 静默安装方法收集
		
vcredist_x64.exe /install /quiet /norestart 更多方法参考如下: http://www.cnblogs.com/lidabo/archive/2013/01/ ...
 - VCRedist_x86.exe Vcredist_x64.exe
		
Update for Visual C++ 2013 and Visual C++ Redistributable Package https://support.microsoft.com/en-u ...
 - 部署vc2008开发的程序(vcredist_x86是其中一个办法)
		
如果你编译了一个VC2008的默认的CRT/MFC的应用程序,如果目标部署电脑上没有安装相应的VC2008的动态库,当运行你的程序的时 个,会出现如下错误信息. 这是因为程序使用了基于VC2008 ...
 - vc2008程序发布指南
		
vc2008程序发布指南 2008-05-03 17:46 vc2008开发的程序的发布方式可以有5种方式: 1. 采用静态链接到crt和MFC. 只要你拥有组成程序的所有源代码,你就可以采用这种方式 ...
 - VCRedist.exe静默安装方法(转)
		
INNO setup 制作安装包 的时候,发布VC++运行时 [Run]Filename: {app}vcredist_x86.exe; Parameters: /q; WorkingDir: {t ...
 - 部署vc2008开发的程序(三种办法,但是我觉得这种办法最不好)
		
如果你编译了一个VC2008的默认的CRT/MFC的应用程序,如果目标部署电脑上没有安装相应的VC2008的动态库,当运行你的程序的时 个,会出现如下错误信息. 这是因为程序使用了基于VC2008 ...
 
随机推荐
- jQuery概述,代码举例及最新版下载
			
jQuery是一个快速的,小巧的,具有强大功能的JavaScript库. 它的基本功能包括: 1)访问和操作DOM元素 2)控制页面样式(可以兼容各种浏览器) 3)对页面事件的处理 4)大量插件在页面 ...
 - compress 表设置及索引设置
			
-- 查看表大小 from user_segments where segment_name='TableName'; -- 查看表大小 size_m -- 2000.6796875 2211.695 ...
 - Linux msgsnd : invalid argument
			
msgsnd(message id, buffer, sizeof buffer, ...); Important: buffer[0]不能为0!!!
 - JavaScript之数组对象
			
Array类型是ECMAScript中最常用的类型了. 一.声明方式 1.使用Array构造函数 var arr1 = new Array(); 如果预先知道要保存数组的数量, 也可以给构造函数传递该 ...
 - undrop for innodb c_parser 不完美之处
			
今天发现c_parser导出数据是会丢掉某些行,给过调试发现是他处理utf8编码时计算有误,目前还没有发现自动解决总是的方法,只会手动改代码来解决. 下一步计划把c_parser移植到windows下 ...
 - Access数据库一种树形结构的实现和子节点查询
			
BOOL CManageDataBase::GetDepTreeAllSons( int rootItem ) { CADORecordset Rst(&m_DataBase); BOOL b ...
 - d3 之deal with data
			
之前说慢慢写有关D3的笔记,结果做完那个拓扑图就没写了,今天发现关于d3的用法有点遗忘.感觉有回顾一遍的必要. 之前的序对D3有一个简单的介绍,下面就做一些细节的东西.主要是贴代码,顺带注释和效果图. ...
 - div嵌套引起的margin-top不起作用(转)
			
嵌套div中margin-top转移问题的解决办法在这两个浏览器中,有两个嵌套关系的div,如果外层div的父元素padding值为0,那么内层div的margin-top或者margin-botto ...
 - C# Json数据反序列化为Dictionary并根据关键字获取指定值
			
Json数据: { "dataSet": { "header": { "returnCode": "0", " ...
 - AngularJS(6)-选择框Select
			
1.在 AngularJS 中我们可以使用 ng-option 指令来创建一个下拉列表,列表项通过对象和数组循环输出 <!DOCTYPE html> <html lang=" ...