예제 #1
0
 // Install / Upgrade / Re-install the VSIX plugin
 public void InstallVsixPackage(IPackage currentPackage, IPackage newPackage, Action onComplete = null)
 {
     downloadThreads.Add(RunThread(() =>
     {
         if (!isSafeToProcess())
         {
             return;
         }
         Info("Preparing VSIX Upgrade");
         OnProcessing();
         try
         {
             if (currentPackage != null)
             {
                 store.UninstallPackage(currentPackage);
             }
             IsDownloading = true;
             store.InstallPackage(newPackage.Id, newPackage.Version);
             IsDownloading = false;
             // Now installs the plugin
             Info("Installing plugin for Visual Studio");
             store.InstallVsix(newPackage);
         }
         catch (Exception)
         {
             ShowErrorDialog("VSIX package cannot be retrieved!");
         }
         finally
         {
             IsDownloading = false;
         }
         SdkVersionManager.synchronizeData();
         OnSDKVersionsUpdated();
         Info("");
         OnIdle();
         if (onComplete != null)
         {
             onComplete();
         }
     }));
 }