软件的安装技术

能够介绍一点我的经验,让大家少走弯路。

 

第一部分是基本原理介绍

 

第一章:什么是软件安装,我们为什么要适用这项技术

 

随着计算机技术的日益发展,操作系统越来越复杂,而软件也越来越多,越来越大。所以我们需要一种专门的技术,解决这些问题,在系统中合理的安排应用程序,让客户方便使用程序。这就是软件安装技术。当时市面上出现了各种各样的安装技术和工具,当时又后来呢大家发现有很多问题还是无法解决。比如版本的冲突,程序损毁以后的恢复

 

 

第二章:WINDOWS ISNTALLER介绍

 

也就是说从WIN2000开始,WINDOWS ISNTALLER是作为操作系统的一部分的。WIN2000以前的操作系统,对WIN98winNT等也微软也发布了可以使用的安装服务的包。现在WINDOWS ISNTALLER最新的版本是4.5XP最初发布的好像是2.0。我们可以从它更多的PROPERTY知道它的版本。

 

WINDOWS ISNTALLER也就是我们简称的MSI包。主要包括WINDOWS ISNTALLER数据库,相应的数据文件(一般要被压缩,比如说CAB文件)。MSI的数据库,是一个COM结构的存储构架,包含了超过80个表,现在版本更新,表也更多了。这些表能够很好的描述目标系统的变化。

 

第三章:几个重要的表和规则

1.       COMPONENT

组件是安装中非常重要的概念。组件是资源(文件,REGITRY KEY等等)的集合。它是在系统中能安装或移除的最小单位。组件只有唯一的一个CODEGUID

 

Component Table

The Component table lists components and it has the following columns.

Column

Type

Key

Nullable

Component

Identifier

Y

N

ComponentId

GUID

N

Y

Directory_

Identifier

N

N

Attributes

Integer

N

N

Condition

Condition

N

Y

KeyPath

Identifier

N

Y

Columns

Component

Identifies the component record.

Primary table key.

ComponentId

A string GUID unique to this component, version, and language.

Note that the letters of these GUIDs must be uppercase. Utilities such as GUIDGEN can generate GUIDs containing lowercase letters. The lowercase letters must be changed to uppercase to make these valid component code GUIDs.

If this column is null the installer does not register the component and the component cannot be removed or repaired by the installer. This might be intentionally done if the component is only needed during the installation, such as a custom action that cleans up temporary files or removes an old product. It may also be useful when copying data files to a user's computer that do not need to be registered.

Directory_

External key of an entry in the Directory table. This is a property name whose value contains the actual path, which can be set either by the AppSearch action or with the default setting obtained from the Directory table.

Developers must avoid authoring components that place files into one of the User Profile folders. These files would not be available to all users in multi-user situations and could cause the installer to permanently view the component as requiring repair.

External key to column one of the Directory table.

Attributes

This column contains a bit flag that specifies options for remote execution. Add the indicated bit to the total value in the column to include an option.

Note  In the case of an .msi file that is being downloaded from a web location, the attribute flags should not be set to allow a component to be run-from-source. This is a limitation of the Windows Installer and can return a feature state of INSTALLSTATE_BADCONFIG.

Condition

This column contains a conditional statement that can control whether a component is installed. If the condition is null or evaluates to true, then the component is enabled. If the condition evaluates to False, then the component is disabled and is not installed.

The Condition field enables or disables a component only during the CostFinalize action. To enable or disable a component after CostFinalize, you must use a custom action or the DoAction ControlEvent to call MsiSetComponentState.

Note that unless the Transitive bit in the Attributes column is set for a component, the component remains enabled once installed even if the conditional statement in the Condition column later evaluates to False on a subsequent maintenance installation of the product.

The Condition column in the Component table accepts conditional expressions containing references to the installed states of features and components. For information on the syntax of conditional statements, see Conditional Statement Syntax.

KeyPath

This value points to a file or folder belonging to the component that the installer uses to detect the component. Two components cannot share the same key path value. The value in this column is also the path returned by the MsiGetComponentPath function.

 

 

文件的表极其规则

Column

Type

Key

Nullable

File

Identifier

Y

N

Component_

Identifier

N

N

FileName

Filename

N

N

FileSize

DoubleInteger

N

N

Version

Version

N

Y

Language

Language

N

Y

Attributes

Integer

N

Y

Sequence

Integer

N

N

Columns

File

A non-localized token that uniquely identifies the file, and is used as an external key into other tables.

Component_

The external key into the first column of the Component Table. This field identifies the Component that controls the file.

FileName

The file name used for installation. The name may be localized. For more information, see the Filename column data type.

Because some web servers can be case sensitive, FileName should match the case of the source files exactly to ensure support of internet downloads.

FileSize

The size of the file in bytes. This must be a non-negative number.

Version

This field is the version string for a versioned file. This field is blank for non-versioned files. The file version entered into this field must be identical to the version of the file included with the installation package.

The Version field can also be set to contain the primary key of another record in the File table. The referenced file then determines the versioning logic for this file. For more information, see Companion Files. Note that if this file is the key path for its component, it must not be specified as a companion file.

Language

A list of decimal language IDs separated by commas.

Font files should not be authored with a language ID, as fonts do not have an embedded language ID resource. Thus this column should be left null for font files.

Attributes

The integer that contains bit flags that represent file attributes.

The following table shows the definition of the bit field.

Sequence

Sequence position of this file on the media images. This order must correspond to the order of the files in the cabinet if the files are compressed. The integers in this field must be equal or greater than 1.

 

 

 

 

文件的版本规则

文件当然是安装中最核心的部分,安装的主要任务就是安装文件。决定是否安装文件是一个复杂的过程。首先,我们要看着个组件是否是被安装的。一旦决定这个文件是被复制的,我们还要看在目标目录里是否有这相同名字的文件存在。如果已经有文件存在,我们要根据它的版本,日期和语言来决定是否安装它。

―高版本覆盖低版本

-有版本的覆盖没有版本的

――安装和产品语言一致的文件

――保持多语言文件

――无版本信息的文件看日期

修改日期比创建日期新,不要安装

修改日期和创建日期一样,安装

修改日期和创建日期晚,按创建日期安装

 

第二部分:安装工程的构成

有三层:

产品PRODUCT

 

特性FEATURE

组件COMPONET

 

 

 

 

 

 

 

 

 

 


对用户来说,FEATURE是构成产品的最小单位

对设计者来说,组件是构成产品的最小单位

 

 

 

 

第三部分:工具的使用:(演示)

installshield

简单方便强大,制作好帮手,可惜太庞大,容易死机

ORCA

短小精悍,适合浏览,查找BUG

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值