阅读:2749回复:0
vc 2008 程序分发
环境:Visual C++ 2008 英文版 加上Visual C++ 2008 Feature Pack
使用向导创建的VisualStudio2005的界面 Debug和Release在本地都可以运行 但是只要复制到别的电脑上就提示"由于应用程序配置不正确,应用程序未能启动...." 编译条件: Use MFC in a Shared DLL(共享库) Multi-threaded Debug DLL (/MDd) 通过查看*.exe.intermediate.manifest 文件内容如下 <?xml version='1.0' encoding='UTF-8' standalone='yes'?> <assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level='asInvoker' uiAccess='false' /> </requestedPrivileges> </security> </trustInfo> <dependency> <dependentAssembly> <assemblyIdentity type='win32' name='Microsoft.VC90.DebugCRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' /> </dependentAssembly> </dependency> <dependency> <dependentAssembly> <assemblyIdentity type='win32' name='Microsoft.VC90.DebugMFC' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' /> </dependentAssembly> </dependency> <dependency> <dependentAssembly> <assemblyIdentity type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*' /> </dependentAssembly> </dependency> </assembly> 解决方案1: 将文件设置为静态链接库,则没有问题,但是绑定静态库未免太大,并且不论是你的exe还是dll都要静态....无故增加大小 解决方案2: 采用VisualStuido自带的"安装部署"来做安装程序,但是生成的文件起码要加上13M,并且如果不会用这个玩意(我这人觉得InnoSetup比这个好用多了),哪安装的时候很多功能都不会实现了 解决方案3: 经过我使用Total Uninstall对上述"安装部署"生成msi的东西进行监控,和数次的实验,发现只要依下面的做就可以了,也不需要在程序根目录打包dll 只要将 C:\Windows\WinSiS下的如下文件复制到目标电脑的C:\Windows\WinSiS目录即可... ├─Manifests │ x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30411.0_x-ww_71382c73.cat │ x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30411.0_x-ww_71382c73.manifest │ x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30411.0_x-ww_421e9f78.cat │ x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30411.0_x-ww_421e9f78.manifest │ ├─Policies │ ├─x86_policy.9.0.Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_x-ww_b7353f75 │ │ 9.0.30411.0.cat │ │ 9.0.30411.0.policy │ │ │ └─x86_policy.9.0.Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_x-ww_4ee8bb30 │ 9.0.30411.0.cat │ 9.0.30411.0.policy │ ├─x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30411.0_x-ww_71382c73 │ msvcm90.dll │ msvcp90.dll │ msvcr90.dll │ └─x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30411.0_x-ww_421e9f78 mfc90.dll 文章出处:http://www.diybl.com/course/3_program/vc/vc_js/200874/130063.html |
|
|