1

I have an installer class setup with the following methods to run as my custom action:

public Installer1()
{
    InitializeComponent();

    #if DEBUG
        Debugger.Launch(); //enables debugging
    #endif
}


protected override void OnBeforeInstall(IDictionary savedState)
{
    base.OnBeforeInstall(savedState);

    ModifyConfig();
}


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

    if (targetSite == null) throw new InstallException("IIS site name not specified");
    else
    {
        //CreateApplicationPool();
        //CreateWebsite();
        //AssignAppPool();
    }
}

I've commented out most of what happens in the install method as at this point I was simply trying to test ModifyConfig(). When I run the installer the debugger is launched as expected. However, when I then move through the code line by line the OnBeforeInstall method is skipped completely and it jumps straight to the Install method. Continuing through it never hits OnBeforeInstall.

This method was added after Intall, but I thought that this would be hit before Install automatically. What am I missing?

sr28
  • 4,728
  • 5
  • 36
  • 67

2 Answers2

0

I commented out the public Installer1() {...} and it then fired the OnBeforeInstall method. So, it's fixed, but I don't know why. If anyone ever knows why I'd be interested in knowing.

sr28
  • 4,728
  • 5
  • 36
  • 67
0

Install Addon must be built manually, before the Installer build.

Emma
  • 27,428
  • 11
  • 44
  • 69
Habin
  • 1