大网数据广告活动
安装更新与部署

Replacing Existing Files

· 52CE 我爱测

Because unnecessary file copying slows an installation, the Windows Installer determines whether the component's key file is already installed before attempting to install the files of any component.

Because unnecessary file copying slows an installation, the Windows Installer determines whether the component's key file is already installed before attempting to install the files of any component. If the installer finds a file with the same name as the component's key file installed in the target location, it compares the version, date, and language of the two key files and uses file versioning rules to determine whether to install the component provided by the package. If the installer determines it needs to replace the component base upon the key file, then it uses the file versioning rules on each installed file to determine whether to replace the file.

Note that when authoring an installation package with versioned files, the version string in the Version column of the File table must always be identical to the version of the file included with the package.

The default file versioning rules can be overridden or modified by using the REINSTALLMODE property. The installer uses the file versioning rules specified by the REINSTALLMODE property when installing, reinstalling, or repairing a file. The following example shows how the installer applies the default File Versioning Rules. The default value of the REINSTALLMODE property is "omus".

The following component key files are installed on the system before the component is reinstalled.

File Version Create date Modified date Language
FileA 1.0.0000 1/1/99 1/1/99 ENG
FileB 2.0.0000 1/1/99 1/1/99 ENG
FileC 1.0.0000 1/1/99 1/1/99 ENG
FileD 1.0.0000 1/1/99 1/2/99 ENG
FileE none 1/1/99 1/1/99 none
FileF (modified > create) none 1/1/99 1/2/99 none
FileG 1.0.0000 1/1/99 1/1/99 ENG
FileH 1.0.0000 1/1/99 1/1/99 ENG,FRN,SPN
FileI 1.0.0000 1/1/99 1/1/99 ENG,FRN
FileJ 1.0.0000 1/1/99 1/1/99 ENG,GER,ITN

The following component key files are included in the installer package.

File Version Create date Modified date Language
FileA (marked same) 1.0.0000 1/1/99 1/1/99 ENG
FileB (earlier version) 1.0.0000 1/1/99 1/1/99 ENG
FileC (later version) 2.0.0000 1/1/99 1/1/99 ENG
FileD (later version) 2.0.0000 12/31/98 1/10/99 FRN
FileE (marked same) none 1/1/99 1/1/99 none
FileF (new file) none 1/3/99 1/3/99 none
FileG (new language) 1.0.0000 1/1/99 1/1/99 FRN
FileH (new language) 1.0.0000 1/1/99 1/1/99 ITN,ENG,GER
FileI (more languages) 1.0.0000 1/1/99 1/1/99 ENG,FRN,SPN
FileJ (fewer languages) 1.0.0000 1/1/99 1/1/99 GER

The following component key files stay on the system after the component is reinstalled. The state of the key file determines the state of any other files in the component.

File Version Create date Modified date Language
FileA (original) 1.0.0000 1/1/99 1/1/99 ENG
FileB (original) 2.0.0000 1/1/99 1/1/99 ENG
FileC (replacement) 2.0.0000 1/1/99 1/1/99 ENG
FileD (replacement) 2.0.0000 12/31/98 1/10/99 FRN
FileE (replacement) none 1/1/99 1/1/99 none
FileF (original) none 1/1/99 1/2/99 none
FileG (replacement) 1.0.0000 1/1/99 1/1/99 FRN
FileH (replacement) 1.0.0000 1/1/99 1/1/99 ITN,ENG,GER
FileI (replacement) 1.0.0000 1/1/99 1/1/99 ENG,FRN,SPN
FileJ (original) 1.0.0000 1/1/99 1/1/99 ENG,GER,ITN

Related topics

CRC Checking During an Installation

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。