I don't know much about the operation of this code, but I don't believe
you can set a default. I would not describe VBScript as the best
language for custom actions, but in this particular case it's more
harmless than some of the uses it gets put to. 

 

I can't remember where I got it from, but it's the type of generic
custom action that shows up in several forums such as the ones at
Installsite.org and community.installshield.com. Even this InstallShield
stuff can be useful:

 

http://www.macrovision.com/products/installation/installshield/res_4744.
htm 

 

Phil Wilson 

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Thursday, October 04, 2007 8:16 AM
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] dynamically fill a combobox

 

Hi Phil,

Thanks, that is exactly what I was looking for. Unfortunately I am not
very common with vbscript but it seems the best language for Windows
Installer Custom Actions. Is it also possible to set one value as
default (because I read the MSI SDK and it seems that there is no column
for this)?

Is there also a nice source where I can gain some examples of
customactions using vbscript?

Greetings Peter

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Wilson,
Phil
Sent: Tuesday, October 02, 2007 7:59 PM
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] dynamically fill a combobox

 

Collected but not used by me, this VBScript used in a custom action may
help:

 

Function Combo()

 

' This function initializes and then sets variables to set values for
the four columns

' of the ComboBox table (Property, Order, Value and Text).  Then a
function is called to add

' the row of values to the table.

 

'  Initialize variables used for each column of the ComboBox table

            Dim ComboProp

            Dim ComboOrder

            Dim ComboValue

            Dim ComboText

 

'  Set properties for each of the four columns

            ComboProp = "COMBO"

            ComboOrder = 1

            ComboValue = "Dog"

            ComboText = "Dog"

 

'  Call function to add this row of values to the ComboBox table

            addToComboBox ComboProp, ComboOrder, ComboValue, ComboText

 

'Repeat Process as needed

 

            ComboProp = "COMBO"

            ComboOrder = 2

            ComboValue = "Cat"

            ComboText = "Cat"

            addToComboBox ComboProp, ComboOrder, ComboValue, ComboText

 

            ComboProp = "COMBO"

            ComboOrder = 3

            ComboValue = "Frog"

            ComboText = "Frog"

            addToComboBox ComboProp, ComboOrder, ComboValue, ComboText

 

            ComboProp = "COMBO"

            ComboOrder = 4

            ComboValue = "Bird"

            ComboText = "Bird"

            addToComboBox ComboProp, ComboOrder, ComboValue, ComboText

 

End Function

 

 

 

Function addToComboBox(ByVal ComboProp, ByVal ComboOrder, ByVal
ComboValue, ByVal ComboText)

 

' This function takes values passed into it from the function call and
uses these values to create

' and execute a view within the current session of the Windows Installer
object.  This view is based

' on a SQL query constructed using the values passed into the function.
If you wish to get a deeper

' understanding of how this function works you should read up on the
Windows Installer object

' model in the Windows Installer SDK.

 

' Initialize variables

            Dim query

            Dim view

 

' Construct query based on values passed into the function.

' NOTE:  The ` character used is not a single quote, but rather a back
quote.  This character is typically

' found on the key used for the ~ symbol in the upper left of the
keyboard.

 

            query = "INSERT INTO `ComboBox` (`Property`, `Order`,
`Value`, `Text`) VALUES ('" & ComboProp & "', " & ComboOrder & ", '" &
ComboValue & "', '" & ComboText & "') TEMPORARY"

 

 

' This statement creates the view object based on our query

            Set view = Session.Database.OpenView(query)

 

' This statement executes the view, which actually adds the row into the
ComboBox table.

            view.Execute

 

End Function

=========================================================

 

Phil Wilson 

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Tuesday, October 02, 2007 1:24 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] dynamically fill a combobox

 

Hi,

I want to use a custom action to fill dynamically a combobox. But I do
not know how the output of the custom action should look like. I only
think to know that I have to bind a property to the ouput to get the
selected item of the combobox.

 

Regards, Peter

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to