views:

23

answers:

1

Hi,

I've got an installer with a custom action project.

I want the action to fire at install.

The action fires, when I write something to the event log, it works perfectly.

But I really need to debug the file since the action is quite complicated.

So I've got the following installer class:

namespace InstallerActions
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Configuration.Install;
    using System.Diagnostics;
    using System.IO;

    [RunInstaller(true)]
// ReSharper disable UnusedMember.Global
    public partial class DatabaseInstallerAction : Installer
// ReSharper restore UnusedMember.Global
    {
        public DatabaseInstallerAction()
        {
            InitializeComponent();
        }

        public override void Install(IDictionary stateSaver)
        {
            base.Install(stateSaver);

            System.Diagnostics.Debugger.Launch();
            System.Diagnostics.Debugger.Break(); 

                        // none of these work

            Foo();
        }
        private static void Foo()
        {

        }
    }
}

The installer just finalizes without warning me, it doesn't break, it doesn't ask me to attach a debugger.

I've tried debug and release mode. Am I missing something?

Thanks

-Snake

A: 

The solution is to fire base.Install as last. Apparently the code after base.Install is NOT executed.

Snake