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

Planning the Installation

· 52CE 我爱测

When the installation of an existing application is moved to Windows Installer from another setup technology, the setup developer may start authoring a Windows Installer package using the source and target file images of the existing installation.

When the installation of an existing application is moved to Windows Installer from another setup technology, the setup developer may start authoring a Windows Installer package using the source and target file images of the existing installation. A detailed plan of how the files and other resources are organized at the source and target is also a good starting point for developing a package for a new application.

The sample installation package takes the following files that are stored at the source location for the application and installs them to the target on the user's computer.

File Description Path to source Path to target
Redpark.exe Text editor executable file. C:\Sample\Notepad\Redpark.exe [ProgramFilesFolder]\Red_Park\Redpark.exe
Readme.txt An informational file. C:\Sample\Notepad\Readme.txt [ProgramFilesFolder]\Red_Park\Readme.txt
Help.txt Help manual C:\Sample\Notepad\Help.txt Not installed. Always run-from-source.
Baseball.txt Baseball game schedule for year 2000. C:\Sample\Notepad\Events\Baseball.txt [ProgramFilesFolder]\Red_Park\Sports\Baseball.txt
Football.txt Football game schedule for year 2000. C:\Sample\Notepad\Events\Football.txt [ProgramFilesFolder]\Red_Park\Sports\Football.txt
Dance.txt Dance performances for year 2000. C:\Sample\Notepad\Events\Dance.txt [ProgramFilesFolder]\Red_Park\Arts\Dance.txt
Concert.txt Music performances for year 2000. C:\Sample\Notepad\Events\Concert.txt [ProgramFilesFolder]\Red_Park\Arts\Concert.txt
January.txt Admissions in January of year 2000. C:\Sample\Notepad\Gate\January.txt [ProgramFilesFolder]\Red_Park\Gate\January.txt
NewYears.txt Admissions on New Years Day of year 2000. C:\Sample\Notepad\Gate\Holidays\NewYears.txt [ProgramFilesFolder]\Red_Park\Gate\NewYears.txt

The sample 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 sample installs 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\Baseball.txt
sFootball [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Sports\Football.txt
sDance [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Arts\Dance.txt
sConcert [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Arts\Concert.txt
sJanuary [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Gate\January.txt
sNewYears [ProgramFilesFolder]\Red_Park\Menu\ [ProgramFilesFolder]\Red_Park\Gate\NewYears.txt

To reproduce the sample, begin by creating the source directory structure given in the first table. You can make a copy of your system's Notepad.exe file and then rename this copy Redpark.exe. Use the Notepad editor to create the remaining text files. The directory structure of the target, the registry values, and the shortcuts are added by authoring the installation database.

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)

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

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