Custom Actions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Angela

    #1

    Custom Actions

    I wrote a class that I intended to be a custom action. I
    added the DLL for the class to the setup project using the
    CustomActions editor.
    When I run the installer it completely ignores the custom
    action I set up.

    First I put everything in the class constructor in the
    order I wanted it performed, I thought maybe the
    constructor would be called by the installer. Well, that
    didn't work so I created a Main method just to see if that
    would help. In Main() I called the constructor. I ran
    the installer and it still ignored my custom action.

    How do I "hook up" the custom actions so that they will
    actually be performed?


  • Dmitriy Lapshin [C# / .NET MVP]

    #2
    Re: Custom Actions

    Angela,

    I assume you are talking about .NET assembly when you say "DLL".
    Then, you should inherit your class from the dedicated
    System.Configur ation.Install.I nstaller class and adorn it with the
    [RunInstaller(tr ue)] attribute. Then, add event handlers for events
    like AfterInstall and BeforeUninstall to carry out your custom
    routines.

    After that, open the "Custom Actions" view of your deployment project
    and add new custom actions for Install/Uninstall phases. Specify your
    DLL as source file (be sure to include it to the list of installed
    files), and ensure the InstallerClass property has been set to True.

    That works like a charm for me and I hope this should also work OK
    for you.

    --
    Dmitriy Lapshin [C# / .NET MVP]
    X-Unity Test Studio

    Bring the power of unit testing to VS .NET IDE

    "Angela" <Angela.Sprange r@globalcrossin g.com> wrote in message
    news:024f01c372 42$8a4806d0$a30 1280a@phx.gbl.. .[color=blue]
    > I wrote a class that I intended to be a custom action. I
    > added the DLL for the class to the setup project using the
    > CustomActions editor.
    > When I run the installer it completely ignores the custom
    > action I set up.
    >
    > First I put everything in the class constructor in the
    > order I wanted it performed, I thought maybe the
    > constructor would be called by the installer. Well, that
    > didn't work so I created a Main method just to see if that
    > would help. In Main() I called the constructor. I ran
    > the installer and it still ignored my custom action.
    >
    > How do I "hook up" the custom actions so that they will
    > actually be performed?
    >
    >[/color]

    Comment

    Working...