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

Generating a Customization Transform

· 52CE 我爱测

You may generate a transform file by using MsiDatabaseGenerateTransform or the GenerateTransform method of the Database object.

You may generate a transform file by using MsiDatabaseGenerateTransform or the GenerateTransform method of the Database object. An example of this is provided in the Windows Installer SDK as the utility WiGenXfm.vbs. The following snippet, Gen.vbs, also illustrates the GenerateTransform method and is for use with Windows Script Host.

'Gen.vbs. Argument(0) is the original database. Argument(1) is the
'    customized database. Argument(2) is the transform file.
 
Option Explicit

' Check arguments
If WScript.Arguments.Count < 2 Then
    WScript.Echo "Usage is gen.vbs [original database] [customized database] [transform file]"
    WScript.Quit(1)
End If

' Connect to Windows Installer object
On Error Resume Next
Dim installer : Set installer = Nothing
Set installer = Wscript.CreateObject("WindowsInstaller.Installer") 
' Open databases
Dim database1 : Set database1 = 
    installer.OpenDatabase(Wscript.Arguments(0), 0) 
Dim database2 : Set database2 = 
    installer.OpenDatabase(Wscript.Arguments(1), 0) 
' Generate transform
Dim transform : transform = Database2.GenerateTransform(Database1,
    Wscript.Arguments(2))

To generate the transform file MNPtrans.mst from the original MNP2000.msi database and the MNP2000t.msi database you modified in Customizing an Original Database, change directories to the folder containing Gen.vbs, the original database, and the updated installer database and enter the following command line.

Cscript.exe Gen.vbs MNP2000.msi MNP2000t.msi MNPtrans.mst

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)

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

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