如何编写安装程序_为无安装程序编写安装程序

如何编写安装程序

如何编写安装程序

Many programs and utilities are distributed as portable applications which do not require you to install them. While this is a great option to have, there are a few reasons you might want to “install” these programs. For example, installed programs appear in the Programs and Features (Add/Remove Programs) list and they typically have entries in the Start Menu. A utility which both installs and builds installers for installer-less programs is NirSoft’s ZipInstaller.

许多程序和实用程序作为可移植应用程序分发,不需要您安装它们。 尽管这是一个不错的选择,但出于某些原因,您可能想要“安装”这些程序。 例如,已安装的程序出现在“程序和功能(添加/删除程序)”列表中,并且它们通常在“开始”菜单中具有条目。 NirSoft的ZipInstaller是一个为无安装程序安装和生成安装程序的实用程序。

从Zip文件安装程序 (Installing a Program from a Zip File)

A popular Windows utility for system administrators is Process Explorer which is distributed via an installer-less zip file. Using ZipInstaller, you can easily install this utility from the downloaded zip file.

对于系统管理员来说,流行的Windows实用程序是Process Explorer,它通过无需安装程序的zip文件分发。 使用ZipInstaller,您可以从下载的zip文件中轻松安装此实用程序。

image

Once you have selected the zip file to install, ZipInstaller reads information from the executable file and populates it in the installer.

选择要安装的zip文件后,ZipInstaller将从可执行文件中读取信息,并将其填充到安装程序中。

image

Before installing, you can customize the settings to your liking.

在安装之前,您可以根据自己的喜好自定义设置。

image
image

Once you have everything set, click Install and ZipInstaller takes care of the rest.

设置完所有内容后,单击“安装”,然后ZipInstaller负责其余的工作。

image
image

Once installed, you have all the benefits of a typical program installation. Start Menu entries are created for executable and help files.

安装后,您将拥有典型程序安装的所有好处。 为可执行文件和帮助文件创建了“开始菜单”条目。

image

Additionally, an entry is made available in the Programs and Features (Add/Remove Programs).

此外,在程序和功能(添加/删除程序)中提供了一个条目。

image

构建自己的安装程序 (Building Your Own Installer)

ZipInstaller allows you to easily create your own install packages. All you need is a zip file containing the files you want included and ZipInstaller will create a standalone EXE setup file.

ZipInstaller允许您轻松创建自己的安装软件包。 您只需要一个包含要包含的文件的zip文件,ZipInstaller就会创建一个独立的EXE安装文件。

In this example, we are going to create an installer for the Sysinternals Process Explorer and ZoomIt utilities. First the utilities are downloaded and placed into a single folder. Then we create a special text file named “~zipinst~.zic” which contains configuration settings for the installer.

在此示例中,我们将为Sysinternals Process Explorer和ZoomIt实用程序创建安装程序。 首先,将实用程序下载并放置在单个文件夹中。 然后,我们创建一个名为“〜zipinst〜.zic”的特殊文本文件,其中包含安装程序的配置设置。

For this example our ~zipinst~.zic file looks like this:

对于此示例,我们的〜zipinst〜.zic文件如下所示:

[install] ProductName=Sysinternals Utilities ProductVersion=1.0 CompanyName=Sysinternals Description=Process Explorer and ZoomIt utilities. InstallFolder=%zi.ProgramFiles%%zi.CompanyName%%zi.ProductName% StartMenuFolder=%zi.ProductName% StartMenuShortcut=1 AddUninstall=1 AddUninstallShortcut=0 InstallTo=1 NoUserInteraction=0 UninstallRegKey=Sysinternals NoExtraUninstallInfo=0 UninstallInDestFolder=0 NoSuccessMessage=0

[安装] ProductName = Sysinternals实用程序ProductVersion = 1.0 CompanyName = Sysinternals说明=进程浏览器和ZoomIt实用程序。 InstallFolder =%zi.ProgramFiles %% zi.CompanyName %% zi.ProductName%StartMenuFolder =%zi.ProductName%StartMenuShortcut = 1 AddUninstall = 1 AddUninstallShortcut = 0 InstallTo = 1 NoUserInteraction = 0 UninstallRegKey = Sysinternals NoExtraUninstallInfo = 0 UninstallInDestFolder = 0 NoSuccessMessage = 0

image

Then the following command creates the install file:

然后,以下命令创建安装文件:

X:PathToZipFile>”C:PathToZipInstallerzipinst.exe” /selfexe SysinternalsUtilities.zip SUI_Install.exe

X:PathToZipFile>“ C:PathToZipInstallerzipinst.exe” / selfexe SysinternalsUtilities.zip SUI_Install.exe

image

Once the installer is created, it can be run on any machine.

创建安装程序后,即可在任何计算机上运行该安装程序。

image

Note, the naming is a bit off when you try to combine multiple tools in a single install, but overall it works just as you would expect.

请注意,当您尝试在单个安装中组合多个工具时,命名有些偏离,但总体而言,它的工作与预期的一样。

image

结论 (Conclusion)

In addition to installing portable applications, ZipInstaller is fantastic tool to create an installer for any utility program – including your own. The interface is simple to use and it only takes a few minutes to learn. Additionally, there are more configuration options you can read about on the download page.

除了安装可移植的应用程序之外,ZipInstaller还是一款出色的工具,可以为任何实用程序(包括您自己的实用程序)创建安装程序。 该界面易于使用,只需几分钟即可学习。 此外,还有更多配置选项,您可以在下载页面上阅读。

链接 (Links)

Download ZipInstaller from NirSoft

从NirSoft下载ZipInstaller

翻译自: https://www.howtogeek.com/50329/build-an-installer-for-installer-less-programs/

如何编写安装程序

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值