This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Knowledge Base
- :
- Script to generate MSI log with product version
Subscribe
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Script to generate MSI log with product version
Script to generate MSI log with product version
Summary
How to generate a log file with version number appending to msi verbose log.
Symptoms
When ever we install a msi the logfile will be created without the version number of installer, it will be helpful if the log file has version number append to the log file.
Resolution
You can execute the below vbscript code to set delete the unused component from your project ism file. You can also write the same code using PowerShell also
You can run the script using vbs editor or you can run the script using “wscript.exe” in cmdlet.
Path to wscript.exe “C:\Windows\System32>wscript.exe”
Here is my sample script to install a msi package and generate log with version number,
Const msiOpenDatabaseModeReadOnly = 0
Dim msi, db, view, Test, strLog
Set oShell = WScript.CreateObject( "WScript.Shell" )
Set msi = CreateObject("WindowsInstaller.Installer")
Set db = msi.OpenDataBase("<Path to msi package>", msiOpenDatabaseModeReadOnly)
Set view = db.OpenView("SELECT `Value` FROM `Property` WHERE `Property` = 'ProductVersion'")
Call view.Execute()
GetVersion = view.Fetch().StringData(1)
Test = GetVersion
Wscript.Echo Test
CStr(Test)
Wscript.Echo Test
oShell.CurrentDirectory = "C:\Users\Administrator\Downloads\"
strLog = "C:\SetupMsilog_" & Test & ".log"
oShell.Run "TestComponent.msi /l*v " & chr(34) & strLog,0,True
No ratings