如何发布VC2005/VC2008编译的程序
2009-12-17 20:56
330 查看
Author: 徐艺波 From: xuyibo.org Updated: 2009-06-29
mainfest.rar 1.0.0
用VC2005/VC2008编译出来的程序,如果拷贝到没有安装相应VC的机器上,很多时候会运行出错:
,一般最和谐的解决办法是静态链接C运行库、MFC库,如果逼不得已非得动态链接的话,这篇文章就讲这个的。
示例
请看上面下载中manifest.rar中例子
首先你需要做的就是修改tst.exe.manfiest为你自己主程序名称,比如你的主程序叫hello.exe,那么就是hello.exe.manifest,其模板见下面一节。
然后根据需要删除不需要的,一般来说如果你没有链接MFC,那么就删除Microsoft.VC90.MFC所在的dependency,有兴趣的还可以写个小程序来自动生成合适的manifest文件。
最后就是拷贝需要的Microsoft.VC90.MFC这些目录到发布包中,你可以在X:/Program Files/Microsoft Visual Studio 9.0/VC/redist中找到你需要的这些文件。注意,你要保证xxx.exe.manifest中的version和Microsoft.VC90.MFC中的文件版本号一致,否则程序还是会启动出错的。
xxx.exe.manifest
参考
How to: Deploy using a Setup and Deployment Project
Troubleshooting C/C++ Isolated Applications and Side-by-side Assemblies
Redistributing Visual C++ Files
相关文章
mainfest.rar 1.0.0
用VC2005/VC2008编译出来的程序,如果拷贝到没有安装相应VC的机器上,很多时候会运行出错:
The application failed to initialize properly (0xc0000135). This application has failed to start because the application configuration is incorrect. Reinstalling application may fix this problem. The system cannot execute the specified program.
,一般最和谐的解决办法是静态链接C运行库、MFC库,如果逼不得已非得动态链接的话,这篇文章就讲这个的。
示例
请看上面下载中manifest.rar中例子
首先你需要做的就是修改tst.exe.manfiest为你自己主程序名称,比如你的主程序叫hello.exe,那么就是hello.exe.manifest,其模板见下面一节。
然后根据需要删除不需要的,一般来说如果你没有链接MFC,那么就删除Microsoft.VC90.MFC所在的dependency,有兴趣的还可以写个小程序来自动生成合适的manifest文件。
最后就是拷贝需要的Microsoft.VC90.MFC这些目录到发布包中,你可以在X:/Program Files/Microsoft Visual Studio 9.0/VC/redist中找到你需要的这些文件。注意,你要保证xxx.exe.manifest中的version和Microsoft.VC90.MFC中的文件版本号一致,否则程序还是会启动出错的。
xxx.exe.manifest
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <!-- 如果程序需要链接C运行库,请包含这个,一般都是需要的 --> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.1" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity> </dependentAssembly> </dependency> <!-- 如果程序需要链接MFC,请包含这个,如果不需要请删除,否则程序启动出错 --> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC90.MFC" version="9.0.30729.1" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity> </dependentAssembly> </dependency> <!-- 如果程序运行时需要XP风格的界面,请包含这个 --> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity> </dependentAssembly> </dependency> </assembly>
参考
How to: Deploy using a Setup and Deployment Project
Troubleshooting C/C++ Isolated Applications and Side-by-side Assemblies
Redistributing Visual C++ Files
相关文章
相关文章推荐
- 如何发布VC2005/VC2008编译的程序
- 如何发布VC2005/VC2008编译的程序
- 如何将Access程序打包(编译)成EXE文件用以发布?(转自access911.net)
- asp.net2.0 如何发布(编译)程序,生成dll
- QT 5.2.1如何编译发布IOS程序
- 如何自己编译Qt,为静态编译程序减少依赖方便发布做准备
- 如何使用XCode4编译和发布iPhone程序
- 关于VS2008 SP1开发环境下如何发布程序的问题
- easerver如何发布web程序
- iPhone应用提交流程:如何将App程序发布到App Store
- Android,程序反编译后的打包发布
- Android如何防止apk程序被反编译
- vs2008编译的程序如何在未安装vs的电脑上运行
- Android如何防止apk程序被反编译
- Android如何防止apk程序被反编译
- iOS-如何联机调试和发布程序(99$)
- C#如何为winform程序打包发布应用(图解)
- 使用ConfuserEx加密混淆程序以及如何脱壳反编译
- Qt开发:windows下发布动态编译程序
- GCC-C程序是如何编译成的