This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- VBScript Example for using ISWiPathVariables
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 31, 2007
12:10 PM
VBScript Example for using ISWiPathVariables
On Error Resume Next
if WScript.arguments.length = 0 then
'WScript.echo "This script requires IS project file"
'WScript.echo "and a version number to be passsed in"
'WScript.echo "Usage: productversiontest.vbs"
WScript.Quit(1)
end if
If WScript.arguments(1) = 14 then
Set oProject = CreateObject("SAAuto14.ISWiProject")
else
WScript.Quit(1)
End if
'Set file location
oProject.OpenProject WScript.arguments(0)
If Err.Number <> 0 Then
'Wscript.echo "Invalid path to InstallShield project file: " & WScript.arguments(0)
Wscript.Quit(1)
End If
Dim oPathVariable
set oPathVariable = CreateObject("SAAuto14.ISWiPathVariables")
set oPathVariable = oProject.ISWiPathVariables
Dim sVariable
set sVariable = CreateObject("SAAuto14.ISWiPathVariable")
set sVariable = oPathVariable.Item(WScript.arguments(2))
sVariable.Value = WScript.arguments(3)
oProject.SaveProject
oProject.CloseProject
Set sVariable=Nothing
Set oPathVariable=Nothing
Set oProject=Nothing
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 12, 2008
09:46 AM
Thanks for posting this rasky74!
At first I was a bit confused by the implementation below, however, what I was missing was the following.
oPathVariable is a collection of all the Path Variables found in the specified project.
sPathVariable is the specific item from that collection.
Even with that bit of confusion your post saved me a bit of time figuring out how to modify a path variable using the automation interface.
DebbieL, if you happen to read this post perhaps you can suggest that this be example added to the help documentation for ISWiPathVariables and ISWiPathVariable (note that the first one is a collection, the second a specific item from that collection). The reason for this is that in looking in the documentation it is not clear that the user has to actually create a collection before modifying one item of that collection.
Thanks.
At first I was a bit confused by the implementation below, however, what I was missing was the following.
oPathVariable is a collection of all the Path Variables found in the specified project.
sPathVariable is the specific item from that collection.
Even with that bit of confusion your post saved me a bit of time figuring out how to modify a path variable using the automation interface.
DebbieL, if you happen to read this post perhaps you can suggest that this be example added to the help documentation for ISWiPathVariables and ISWiPathVariable (note that the first one is a collection, the second a specific item from that collection). The reason for this is that in looking in the documentation it is not clear that the user has to actually create a collection before modifying one item of that collection.
Thanks.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 13, 2008
08:39 AM
Thanks, rasky74! And thanks for the suggestion, Dan! An example in the documentation would be helpful. I created IOC-000069203 to log this doc enhancement.
Regards,
Debbie Landers
Macrovision Corporation
Regards,
Debbie Landers
Macrovision Corporation