Adding template mst inside another mst
Hi All,
I have created a mst template with all the basic properties inside it. Now whenever I get a vendor msi and we create a transform (mst) out of it, I would like to incorporate this template mst into the newly generated mst. Can someone please tell how can we achive this???
I have created this mst template to bring down the effort of everytime adding the properties.
Thank you in advance.
I have created a mst template with all the basic properties inside it. Now whenever I get a vendor msi and we create a transform (mst) out of it, I would like to incorporate this template mst into the newly generated mst. Can someone please tell how can we achive this???
I have created this mst template to bring down the effort of everytime adding the properties.
Thank you in advance.
0 Comments
[ + ] Show comments
Answers (13)
Please log in to answer
Posted by:
cygan
13 years ago
Posted by:
MSIPackager
13 years ago
How do you create your transforms?
Personally I always create a copy of the vendor MSI, make all the changes to that and then use msitran.exe to generate the transform.
That way you can use msimerge (or better still vbscript) to make the standard changes to the copy of the vendor MSI, before you generate the MST.
Rergards,
Rob.
Personally I always create a copy of the vendor MSI, make all the changes to that and then use msitran.exe to generate the transform.
That way you can use msimerge (or better still vbscript) to make the standard changes to the copy of the vendor MSI, before you generate the MST.
Rergards,
Rob.
Posted by:
captain_planet
13 years ago
You can use the Windows Installer API to apply multiple transforms to an MSI and spit out a combined one. You're not having my script, but I'll provide you with the basics. This script has no error handling. It merely gives a brief example of how to implement this technique using the relevant API calls. Obviously with a bit of work you can make it accept dynamic files for its input, as opposed to the static ones defined below......enjoy. [;)]
'Create file system object
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
'retrieve path to original msi
Dim originalMsiPath : originalMsiPath = "c:\test\QuickFacts.msi"
'make a backup copy of it for us to work On
Dim backupCopyMsiPath : backupCopyMsiPath = Replace(originalMsiPath,".msi","_backup.msi")
fso.CopyFile originalMsiPath,backupCopyMsiPath
'retrieve original path to transform A
Dim transformA : transformA = "c:\test\a.mst"
'retrieve original path to transform B
Dim transformB : transformB = "c:\test\b.mst"
'Specify a name for your 'combined' transform
Dim transformCombined : transformCombined = "c:\test\aAndb.mst"
'Create installer object
Dim installerObject: Set installerObject = CreateObject("WindowsInstaller.Installer")
'Open the 'backup' installer
Dim backupDatabase: Set backupDatabase = installerObject.OpenDatabase(backupCopyMsiPath, 1)
'apply all your transforms to it
backupDatabase.ApplyTransform transformA, 63
backupDatabase.ApplyTransform transformB, 63
'commit the change
backupDatabase.Commit
'Now find the difference between your original MSI, and the backed up MSI with the MSTs applied.....
Dim installerDatabase: Set installerDatabase = installerObject.OpenDatabase(originalMsiPath, 0)
backupDatabase.GenerateTransform installerDatabase, transformCombined
'The Summary Info. Stream NEEDS generating - if i recall this was a bug i discovered in one of the scripts provided in the Windows Installer the SDK.
backupDatabase.CreateTransformSummaryInfo installerDatabase, transformCombined, 0, 0
Set installerObject = Nothing
Set backupDatabase = Nothing
Set installerDatabase = Nothing
'Delete your backup file
fso.DeleteFile(backupCopyMsiPath)
Set fso = Nothing
Posted by:
anonymous_9363
13 years ago
Cap'n P, what the OP wants - if my reading is correct - is a similar way to handle MST creation for MSIs to the way that Wise has a template for MSIs, such that you could include your client's standard properties and so on which Installtailor would then use as a base. I haven't tried it myself but Cyg's approach sounds plausible.
Posted by:
captain_planet
13 years ago
Posted by:
kiptek
13 years ago
Posted by:
bubble_buzz21
13 years ago
Posted by:
captain_planet
13 years ago
Posted by:
bubble_buzz21
13 years ago
Posted by:
captain_planet
13 years ago
...for the static example i provided, you need to manually ensure 'c:\test' is created and that it contains 'c:\test\QuickFacts.msi', 'c:\test\a.mst' and 'c:\test\b.mst'. Apply both transforms to the MSI using Orca beforehand, just to ENSURE they both make transformations to the original MSI. Logically it should work, so I suspect one of your transforms doesnt do what you think it does. As for Cygan's approach, I don't know if this will help, but try creating a new 'Active Project' in Wise before you perform the Install Tailor routine.....
Posted by:
cygan
13 years ago
about the Cygan's approach, that was first approach i tried which doesnot work
you can customize an mst with another mst can't you
I created a blank mst with properties ie rootdrive, arpsystemcomponent etc ,etc
ran installtailor to cutomize my msi and browsed to my base mst with all the properties.
created a new mst and all my settings from my base mst still exist in the new mst
Posted by:
bubble_buzz21
13 years ago
Orca doesnot allow to apply two mst to base msi. so i tried applying one template mst to the base msi and generate the base mst, the base mst when viewed doesnot reflect the template changes, Note the i have some custom action and files added to the template mst.
So i tried to merge two msi , base msi and the template.msi using msimerge.exe provided by SDK. that works ,the base msi will have the transform.msi changes merged in the base.msi. but the command line throws the error.
Error 1627. Error merging two database, Check _MergeErrors Table for Merge conflicts.
No idea how do i resolve this above error.
So i tried to merge two msi , base msi and the template.msi using msimerge.exe provided by SDK. that works ,the base msi will have the transform.msi changes merged in the base.msi. but the command line throws the error.
Error 1627. Error merging two database, Check _MergeErrors Table for Merge conflicts.
No idea how do i resolve this above error.
Posted by:
captain_planet
13 years ago

so that the conversation will remain readable.