Howto: Deploy VC2008 apps without installing vcredist_x86.exe

本文涉及的产品
云数据库 Redis 版,社区版 2GB
推荐场景:
搭建游戏排行榜
简介: 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.

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/

相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
11月前
|
Python
解决loaded more than 1 DLL from .libs和No metadata found in lib\site-packages两个错误
解决loaded more than 1 DLL from .libs和No metadata found in lib\site-packages两个错误
290 0
|
Ruby Perl
pod警告/Users/Codeliu/.rvm/gems/ruby-2.5.0/gems/cocoapods-1.4.0/lib/cocoapods/executable.rb:89:
pod警告/Users/Codeliu/.rvm/gems/ruby-2.5.0/gems/cocoapods-1.4.0/lib/cocoapods/executable.rb:89:
66 0
|
Python
【解决方案】解决CMake must be installed to build the following extensions: pyltp
【解决方案】解决CMake must be installed to build the following extensions: pyltp
139 0
|
虚拟化 Docker Windows
成功解决VirtualBox is not installed. Please re-run the Toolbox Installer and try again.
成功解决VirtualBox is not installed. Please re-run the Toolbox Installer and try again.
成功解决VirtualBox is not installed. Please re-run the Toolbox Installer and try again.
|
Android开发
Eclipse workplace local storage
Eclipse workplace local storage
Eclipse workplace local storage
|
JavaScript Java
"\Tools\QtCreator\bin\clangbackend.exe" could not be started
"\Tools\QtCreator\bin\clangbackend.exe" could not be started
353 0
|
关系型数据库 Java 应用服务中间件
Database Visualization using Metabase Part 1 - Install Metabase on Ubuntu 16.04
In this tutorial, we will install Metabase on an Alibaba Cloud ECS Ubuntu 16.04 server to achieve data visualization.
1880 0
Database Visualization using Metabase Part 1 - Install Metabase on Ubuntu 16.04
|
C语言
Qt Creator新安装后运行一个程序后,出现错误:Error while building/deploying project dict-qt (kit: Desktop Qt 5.10.0 MinGW 32bit) When executing step "qmake"
1、环境介绍:在windows10 Pro下,当前Qt Creator版本,如下图所示: 2、问题描述:当用Qt Creator新建一个工程后,按Ctrl + R 构建/部署时,出现问题,问题截图如下: 3、解决方案:这是由于Qt Creator打开的工程文件夹的绝对路径中存在中文字符,只需将工...
5652 0