I created setup project in Visual Studio for my application, I changed TextBoxes (A) and put one comboBox in it, now I need to fill that comboBox with vlues (if it is possible from my installer class). To change dialog I have used Orca.exe. I have just changed type of control (TextBox to ComboBox). Bu how to add items to this ComboBox, please help me :(
0 Comments   [ + ] Show 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.



If I understand your question, you should have an entry for your combobox in the 'Control' table. This ComboBox should be bound to a property, and the name of this property will be specified in the 'Property' column of the 'Control' table (The property should be in your 'Property' table with a default value assigned to it). Let's suppose this property is called 'COMBOPROP'. Now, I think to add multiple values to the ComboBox you should open the 'ComboBox' table in Orca and enter your ComboBox entries similar to the following:

(Columns are Property, Order, Value and Text respectively.....)
COMBOPROP 1 itemvalue1 VisibleName1
COMBOPROP 2 itemvalue2 VisibleName2
COMBOPROP 3 itemvalue3 VisibleName3.....and so on......
Answered 03/31/2009 by: captain_planet
Second Degree Brown Belt

Please log in to comment
But, I don't know with what items program should fill combo box. Every network has its own SQL server names. I have a VB script file to do this, and I have method in c# that do this, but I don't know how to put that values dynamically in combo box.
Answered 03/31/2009 by: Valerij Zajcev
Yellow Belt

Please log in to comment
You can fill a combobox dynamically using VBscript inside a custom action type 38 (This assumes the property bound to your ComboBox control is called 'COMBOPROP'). The custom action will need to execute immediately, in the User Interface sequence (exactly where depends on where your custom dialog is situated) with a condition of 'Not Installed'.

Dim MsiDb
Dim MsiInstall
Dim MsiRecord
Dim MsiView
Dim i
'create temporary changes to database
Const ModifyAction = 7

Set MsiDb = Session.Database
Set MsiInstall = Session.Installer
Set MsiView = MsiDb.OpenView("SELECT * FROM ComboBox")
Set MsiRecord = MsiInstall.CreateRecord(4)

'this For Loop will be the dynamic values which you retrieve
'(I use this simple For Loop as an example - remember 1 is the default order if your ComboBox is ordered)
For i = 2 To 5
MsiRecord.StringData(1) = "COMBOPROP"
MsiRecord.IntegerData(2) = i
MsiRecord.StringData(3) = "my value" & i
MsiRecord.StringData(4) = "readable text " & i

Call MsiView.Execute(MsiRecord)
Call MsiView.Modify (ModifyAction, MsiRecord)
Call MsiView.Close
Answered 04/01/2009 by: captain_planet
Second Degree Brown Belt

Please log in to comment
If your package is for external rather than internal consumption, you need to consider how it would handle silent installs.
Answered 04/01/2009 by: VBScab
Red Belt

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