Hello Kevin,
How to keep setting Server1, Server2, Server3 ...etc in the list
This can be done in the following way: we will have a property which stores a number and we will increment that number (through a custom action) each time the user presses the
"Add" button.
Here are the steps that are required in order to achieve that:
1. first of all, we will have to declare the property which will store our number. In order to do so, please go to
"Install Parameters" page --> and create a property as it follows:
Name: NUMBER
Value: 0
Comment: leave empty
2. now that we have created the property, it is time to create the custom action that will take as input this property and increment its value every time the user presses the
"Add" button. To do so, please proceed as it follows:
- go to
"Custom Actions" page.
- add a
"PowerShellScriptInline" custom action without sequence (by pressing the
"Add custom action without sequence" button which is placed to the right side of the custom action's name).
- the custom action should look something as it follows:
Code: Select all
# Block for declaring the script parameters.
Param()
# Your code goes here.
# get the vlaue of the NUMBER property and stores it in $number_string variable
$number_string = AI_GetMsiProperty NUMBER
# converts the $number_string variable from string to integer so we can increment it
$number_int = [int]$number_string
# increments the variable
$number_int = $number_int + 1
# set the property to the new value of the variable
AI_SetMsiProperty NUMBER $number_int
3. now that the custom action is created, it is time to schedule it when the
"Add" button is pressed. To do so, please proceed as it follows:
- go to
"Dialogs" page
- select the dialog that contains the listbox / combobox control
- select the
"Add" button
- go to
"Published Events" tab and create a new published event as it follows:
Event: Execute Custom Action
Argument: the PowerShell script we have earlier created
Condition: leave empty
- place this at the top of your events list by selecting it and pressing the "
Up" button (until it reaches the top)
Attached below you can find another sample project which is based on the first sample project I have given you:
and when I remove Server2, that Server3 will become Server2.
I am afraid that this is not possible - or at least I can not think of any way in which you can achieve it.
And how can I use this list to bulid/edit XML file .
Here it depends what you want to do. This can also be achieved through a custom action.
Hope this helps.
Best regards,
Catalin