在Visual Studio 6中创建的MFC项目的安装程序

问题描述:

我在Visual Studio 6中创建了一个C ++项目,该项目使用MFC(Microsoft基础类).如何为我的项目创建安装程序/安装程序?谢谢.

I have a C++ project created in Visual Studio 6, the project uses MFC (Microsoft Foundation Classes). How do I create a installer/setup for my project? Thank you.

使用安装程序创建者,例如Advanced Installer.您只需要确保(如果没有将所需的MFC代码动态链接到exe中),就可以分发MFC dll并将其放置在正确的位置.

就成为优秀的C ++而言,VC6简直是垃圾,为什么您仍在使用它?
With an installer creator, like Advanced Installer. You just need to make sure, if you didn''t dynamically link the MFC code you need into your exe, that you distribute the MFC dlls and put them in the right place.

VC6 was rubbish, in terms of being good C++, why are you still using it ?


一个非常好的免费安装程序是 Inno Setup .您可以在 http://www.jrsoftware.org/isinfo.php [
A very good free installer is Inno Setup. You can download it at http://www.jrsoftware.org/isinfo.php[^]

As Christian Graus already wrote, you should keep attention to the dependencies of your project, like ATL, MFC and the Microsoft Visual C/C++ runtime DLLs. As the Visual Studio 6 doesn''t create binaries that use the manifest mechanism, you can redistribute the required DLLs in two ways:


  • 作为共享库,即将它们安装在 System32 文件夹中(在 Inno Setup 上,您应该记住设置 shared 标志,以便操作系统为每个文件保留一个参考计数器)

  • as shared libraries, i.e. installing them in the System32 folder (on Inno Setup you should remember to set the shared flag for that files, so that the operating system will hold a reference counter for each of them)
    • 作为私有库,即将它们安装在项目所有可执行文件所在的文件夹中
    • as private libraries, i.e. installing them in the same folder where all the executables of your project are located



    请注意,将运行时库安装为共享程序集可能会产生问题(尝试在 Google 上搜索 DLL地狱)和 Microsoft 强烈建议将它们安装为私有库.



    Note that installing the runtime libraries as shared assemblies could create problems (try searching DLL hell on Google), and Microsoft strongly recommend to install them as private libraries.