Re: Adding install-time behavior to core

Apr 18, 2011 at 12:09 PM
the only thing in common between the VisualStudio and the PowerShellCmdlets is Core :(. so I guess it'll have to go there.

/kzu

--
Daniel Cazzulino | Developer Lead | MS MVP | Clarius Consulting | +1 425.329.3471


On Mon, Apr 18, 2011 at 08:44, Daniel Cazzulino <kzu@clariusconsulting.net> wrote:
From the powershell host, the code path is different too :(. The init/install script is run from

- ProcessPackageBaseCommand.OnPackageReferenceAdded

Anyway, kinda weird.
I'll put my code in a separate class and add the call to it from all three places, I guess.

/kzu

--
Daniel Cazzulino | Developer Lead | MS MVP | Clarius Consulting | +1 425.329.3471


On Mon, Apr 18, 2011 at 08:27, Daniel Cazzulino <kzu@clariusconsulting.net> wrote:
I'm giving Add Import during package install a shot and found that there are a couple places/code-paths (so far) that perform the Install script execution, and I don't know where I should be putting my logic:

InstalledHandler:
- VsPackageManager.RunSolutionAction
- PackagesProviderBase.OnPackageInstalled (runs Install scripts)
- VsPackageInstaller.InstallPackage (also runs Install scripts :S)

I first placed my code in the last one, which was the first I found, and when it never hit the breakpoints, I learned about the other code path that goes to PackagesProviderBase :(.

So, two questions:
- When is VsPackageInstaller.InstallPackage called? Is this legacy code?
- Should I put the behavior in the PackagesProviderBase? This seems weird as the class is within the PackageManagerUI folder and I certainly want the behavior to trigger also for console-installed packages...


Thanks in advance.

/kzu

--
Daniel Cazzulino | Developer Lead | MS MVP | Clarius Consulting | +1 425.329.3471