vs2008编译出来的程序不能运行或需要安装vcredist_x86.exe才能运行解决办法
2013-01-21 14:43
621 查看
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…
参考:http://blog.kalmbach-software.de/2008/05/03/howto-deploy-vc2008-apps-without-installing-vcredist_x86exe/
相关文章推荐
- vs2008编译出来的程序不能运行或需要安装vcredist_x86.exe才能运行解决办法
- vs2008编译出来的程序不能运行或需要安装vcredist_x86.exe才能运行解决办法
- VS2005与VS2008下编译的MPI程序运行出错的解决办法
- vs2012-vs2013编译出来的程序不能在xp上运行解决方法
- vs2012-vs2013编译出来的程序不能在xp上运行解决方法
- Mac提示您需要安装旧 Java SE 6 运行环境才能打开PHPStorm的解决办法
- VS2005编译的程序在XP系统下不能运行的解决办法
- 解决WIN7-64,VS2008编译的MFC程序在WIN7-32/XP上不能运行的问题
- 问题解决“Windows Installer 程序包有问题,此安装需要的程序不能运行。请与您的支持人员或程序包开发商联系”
- VS2008编写的程序在有些电脑上不能运行的解决办法。
- Mac提示您需要安装旧 Java SE 6 运行环境才能打开PHPStorm的解决办法
- 卸载时候出现: windows installer 程序有问题。此安装需要的dll不能运行 的一个解决方法
- VS2005编译的程序在XP系统下不能运行的解决办法
- VS2005编译的程序在XP系统下不能运行的解决办法
- vs2012-vs2013编译出来的程序不能在xp上运行解决方法
- 问题解决“Windows Installer 程序包有问题,此安装需要的程序不能运行。请与您的支持人员或程序包开发商联系
- VS2008 Debug模式下编译完程序运行时提示"没有找到MSVCR90D.dll..."的解决办法
- Mac提示您需要安装旧 Java SE 6 运行环境才能打开Syncro SVN的解决办法
- qt designer 编译出来了,运行却不能输入文字 原因及解决办法
- mac下需要安装旧 Java SE 6 才能打开程序解决办法