internal void NotifyUninstalled(PackageOperationEventArgs e)
 {
     if (PackageUninstalled != null)
     {
         PackageUninstalled(new VsPackageMetadata(e.Package, e.InstallPath));
     }
 }
 internal void NotifyInstalling(PackageOperationEventArgs e)
 {
     if (PackageInstalling != null)
     {
         PackageInstalling(new VsPackageMetadata(e.Package, e.InstallPath));
     }
 }
        protected override void OnUninstalled(PackageOperationEventArgs e)
        {
            base.OnUninstalled(e);

            PackageEvents.NotifyUninstalled(e);
            _deleteOnRestartManager.MarkPackageDirectoryForDeletion(e.Package);
        }
        private void OnPackageReferenceRemoving(object sender, PackageOperationEventArgs e)
        {
            var projectManager = (IProjectManager)sender;

            Project project;
            if (!_projectManagerToProject.TryGetValue(projectManager, out project))
            {
                throw new ArgumentException(Resources.Cmdlet_InvalidProjectManagerInstance, "sender");
            }

            try
            {
                if (!project.SupportsINuGetProjectSystem())
                {
                    ExecuteScript(
                        e.InstallPath,
                        PowerShellScripts.Uninstall,
                        e.Package,
                        projectManager.GetTargetFrameworkForPackage(e.Package.Id),
                        project);
                }
            }
            catch (Exception ex)
            {
                LogCore(MessageLevel.Warning, ex.Message);
            }
        }
        private void OnPackageReferenceAdded(object sender, PackageOperationEventArgs e)
        {
            var projectManager = (IProjectManager)sender;

            Project project;
            if (!_projectManagerToProject.TryGetValue(projectManager, out project))
            {
                throw new ArgumentException(Resources.Cmdlet_InvalidProjectManagerInstance, "sender");
            }

            if (!project.SupportsINuGetProjectSystem())
            {
                ExecuteScript(e.InstallPath, PowerShellScripts.Install, e.Package, project.GetTargetFrameworkName(), project);
            }
        }
Exemple #6
0
 protected override void OnUninstalling(PackageOperationEventArgs e)
 {
     PackageEvents.NotifyUninstalling(e);
     base.OnUninstalling(e);
 }
 private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
 {
     _scriptExecutor.ExecuteInitScript(e.InstallPath, e.Package, this);
 }
 private void OnPackageReferenceRemoving(object sender, PackageOperationEventArgs e)
 {
     Project project = FindProjectFromFileSystem(e.FileSystem);
     Debug.Assert(project != null);
     try
     {
         _providerServices.ScriptExecutor.ExecuteScript(
             e.InstallPath, 
             PowerShellScripts.Uninstall, 
             e.Package, 
             project,
             GetTargetFrameworkForPackage(e.Package.Id) ?? project.GetTargetFrameworkName(),
             this);
     }
     catch (Exception ex)
     {
         // Swallow exception for uninstall.ps1. Otherwise, there is no way to uninstall a package.
         // But we log it as a warning.
         Log(MessageLevel.Warning, ExceptionUtility.Unwrap(ex).Message);
     }
 }
 private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
 {
     _providerServices.ScriptExecutor.ExecuteInitScript(e.InstallPath, e.Package, this);
     PrepareOpenReadMeFile(e);
 }
        private void OnPackageReferenceRemoving(object sender, PackageOperationEventArgs e)
        {
            var projectManager = (ProjectManager)sender;

            EnvDTE.Project project;
            if (!_projectManagerToProject.TryGetValue(projectManager, out project)) {
                throw new ArgumentException(Resources.Cmdlet_InvalidProjectManagerInstance, "sender");
            }

            ExecuteScript(e.InstallPath, PowerShellScripts.Uninstall, e.Package, project);
        }
 private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
 {
     AddToolsFolderToEnvironmentPath(e.InstallPath);
     ExecuteScript(e.InstallPath, PowerShellScripts.Init, e.Package, null);
 }
 internal void NotifyReferenceRemoved(PackageOperationEventArgs e)
 {
     if (PackageReferenceRemoved != null)
     {
         PackageReferenceRemoved(new VsPackageMetadata(e.Package, e.InstallPath));
     }
 }
        protected override void OnInstalled(PackageOperationEventArgs e)
        {
            base.OnInstalled(e);

            AddPackageToRecentRepository(e.Package, updateOnly: true);
        }
 protected override void OnInstalled(PackageOperationEventArgs e)
 {
     base.OnInstalled(e);
     PackageEvents.NotifyInstalled(e);
 }
 internal void NotifyReferenceRemoved(PackageOperationEventArgs e)
 {
     PackageReferenceRemoved(new VsPackageMetadata(e.Package, e.InstallPath, e.FileSystem));
 }
 protected override void OnUninstalling(PackageOperationEventArgs e)
 {
     PackageEvents.NotifyUninstalling(e);
     base.OnUninstalling(e);
 }
Exemple #17
0
        protected override void OnUninstalled(PackageOperationEventArgs e)
        {
            base.OnUninstalled(e);

            _deleteOnRestartManager.MarkPackageDirectoryForDeletion(e.Package, createZipPackageFromPath: path => new ZipPackage(path));
        }
 private void OnPackageReferenceAdded(object sender, PackageOperationEventArgs e)
 {
     Project project = FindProjectFromFileSystem(e.FileSystem);
     Debug.Assert(project != null);
     _providerServices.ScriptExecutor.ExecuteScript(
         e.InstallPath, 
         PowerShellScripts.Install, 
         e.Package, 
         project,
         project.GetTargetFrameworkName(),
         this);
 }
 private void OnPackageInstalling(object sender, PackageOperationEventArgs e)
 {
     // Write disclaimer text before a package is installed
     WriteDisclaimerText(e.Package);
 }
 private void PrepareOpenReadMeFile(PackageOperationEventArgs e)
 {
     // only open the read me file for the first package that initiates this operation.
     if (e.Package.Id.Equals(_originalPackageId, StringComparison.OrdinalIgnoreCase) && e.Package.HasReadMeFileAtRoot())
     {
         _readmeFile = Path.Combine(e.InstallPath, NuGetConstants.ReadmeFileName);
     }
 }
 private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
 {
     AddToolsFolderToEnvironmentPath(e.InstallPath);
     ExecuteScript(e.InstallPath, PowerShellScripts.Init, e.Package, targetFramework: null, project: null);
     PrepareOpenReadMeFile(e);
 }
 private void OnPackageReferenceRemoving(object sender, PackageOperationEventArgs e)
 {
     _scriptExecutor.ExecuteScript(e.InstallPath, PowerShellScripts.Uninstall, e.Package, _project, this);
 }
Exemple #23
0
 protected override void OnInstalled(PackageOperationEventArgs e)
 {
     base.OnInstalled(e);
     PackageEvents.NotifyInstalled(e);
 }