AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
How to open mst files2/14/2023 ![]() $query = "CREATE TABLE ``CustomAction`` ( ``Action`` CHAR(72) NOT NULL, ``Type`` SHORT NOT NULL, ``Source`` CHAR(64), ``Target`` LONGCHAR PRIMARY KEY ``Action``)" ![]() $tableExists = $database2.GetType().InvokeMember( ![]() #use the TablePersist method to see if the CustomAction table exists $database2 = $msiOpenDatabaseModeTransact) $database1 = $msiOpenDatabaseModeReadOnly) $windowsInstaller = New-Object -ComObject WindowsInstaller.Installer #If backup doesn't already exist, make a copy to make our changes toĬopy-Item -Path $database1Path -Destination $database2Path $database1Path = $msiFolder + "example.msi" Tip: Make sure you enclose all table and column names with a double backtick to avoid ‘OpenView,Sql’ errors during OpenView() calls! By default a single backtick in Powershell acts as an escape character, so we are required to use two of these. Using this example for reference, you should be able to accomplish most tasks using Powershell and the Windows Installer object. I’ve ripped out some excerpts below to demonstrate inserting rows, querying tables, retrieving properties and generating a transform. ![]() I recently needed to generate a Windows Installer transform file (MST) using Powershell. ![]()
0 Comments
Read More
Leave a Reply. |