Adding install-time behavior to core

Apr 18, 2011 at 11:28 AM
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:

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


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