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

Downloading an Installation from the Internet

· 52CE 我爱测

Windows Installer accepts a Uniform Resource Locator (URL) as a valid source for an installation.

Windows Installer accepts a Uniform Resource Locator (URL) as a valid source for an installation. Windows Installer can install packages, patches, and transforms from a URL location.

If the installation database is at a URL, the installer downloads the database to a cache location before starting the installation. The installer also downloads the files and cabinet files from the Internet source that are appropriate for the user's selections. See A URL-based Windows Installer Installation Example for more information.

For example, to install a package with a source located on a web server at https://server/share/package.msi, you can use the command line options to install the package and set public properties.

msiexec /i https://server/share/package.msi PROPERTY=VALUE

A command line like the one previously shown should be passed to the installer to start an installation from a web browser. In general, you should not download and install the package simply by double-clicking the .msi file from within the browser. This downloads the .msi file to the temporary Internet files folder and passes the following command to the installer:

msiexec /i c:\windows\temporary internet files\package.msi

The installation fails if the package requires any external source files or cabinets because these are not located in the same location as the .msi file.

Note that because the Installer object is not marked as SafeForScripting on the user's computer, users need to adjust their browser security settings for the example to work correctly.

The InstallProduct method could be used to run the previous command from a browser as an on-click event.

'Downloading an Installation from the Internet
'The InstallProduct method could be used to run 
'the previous command from a browser as an on-click event.

<SCRIPT LANGUAGE="VBScript"> 
<!-- 
Dim Installer
On Error Resume Next
set Installer=CreateObject("WindowsInstaller.Installer")
Installer.InstallProduct "https://server/share/package.msi", "PROPERTY=VALUE "
set Installer=Nothing
-->
</SCRIPT>

Note that because some web servers are case sensitive, the FileName field in the File table must match the case of the source files exactly to ensure support of Internet downloads.

See Downloading and Installing a Patch from the Internet. For more information about securing installations and using digital certificates, see Guidelines for Authoring Secure Installations and Digital Signatures and Windows Installer. For more information about how to create a web installation of a Windows Installer package, see Internet Download Bootstrapping.

Available Internet Protocols

Beginning with Windows Server 2003 and Windows XP, the installer can use the HTTP, HTTPS and FILE protocols. The installer does not support the FTP and GOPHER protocols.

Windows Installer version 2.0 can use the HTTP, FILE, and FTP protocols and cannot use the HTTPS and GOPHER protocols.

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)

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

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