Hi John,
How are the things going?
I have worked out a sample code for your convenience:
The target SQL statement would be:
UPDATE Control SET Control.Attributes = '2097159' WHERE Control.Dialog_ =
'CustomTextA' AND Control.Control = 'Edit1'
'the 2097159 = 2097152(0x00200000) + 7
You can use the following script to update the target msi package:
(Note: The below approaches assume the sample scripts in the same directory
as the target msi package, if not, please use the fullname of the msi
package. By the way, be careful of the character "`" and "'", do not mix up
then in the script and command line)
Option Explicit
Const msiOpenDatabaseModeTransact = 1
' Connect to Windows Installer object
On Error Resume Next
Dim installer : Set installer = Nothing
Set installer = Wscript.CreateObject("WindowsInstaller.Installer")
Dim openMode : openMode = msiOpenDatabaseModeTransact
Dim database : Set database = installer.OpenDatabase("Test.msi", openMode)
Dim view : Set view = database.OpenView("UPDATE Control SET
Control.Attributes = '2097159' WHERE Control.Dialog_ = 'CustomTextA' AND
Control.Control = 'Edit1'")
view.Execute
database.Commit
Set view = Nothing
Set database = Nothing
Or via the script-driven database command-line queries that provided in the
Windows Installer SDK as the utility WiRunSQL.vbs:
CScript WiRunSQL.vbs Test.msi "UPDATE `Control` SET `Control`.`Attributes`
= '2097159' WHERE `Control`.`Dialog_` = 'CustomTextA' AND
`Control`.`Control` = 'Edit1'"
Please refer to the following MSDN doc:
Examples of Database Queries Using SQL and Script
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/e
xamples_of_database_queries_using_sql_and_script.asp
Good Luck!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.
|