I have an installer which has a custom screen containing a button. When that button is pressed, a Custom Action must run which verifies a few things, and returns success or an 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 Action XML
<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 have tried a lot of things. Attaching a debugger, doesn't work. Returning success or failure, doesn't seem to matter anything. Heck, it doesn't even start up the calculator when you click the button. I did notice that changing the entry point for the custom action didn't seem to matter at all.
I also read something about MakeSfxCA.exe, but I couldn't for the life of me find ANYWHERE on how to make it work properly. But I also read that Visual Studio should do it for you if you added the Custom Action project as a Custom Action Project, which I did.
I'm at a complete loss here. Why won't this work? It shows success everywhere but it just does not execute any code at all.
Wix is a free, user-friendly, website building platform. Our intuitive technology and powerful built-in features give our users the freedom to design professional websites with ease that look amazing on any device.
PRO TIP: No, Wix is not owned by Google. Wix is an online platform that allows users to create their own websites. While it is not owned by Google, the company has a close relationship with the search giant, and Wix is one of Google's official web creation tools.
Squarespace features a better blogging tool than Wix and offers excellent support. The main difference between Wix and Squarespace is ease of use. Wix is slightly more beginner-friendly, especially since they also offer Wix ADI, which is a separate editor, targeted at beginners.
Squarespace is an all-in-one content management system, or CMS. With a single subscription, you can make a website, host your content, register your own custom domain name, sell products, track your site's analytics, and much more.
<CustomAction Id="VerifyDatabaseConnectionCA"
BinaryKey="DatabaseCustomAction.CA.dll"
DllEntry="VerifyDatabaseConnection2"
Execute="immediate"
Return="check"/>
Check you DLLEntry name "VerifyDatabaseConnection2" but you actual custom action method name is "VerifyDatabaseConnection" (2 is missing, so that was never getting called").
Also change the publish element to call "VerifyDatabaseConnectionCA" instead of "VerifyDatabaseConnection".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With