CAB Files in MSI
Posted 15 October 2001 - 20:08
Posted 17 October 2001 - 20:40
In VB, I did the following:
Set msiView = msiDB.OpenView("SELECT * FROM _Streams WHERE Name = '" + cabinetName +"'")msiView.Execute
Set msiRecord = msiView.Fetch()
If msiRecord Is Nothing Then
Set msiRecord = msiInstaller.CreateRecord(2)
msiRecord.StringData(1) = cabinetName
msiRecord.SetStream 2, (App.Path + "\" + cabinetName)
msiView.Modify msiViewModifyInsert, msiRecord
End If
You also need to add an entry to the Media table. The cabinet field (column 4) should contain the cabinet name prefixed with a "#" character (for example, #TEST.CAB). This tells Windows Installer that the cabinet is embedded in the msi file.
For more information, in the Windows Installer help file you can use the Index to go to the "Cabinet" topic, and then click on "Including a Cabinet File in an Installation" at the bottom.