How can I use variable inside brackets?
I am trying to automate msi checks. Below is my code,
Appid2 will be a variable value, but it is not getting resolved. Can anyone guide me?
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
Answers (5)
Please log in to answer
Posted by:
anonymous_9363
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
Jsaylor
14 years ago
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.
Posted by:
markus trescothick
14 years ago
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,
I removed chr(34), and it started working.
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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.