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

Scripts

· 52CE 我爱测

A custom action can call functions that are written in VBScript or JScript.

A custom action can call functions that are written in VBScript or JScript. Windows Installer does not provide the script engine. Authors wishing to make use of a scripting language during installation must therefore ensure that the appropriate scripting engine is available.

The installer does not support JScript version 1.0.

A 64-bit custom action based on scripts must be explicitly marked as a 64-bit custom action by adding the msidbCustomActionType64BitScript bit to the custom actions numeric type in the Type column of the CustomAction table. For information see 64-Bit Custom Actions.

The following basic custom action types call functions written in script.

Custom action type Description
Custom Action Type 5 JScript file stored in a Binary table stream.
Custom Action Type 21 JScript file that is installed with a product.
Custom Action Type 53 JScript text specified by a property value.
Custom Action Type 37 JScript text stored in the Target column of the CustomAction table.
Custom Action Type 6 VBScript file stored in a Binary table stream.
Custom Action Type 22 VBScript file that is installed with a product.
Custom Action Type 54 VBScript text specified by a property value.
Custom Action Type 38 VBScript text stored in the Target column of the CustomAction table.

Note:
The installer runs script custom actions directly and does not use the Windows Script Host. The WScript object cannot be used inside a script custom action because this object is provided by the Windows Script Host. Objects in the Windows Script Host object model can only be used in custom actions if Windows Script Host is installed on the computer by creating new instances of the object, with a call to CreateObject, and providing the ProgId of the object (for example "WScript.Shell"). Depending on the type of script custom action, access to some objects and methods of the Windows Script Host object model may be denied for security reasons.

For more information, see Summary List of All Custom Action Types for a summary of all types of custom actions and how they are encoded into the CustomAction table.

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)

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

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