简体   繁体   English

如何创建安装程序文件

[英]how to create installer file

I am currectly finishing my project in C++ and i'm looking for a way to create my own C++ installer file which will create the project dll's and exe files into a specific path 我目前正在用C ++完成我的项目,我正在寻找一种方法来创建我自己的C ++安装程序文件,该文件将创建项目dll和exe文件到特定路径

what is the easier way to learn how to do it? 什么是学习如何做的更简单的方法?

There are several ways to build an installer. 有几种方法可以构建安装程序。 While you can of course always make one yourself, you should google for something like "create an installer". 虽然您当然可以自己制作一个,但您应该谷歌搜索“创建安装程序”之类的东西。 Some prebuilt solutions include "InstallShield", or the ".msi" file format, which you can create on your own using something like "Advanced Installer". 一些预构建的解决方案包括“InstallShield”或“.msi”文件格式,您可以使用“Advanced Installer”之类的东西自行创建。

Of course, if you want your users to build your project from source, then you need a makefile and to make sure you bundle all the libraries. 当然,如果您希望用户从源代码构建项目,那么您需要一个makefile并确保捆绑所有库。 There are also kits like autotools to do that for you. 还有像autotools这样的套件可以帮到你。

If you use VS 2010, Installshield LE would suffice as it is integrated into VS 2010. If you have access to Installshield IDE, there is nothing better available for your packaging needs. 如果您使用VS 2010,则Installshield LE就足够了,因为它已集成到VS 2010中。如果您可以访问Installshield IDE,则没有更好的可用于您的打包需求。

There are two ways of packaging: 有两种包装方式:

a) The LEGACY way

b) The Windows Installer way, Basic MSI is the keyword here.

The LEGACY way involves creating your own scripts for: LEGACY方法涉及创建自己的脚本:

a) Installing the files to their locations

b) Writing registry entries, if needed

c) Registering COM components, if needed

d) Creating shortcuts etc...

Tools that can be used for LEGACY approach are: 可用于LEGACY方法的工具有:

a) NSIS - very good and has a scripting language of its own.

b) Installshield - has a project type called Installscript Project. Installscript is the scripting language to be used.

The Windows Installer way is a bit hard comapred to the LEGACY way. Windows Installer的方式有点难以与LEGACY方式相结合。 One has to learn the basics of MSI technology which can be daunting. 人们必须学习MSI技术的基础知识,这可能是令人生畏的。 The package created has .msi as extension. 创建的包具有.msi作为扩展名。 This file is a database that the developer configures and the Windows Installer takes care of all other things. 此文件是开发人员配置的数据库,Windows Installer负责所有其他事情。 This is called TRANSACTIONAL installation procedure. 这称为TRANSACTIONAL安装程序。 Even the UI presented during install is configured in the Database using tables like Dialog, Controls etc... 甚至安装期间显示的UI也是使用Dialog,Controls等表格在数据库中配置的......

Tools that can be used for Windows Installer approach are: 可用于Windows Installer方法的工具是:

a) Installshield - has a project type called Basic MSI
b) Wix - Opensource and xml based. You configure appropriately named xml files and various utilities in the Wix package will help you to create an MSI package.

First after completing your project click save. 首先完成项目后,单击“保存”。 Second click on file tab,Add,New Project. 再次单击文件选项卡,添加,新建项目。

In new Project Click other Project types , Setup and Deployment and in that You can click InstallShield LE or Visual Studio Installer. 在新项目中单击其他项目类型,设置和部署,然后单击InstallShield LE或Visual Studio Installer。

Hope this Helped you 希望这能帮到你

I always recommend NSIS . 我总是推荐NSIS You might also investigate HM Nis Edit - it's an IDE for NSIS that has a useful wizard feature. 您也可以调查HM Nis Edit - 它是NSIS的IDE,具有有用的向导功能。 It will generate an installer script for you which you can further customize. 它将为您生成一个安装程序脚本,您可以进一步自定义该脚本。 The documentation is extensive. 文档很广泛。

can't believe no one mentioned install creator pro(there is also a free version with a branded message that displays after installing). 不敢相信没有人提到安装创建者专业版(还有一个免费版本,安装后会显示一条品牌消息)。 Its feature set is pretty limited, though it has options for writing registry values and specifying custom paths to %AppData% or any other place you may want to install some files. 它的功能集非常有限,但它具有编写注册表值和指定%AppData%或您可能想要安装某些文件的任何其他位置的自定义路径的选项。 it also has an optional wizard interface, and with each step you have the oppurtunity to preview each individual page. 它还有一个可选的向导界面,每一步都有机会预览每个页面。

the paid version offers the option for adding serial number/registration to your program. 付费版本提供了为程序添加序列号/注册的选项。 i've never tried it so i'm not sure how effective it may be. 我从来没有尝试过,所以我不确定它有多么有效。 its also quite and expensive little program, but i would recommend it atleast to the beginner or someone who is more concerned with maintaining the codebase of their program and less concerned with how fancy and decorated their installer program is. 它也是相当昂贵的小程序,但我会推荐它至少对初学者或更关心维护程序代码库的人,而不是关心他们的安装程序是多么花哨和装饰。

i know its been a long time since this was posted but for future reference this program is far easier for any beginner to creating installation packages for the first time 我知道它已经发布了很长时间但是为了将来参考这个程序对于任何初学者来说都是第一次创建安装包更容易

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM