I am trying to automate msi checks. Below is my code,

Set installer = CreateObject("WindowsInstaller.Installer")
Set database = installer.OpenDatabase(Appid2,msiOpenDatabaseModeReadOnly)

Appid2 will be a variable value, but it is not getting resolved. Can anyone guide me?
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
If the code you show is an exact representation of what you're trying to run, I think the problem may be the 2 spaces you have between the function call (OpenDatabase) and the parameter list. Close that gap completely - that is, have no spaces - and re-try.
Answered 06/20/2010 by: VBScab
Red Belt

Please log in to comment
0
I tried that, but same result.
Answered 06/21/2010 by: markus trescothick
Yellow Belt

Please log in to comment
0
I have to ask...you have assigned values to 'Appid2' and 'msiOpenDatabaseModeReadOnly' and, for the former, I presume the value is the full path to the MSI?
Answered 06/21/2010 by: VBScab
Red Belt

Please log in to comment
0
I think maybe supplying the entire code set you're trying to use would be more helpful. Without knowing what the actual variables are that you're using, and maybe even a specific error code that the script is spitting out during object creation (it is the database object creation that's failing, right?) We can't really provide meaningful help beyond some common 'gotcha' things that could happen to any piece of code.
Answered 06/21/2010 by: Jsaylor
Second Degree Blue Belt

Please log in to comment
0
Hi,
I think I got answer.
in my code I was using,
Appid2 = chr(34) & "c:\" + Appid1 & chr(34)
it was getting resolved as "c:\A_B_1.0.msi".
Strange thing is in brackets if I put hard coded value,

Set installer = CreateObject("WindowsInstaller.Installer")
Set database = installer.OpenDatabase("c:\A_B_1.0.msi",msiOpenDatabaseModeReadOnly)
it does not give any error.

I removed chr(34), and it started working.
Answered 06/22/2010 by: markus trescothick
Yellow Belt

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