User Interface

In the previous lesson we have learned how to describe the files we want to be installed. Although we saw some simple implementations of automated installer logic to determine whether a given product has already been installed previously, everything went without the customary user interface giving the user a chance to say anything about the installation. So this is the topic we will be treating in this installment.

上一节中已经学到如何去描述我们想要安装的文件。虽然我们看到了一些使用自动安装逻辑的简单应用,它们决定即将安装的产品是否在此之前已经安装了,但是,并没有通过用户界面给用户一个机会参与到安装过程中。因此我们打算在本次主题的安装讲解中来解决这个问题。

The Windows Installer doesn't have its built-in user interface (except for a simple progress dialog we've already seen and a few message boxes popping up to inform the user about various errors). Installer packages have to define their own user interface, compile it and carry it around inside their own .msi file. This makes this file somewhat larger (an .msi file with a typical user interface will start just below 300KB, although this will also depend on the size of the icons and other graphical elements inside) but, in return to this size, will be perfectly customizable to every possible need.

Windows Installer 没有内置的UI(除了简单的进度对话框,提示用户的错误消息的消息弹出框)。因此,安装包必须自己指定并编译UI代码,最近随着.msi文件一起发布。这会使得安装包显得有些大(一个带有典型 UI 的 .msi 文件至少300KB,虽然这也依赖于图标和其他图片的大小),但,抛开大小不谈,你可以完美自定义每一种想要实现的需求。

It wouldn't be too much fun to start to develop a complete user interface for ourselves. Fortunately, there is no need to do that. The WiX toolset comes with a standard user interface library, WixUI. This user interface is based on the prefabricated interface in the MSI SDK. The WixUI library provides the complete user interface of a standard installer package, including all standard wizard pages: license agreement, customer information, typical/custom/complete setup types, customization of install target folder, calculation of disk usage requirements, modify/repair/remove and rollback. The only difference is that---for sake of individuality---its dominant color is reddish instead of bluish. However, it only takes to modify a couple of bitmaps and icons if you want to customize that.

目前我们自己并不能开发一个完整的UI,所幸的是,我们也没有必要这样做。WiX 自带有一个标准UI库——WixUI,它基于MSI SDK中预制的界面。WixUI 库提供了一个标准安装包所需的完整UI,包括所有标准向导页:许可页面、用户信息、典型/自定义/完整安装类型、指定安装目录、计算磁盘使用要求、修改/修复/移除/回滚。唯一不同就是,它的主题色是淡红色而不是蓝色。如果你想去自定义它,只能修改一些图片和图标。

Pages in this Chapter