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
- :
- Re: ListBox populated with temp data
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 21, 2013
11:35 AM
ListBox populated with temp data
Hi,
I am trying to populate a ListBox with a VB Script at runtime in my basic MSI project.
The trouble is every time I run it, the control is populated with "#temp0005", not the value I actually set it to.
After clearing the ListBox, I add a fixed value as follows:
Set oViewList = Session.Database.OpenView("SELECT * FROM `ListBox` WHERE `Property`='PYTHONVERSIONS'")
r = 1
Set oReccombo = Session.Installer.CreateRecord(4)
oReccombo.StringData(1) = "PYTHONVERSIONS"
'MsgBox "StringData(1) is: " & oReccombo.StringData(1)
oReccombo.IntegerData(2) = 1
'MsgBox "StringData(2) is: " & oReccombo.StringData(2)
oReccombo.StringData(3) = "Zob"
'MsgBox "StringData(3) is: " & oReccombo.StringData(3)
oReccombo.StringData(4) = "Zob"
'MsgBox "StringData(4) is: " & oReccombo.StringData(4)
oViewList.Modify msiViewModifyInsertTemporary, oReccombo
oViewList.close
The CA is run after CostFinalize in the Install UI sequence. But the ListBox is populated with "#temp0005" instead of "Zob".
Thanks in advance.
🙂
I am trying to populate a ListBox with a VB Script at runtime in my basic MSI project.
The trouble is every time I run it, the control is populated with "#temp0005", not the value I actually set it to.
After clearing the ListBox, I add a fixed value as follows:
Set oViewList = Session.Database.OpenView("SELECT * FROM `ListBox` WHERE `Property`='PYTHONVERSIONS'")
r = 1
Set oReccombo = Session.Installer.CreateRecord(4)
oReccombo.StringData(1) = "PYTHONVERSIONS"
'MsgBox "StringData(1) is: " & oReccombo.StringData(1)
oReccombo.IntegerData(2) = 1
'MsgBox "StringData(2) is: " & oReccombo.StringData(2)
oReccombo.StringData(3) = "Zob"
'MsgBox "StringData(3) is: " & oReccombo.StringData(3)
oReccombo.StringData(4) = "Zob"
'MsgBox "StringData(4) is: " & oReccombo.StringData(4)
oViewList.Modify msiViewModifyInsertTemporary, oReccombo
oViewList.close
The CA is run after CostFinalize in the Install UI sequence. But the ListBox is populated with "#temp0005" instead of "Zob".
Thanks in advance.
🙂
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 21, 2013
02:22 PM
I think that you need to call the Execute method on the View object before adding a record as follows:
Set oViewList = Session.Database.OpenView("SELECT * FROM `ListBox`")
oViewList.Execute
r = 1
Set oReccombo = Session.Installer.CreateRecord(4)
oReccombo.StringData(1) = "PYTHONVERSIONS"
'MsgBox "StringData(1) is: " & oReccombo.StringData(1)
oReccombo.IntegerData(2) = 1
'MsgBox "StringData(2) is: " & oReccombo.StringData(2)
oReccombo.StringData(3) = "Zob"
'MsgBox "StringData(3) is: " & oReccombo.StringData(3)
oReccombo.StringData(4) = "Zob"
'MsgBox "StringData(4) is: " & oReccombo.StringData(4)
oViewList.Modify msiViewModifyInsertTemporary, oReccombo
oViewList.close
Hope that helps.
Set oViewList = Session.Database.OpenView("SELECT * FROM `ListBox`")
oViewList.Execute
r = 1
Set oReccombo = Session.Installer.CreateRecord(4)
oReccombo.StringData(1) = "PYTHONVERSIONS"
'MsgBox "StringData(1) is: " & oReccombo.StringData(1)
oReccombo.IntegerData(2) = 1
'MsgBox "StringData(2) is: " & oReccombo.StringData(2)
oReccombo.StringData(3) = "Zob"
'MsgBox "StringData(3) is: " & oReccombo.StringData(3)
oReccombo.StringData(4) = "Zob"
'MsgBox "StringData(4) is: " & oReccombo.StringData(4)
oViewList.Modify msiViewModifyInsertTemporary, oReccombo
oViewList.close
Hope that helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 22, 2013
03:43 AM
Thanks, but that didn't help unfortunately.
Another thing I noticed: the ListBox is initially populated with "3202DC". If I then hit next and back, the value is then "#temp0005".
Any other ideas?
Another thing I noticed: the ListBox is initially populated with "3202DC". If I then hit next and back, the value is then "#temp0005".
Any other ideas?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 23, 2013
09:24 AM
You might also be missing a Fetch or two. For an example, please see this ancient newsletter tip (PDF): http://resources.flexerasoftware.com/web/pdf/archive/msiaccess.pdf.
(Beware obviously bad formatting and line breaks in the example there, such as "WH ERE". The similar InstallShield help topic "Windows Installer API Functions Example" has the queries and function sequence correct.)
(Beware obviously bad formatting and line breaks in the example there, such as "WH ERE". The similar InstallShield help topic "Windows Installer API Functions Example" has the queries and function sequence correct.)
![](/skins/images/8C9D13A71C7F7695F3262372C0172D68/responsive_peak/images/icon_anonymous_message.png)