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

Planning a Major Upgrade

· 52CE 我爱测

If Windows Installer is used for the installation and setup of an application, later upgrades of that application can be handled by installing an upgrade package.

If Windows Installer is used for the installation and setup of an application, later upgrades of that application can be handled by installing an upgrade package. Setup developers may choose to author an upgrade package by modifying the original installation package. This approach is illustrated by the following upgrade example.

The installation of the original product, MNP2000, followed by the installation of the upgrade package provides the user with the following files required by the product MNP2001.

File Description Path to source Path to target
Redpark.exe Text editor executable file. Unchanged from previous products. C:\Sample\Notepad\Redpark.exe [ProgramFilesFolder]\Red_Park\Redpark.exe
Readme.txt An information file. Unchanged from previous products. C:\Sample\Notepad\Readme.txt [ProgramFilesFolder]\Red_Park\Readme.txt
Help.txt Help manual. Unchanged from previous products. C:\Sample\Notepad\Help.txt Not installed. Always run-from-source.
Baseba01.txt Baseball game schedule for year 2001. C:\Sample\Notepad\Events\Baseba01.txt [ProgramFilesFolder]\Red_Park\Sports\Baseball.txt
Footba01.txt Football game schedule for year 2001. C:\Sample\Notepad\Events\Footba01.txt [ProgramFilesFolder]\Red_Park\Sports\Football.txt
Basket01.txt Basketball game schedule for year 2001. C:\Sample\Notepad\Events\Basket01.txt [ProgramFilesFolder]\Red_Park\Sports\Basket01.txt
Dance01.txt Dance performances for year 2001. C:\Sample\Notepad\Events\Dance01.txt [ProgramFilesFolder]\Red_Park\Arts\Dance.txt
Concert01.txt Music performances for year 2001. C:\Sample\Notepad\Events\Concer01.txt [ProgramFilesFolder]\Red_Park\Arts\Concert.txt
Opera01.txt Opera performances for year 2001. C:\Sample\Notepad\Events\Opera01.txt [ProgramFilesFolder]\Red_Park\Arts\Opera01.txt
Januar01.txt Admissions in January of year 2001. C:\Sample\Notepad\Gate\Januar01.txt [ProgramFilesFolder]\Red_Park\Gate\January.txt
NewYea01.txt Admissions on New Years Day of year 2001. C:\Sample\Notepad\Gate\Holidays\NewYea01.txt [ProgramFilesFolder]\Red_Park\Gate\NewYears.txt
Memori01.txt Admissions on Memorial Day of year 2001. C:\Sample\Notepad\Gate\Holidays\Memori01.txt [ProgramFilesFolder]\Red_Park\Gate\Memori01.txt

Installation of the upgrade package removes all the features installed with the original product that are not being used by the upgraded product.

For example, when upgrading from MNP2000, installation of the upgrade removes the following files from the user's computer:

  • Baseball.txt
  • Football.txt
  • Dance.txt
  • Concert.txt
  • January.txt
  • NewYears.txt

Installation of the upgrade package writes the following values in the user's registry under:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Notepad Sample

Name Value
lfCharSet 0
lfClipPrecision 2
lfFaceName FixedSys
lfItalic 0
lfOrientation 0
lfOutPrecision 1
fSavePageSetting 0
lfPitchAndFamily 49
iPointSize 120
lfQuality 2
lfStrikeOut 0
lfWeight 400
fWrap 0

The upgrade updates old shortcuts to the following shortcuts. One of these shortcuts may be selected during setup as an advertised shortcut so that the user can install-on-demand the Baseball feature.

Name Shortcut location Shortcut target
sNotepad [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Redpark.exe
sReadme [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Readme.txt
sHelp [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Sample\Notepad\Help.txt
sBaseball [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Sports\Baseba01.txt
sFootball [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Sports\Footba01.txt
sBasketball [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Sports\Basketba01.txt
sDance [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Arts\Dance01.txt
sConcert [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Arts\Concer01.txt
sOpera [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Arts\Opera01.txt
sJanuary [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Gate\Januar01.txt
sNewYears [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Gate\NewYea01.txt
sMemorial [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Gate\Memori01.txt

When a user uninstalls the upgrade package, Windows Installer completely removes all versions of the product from the user's computer. The user is not left with any parts of MNP2000 or MNP2001.

Continue

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)

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

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