InstallShield

最近开始入坑installShield,由于使用的免费的限制版本,一些“高科技”的用法,这里无从提及,本文就使用中常见的问题,作一个总结:
  1. Organize Your Setup
    1.1 General Info
    这里有需要填写的有:
    ProductName: 用来表示产品名,无特殊含义
    ProductVersion: 产品的版本号,如1.11,前面1表示大版本,后面的.11表示小版本
    Product Code: 产品码,用于标识一个唯一的产品
    Upgrade Code: 更新码,注意,这个和产品号不同。一般来说,我们使用下面的方法来设定上述字段:
Product VersionProduct CodeUpgrade Code
1.0{D73FFD24-6087-4D5A-82AB-1F6B1A680433}{A00700B1-2345-6789-ABCD-EF0123456789}
1.1{D73FFD24-6087-4D5A-82AB-1F6B1A680433}{A00700B1-2345-6789-ABCD-EF0123456789}
2.0{A1071CCE-11A1-11A2-B1A2-B3000D067A34}{A00700B1-2345-6789-ABCD-EF0123456789}

从1.0版本升级到1.1版本的话,只是小版本有更新,直接用补丁更新即可,这时候产品Code和升级Code都不用修改,
从1.1版本升级到2.0,由于改动的是大版本,我们有理由认为更新改动很大,这时候产品ID需要更改,如果不更改的话,安装的时候windows会提示你已经有相同的产品安装过了,至于为什么升级Code不变,因为要在原有的基础上进行升级,整个系列的更新码都必须保持一致。

你完全可以在2.0的基础上修改升级码,这样安装的时候windows会认为1.1和2.0就完全是两个不同的APP了。
接下来的几条不太重要:
INSTALLDIR:默认安装路径
DATABASEDIR:存放数据的路径
DEFAULTFONT: 安装过程中的默认字体
ALLUSERS:安装包针对哪些用户
Fast Install:快速安装,全部勾选上

1.2 Summary Info
主要是用于Window Installer database显示用,作用不太大,这里忽略

1.3 Add or Remove Programs
Icon: 用于设置在Window Installer上显示的图标
Disable Change/Remove/Repair Button: 是否禁用更换/卸载/修复 按钮
Publisher: 发布者
PublisherURL: 发布者网站

1.4 Upgrade Paths
此模块的设定对软件升级非常重要,右键点击Upgrade Paths,新建NewUpgradeEntry,选定之前旧的安装包(如果没有直接点击cancel)。查看右侧的属性进行设定,主要有:
UpgradeCode: 必须和之前版本的UpgradeCode保持一致
min version: 指定本次更新包需要针对的最小版本号,如1.0
include min: 是否包含最小版本号,
例如minversion设置为1.0, include min设定为yes表示从1.0开始的版本(包括1.0)需要执行此次更新
max version:指定本次更新包需要针对的最大版本号,如2.0
include: max: 是否包含最大版本号
Language Identifiers
Lang Search Criterion
以上两个选项进一步缩小升级包更新的范围。
Ignore Remove Failure:
忽略掉删除错误,设定为yes,表示如果在升级过程中,删除旧版本报错的话,会忽略掉,继续安装新版本,简单暴力,这里设定为yes
Migrate Feature States:
直接贴原文:
Specify whether you want the upgrade to attempt to migrate the feature-selection states from an installed product version to the newer version. When installing the previous version of your product, an end user may have selected to install certain features, and not install others. During the upgrade to a new version of your product, these original selections can be retained as the default selections by selecting Yes for the Migrate Feature States setting.

For example, if your original product contained Feature1, Feature2, and Feature3, and an end user installed only Feature1 and Feature3, by default Feature1 and Feature3 will be selected for installation when your upgraded setup is run. Feature2 will, by default, remain unselected.
一般设定它为yes

Update Notifications View
FlexNet Connect provides a mechanism that enables you to automatically notify your Web-connected end users when patches, updates, and product information for your application are ready for release. The Update Notifications view is where you enable automatic notification for your original installation.

Using FlexNet Connect is simple. When you enable FlexNet Connect, InstallShield includes the Software Manager in your installation. This desktop tool ships with your application and provides a tool for your users to view available updates. To publish updates to your users, you will use a Web-based management portal called the FlexNet Connect Publisher site.

FlexNet Connect includes a variety of options that can be purchased together for a complete solution, or separately for a customized solution. To learn more, visit the Flexera Software Web site.
由于我们的项目中没有用到FlexNet,而是自己实现了一个更新工具,所以这项忽略。

  1. Specify Application Data
    指定应用程序所需的文件,找到ProgramFilesFolder下面的游戏目录,然后将app需要的exe,dll等文件全部拖进来即可。

  2. Configure the target system
    3.1 Shortcuts/Folders
    指定桌面快捷方式、启动栏
    Taskbar->Start Menu->Programs Menu->Startup,这个用于设定是否将应用程序放入开始启动栏
    DeskTop这一项用于设定是否需要在桌面上生成应用程序的快捷方式。
    这两个选项,如果需要设定的话,右键指定的选项,新建快捷方式(New Shortcut),然后选择目标对应的exe文件即可,如笔者的应用程序放在
    ProgramFilesFolder\xx\app.exe目录下,那么按照路径选择这个文件即可。

    3.2 Registry
    设定注册表
    3.3 Ini File Changes
    设定ini配置文件
    3.4 Environment Variables
    设定环境变量
    3.x 略

  3. Customize the setup appearance
    这一项关系到安装程序的显示,以及安装过程中的界面友好性。
    打开Dialogs选项,一般选择
    Install Welcome, Destination Folder, Ready To Install, Setup Progress, Setup Complete Success。
    打开Text And Messages选项,可设定安装过程中的各种提示文字。

  4. Define setup requirements and actions
    5.1 Requirements
    定位此应用程序的前置安装包
    5.2 Custom Actions
    可以定义在安装过程中需要执行的action, action可以是一个EXE, vbscript,jscript
    这一项很有用,如果希望安装程序完成后,期望程序的根目录开放对所有用户(Everyone)的权限,就需要用到这一项。
    我们需要在安装成功后,执行一条命令,选择”After Setup Complete Success dialog”,
    右键,新建New EXE
    Source Location: 由于笔者所用的命令时系统自带的,这里选择File Exists on Target Computer
    File Location: 指定自带的exe所在目录,这里指定位[SystemFolder]
    FileName and Command Line:
    CMD /C “ECHO Y|CACLS “[INSTALLDIR]quick..” /T /G EVERYONE:F>NUL”
    一条命令,即可修改目录权限。

  5. Prepare for release
    在IS生成安装文件时,指定为SingleImage(在左侧树形目录中左键点击SingleImage),然后选中Setup.exe,如下图:

图1

可以看到
Required Execution Level选项,它用来指定运行安装程序时所需要的权限,如果此权限过低,可能导致
在5.2中定制的actions执行失败,5.2中执行actions的权限直接继承自“Required Execution Level”中设定的权限,这里一般设置成Administrator。

小结:
使用InstallShield限定版确实有些不方便的地方,比如为了修改安装后的目标文件的权限问题,笔者就花了不少时间来研究Custom Action;实际上,在非限定版中,可以直接在指定应用程序文件的时候就进行设定。另外,应用程序的补丁更新和安装也是一个问题。

有空将介绍一个自己编写的可自动更新的windows APP工具(结合IS来使用),包括补丁生成工具。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值