I have an installer that has its own screen containing a button. When this button is pressed, a custom action should be performed that checks a few things and returns success or error.
I have my button defined as follows:
<Control Type="PushButton" Id="DatabaseVerifyConnectionButton" X="118" Y="150" Width="116" Height="17" Text="Verify Connection" Property="DATABASEVERIFYCONNECTIONBUTTONPROPERTY" Default="yes">
<Publish Event="DoAction" Value="VerifyDatabaseConnection">1</Publish>
<Publish Event="SpawnDialog" Value="VerifySuccessDlg">VERIFIEDCONNECTION = "1"</Publish>
<Publish Event="SpawnDialog" Value="VerifyFailedDlg">VERIFIEDCONNECTION = "0"</Publish>
</Control>
My custom XML action
<CustomAction Id="VerifyDatabaseConnectionCA"
BinaryKey="DatabaseCustomAction.CA.dll"
DllEntry="VerifyDatabaseConnection2"
Execute="immediate"
Return="check"/>
<CustomAction Id='VerifyDatabaseConnection'
Property='VerifyDatabaseConnectionCA'
Execute='immediate'
Value="ServerIP=[DATABASESERVERIPTEXTBOXPROPERTY];Username=[DATABASEUSERNAMETEXTBOXPROPERTY];Password=[DATABASEPASSWORDTEXTBOXPROPERTY]"/>
My custom action C # code:
[CustomAction]
public static ActionResult VerifyDatabaseConnection(Session session)
{
System.Diagnostics.Process.Start(@"C:\Windows\System32\calc.exe");
return ActionResult.Failure;
}
The logs show the following:
MSI (c) (58:B4) [16:39:45:183]: Doing action: VerifyDatabaseConnection
Action 16:39:45: VerifyDatabaseConnection.
Action start 16:39:45: VerifyDatabaseConnection.
Action ended 16:39:45: VerifyDatabaseConnection. Return value 1.
I've tried a lot. Attaching a debugger does not work. Returning success or failure does not seem to matter. Damn, it doesn't even launch the calculator when you press the button. I noticed that changing the entry point for a custom action does not matter at all.
- MakeSfxCA.exe, , . , Visual Studio , Custom Action , .
. ? , .