Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wix C# Custom Action not executing at all

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.

like image 846
Wotuu Avatar asked Jan 30 '14 15:01

Wotuu


People also ask

What is Wix used for?

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.

Is Wix owned by Google?

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.

Which is best Wix or squarespace?

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.

What is squarespace for?

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.


1 Answers

<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".

like image 85
Isaiah4110 Avatar answered Sep 17 '22 17:09

Isaiah4110