I have defined custom action to scan lan network computers. This action is declared as immediate and triggered after user click dialog button:
<CustomAction Id="actionGetNetworkComputers" BinaryKey="actionBinary" DllEntry="GetNetworkComputers" Execute="immediate" Return="check"/>
Custiom action code:
public static ActionResult GetNetworkComputers(Session session)
{
ListNetworkComputers.NetworkBrowser nb = new ListNetworkComputers.NetworkBrowser();
Microsoft.Deployment.WindowsInstaller.View lView = session.Database.OpenView("DELETE FROM ComboBox WHERE ComboBox.Property='SERVER_LIST'");
lView.Execute();
lView = session.Database.OpenView("SELECT * FROM ComboBox");
lView.Execute();
int Index = 1;
try
{
foreach (string s in nb.getNetworkComputers())
{
Record lRecord = session.Database.CreateRecord(4);
lRecord.SetString(1, "SERVER_LIST");
lRecord.SetInteger(2, Index);
lRecord.SetString(3, s);
lRecord.SetString(4, s);
lView.Modify(ViewModifyMode.InsertTemporary, lRecord);
++Index;
}
}
catch (Exception ex)
{
session.Log(ex.StackTrace);
}
lView.Close();
return ActionResult.Success;
}
There are 2 main problems with this:
Action is blocking, so installer window freezes until nb.getNetworkComputers reurns. If I declare action return as asyncWait, action is executed but retrieved values are not inserted to ComboBox. Also, I need some label indicating operation progress, for example: "Scanning network, please wait" and hide this label after scan ends.
Is this possible with wix? Any tips?