hi all,

i'm trying to generate a transform with a vbscript but i'm having troubles and i can't find info anywhere on this topic.

can someone gives me a link to some information please?

so far, i can export a table (property), update it with the changes i need, import it into a new msi, but when i generate the transform, only the property table is generated in the transform.

by the way, i'm using microsoft vbscripts to try this but nothing works so far.

thanks guys!
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
so far, i can export a table (property), update it with the changes i need, import it into a new msi, but when i generate the transform, only the property table is generated in the transform.
So that seems correct.
The transform should/will only contain the diff between the two MSIs and as you only updated the Property table these entries will be added to the transform during generation using WiGenXfm.vbs (I guess you used this one).
Answered 02/12/2008 by: AngelD
Red Belt

Please log in to comment
0
ORIGINAL: AngelD

So that seems correct.
The transform should/will only contain the diff between the two MSIs and as you only updated the Property table these entries will be added to the transform during generation using WiGenXfm.vbs (I guess you used this one).



yes that's the vbs i use.

the transform is generated but when i try to open it with wise, after choosing the msi related to it, i have an error message starting with this;

"an invalid file handle was associated"

then if i open the msi with orca and apply the generated transform, i can see only the property table, all the other tables are marked as removed, with a green line that cross them.

i don't know how to fix this.

thanks for the help AngelD
Answered 02/12/2008 by: kardock
Second Degree Green Belt

Please log in to comment
0
Could you try using WiRunSQL.vbs instead to modify the Property table for the "updated" MSI.
Use INSERT to add new property entries and UPDATE to modify an existing entry.
Answered 02/12/2008 by: AngelD
Red Belt

Please log in to comment
0
i will definitely try it.

but could you tell me how to verify if the property is there or not?

i'm not sure which function to use depending if the property exists or not.

thanks!
Answered 02/13/2008 by: kardock
Second Degree Green Belt

Please log in to comment
0
hey AngelD, could you please give me an example to start me in the right direction?

if i use WIRunSQL.vbs, how can i update the property ALLUSERS for example?

i know nothing about sql queries :(

thanks man!
Answered 02/13/2008 by: kardock
Second Degree Green Belt

Please log in to comment
0
A simple vbscript for using either UPDATE or INSERT could look like
running the script bellow from the command prompt should be
cscript "<path to msi>" MyPropertyToAddOrChange "my property value"

PopulatePropertyTable.vbs
Const msiOpenDatabaseModeTransact = 1
Dim msiPath, propertyKey, propertyValue
Dim installer, database, view, record
msiPath = Wscript.Arguments(0)
propertyKey = Wscript.Arguments(1)
propertyValue = Wscript.Arguments(2)
Set installer = CreateObject("WindowsInstaller.Installer")
Set db = Installer.OpenDatabase(msiPath, msiOpenDatabaseModeTransact)
Set view = db.OpenView("SELECT * FROM `Property` WHERE `Property` = '" & propertyKey & "'")
view.Execute
Set record = view.Fetch
If Not (record Is Nothing) Then
Set view = db.OpenView("UPDATE Property SET Value = 'Updated " & propertyValue & "' WHERE Property = '" & propertyKey & "'")
Else
Set view = db.OpenView("INSERT INTO Property(Property.Property, Property.Value) VALUES('" & propertyKey & "', 'Added " & propertyValue & "')")
End If
view.Execute
db.Commit
Set installer = Nothing
Answered 02/13/2008 by: AngelD
Red Belt

Please log in to comment
0
AngelD, a big thank you!

i will study this script and i believe this will start me on how to work with vbs and msi!

thanks!
Answered 02/14/2008 by: kardock
Second Degree Green Belt

Please log in to comment
0
ok i have made some progress but i still have the original problem.

here is what i did;

i took my original msi file.
open the file with orca and made sure ALLUSERS was set to 1

i copied it to temp.msi

i have run the script to change ALLUSERS from 1 to 2, this works.
i checked with orca again and into temp.msi, ALLUSERS is set to 2.

then i use WiGenXfm.vbs to generate the transform, which also works.
WiGenXfm.vbs quicktime.msi temp.msi test.mst

then if i open the mst file with wfwi, i have this error;

first line: Could not apply transform to base database.
second line: An invalid file handle was associated with z:\projects\test\quicktime.msi

please help, if i can't fix this today i will have to stop working on this because too much time was involved now and i can't justify putting more hours in it.

thank you AngelD, you're always a big help to me!
Answered 02/14/2008 by: kardock
Second Degree Green Belt

Please log in to comment
0
First try to set ALLUSERS to 2 using ORCA for temp.msi and then see if you can create a transform with WiGenXfm.vbs.

You could always use the MsiTrans utility from the Platform SDK to generate a transform.
MsiTran.exe -g {base db} {new db} {transform}
So in you case the command line should look like: MsiTran.exe -g quicktime.msi temp.msi test.mst
Answered 02/14/2008 by: AngelD
Red Belt

Please log in to comment
0
MsiTran.exe -g quicktime.msi temp.msi test.mst

YES IT WORKS!

msitran.exe has done my mst and i can edit it with wfwi!

i can't thank you enough man!

now i will be able to make all this together and create the script i need.

thanks again AngelD.
Answered 02/14/2008 by: kardock
Second Degree Green Belt

Please log in to comment
0
You're welcome!
Answered 02/17/2008 by: AngelD
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity