// Upgrade a package public void UpgradePackage(IPackage currentPackage, IPackage newPackage, Action onComplete = null) { downloadThreads.Add(RunThread(() => { if (!isSafeToProcess()) { return; } Info("Preparing Upgrade"); OnProcessing(); try { store.UninstallPackage(currentPackage); IsDownloading = true; store.InstallPackage(currentPackage.Id, newPackage.Version); } catch (Exception) { ShowErrorDialog("Could not retrieve package!"); } finally { IsDownloading = false; } SdkVersionManager.synchronizeData(); OnSDKVersionsUpdated(); Info(""); OnIdle(); if (onComplete != null) { onComplete(); } })); }
public int Run(string[] args) { // Start self update downloadThreads.Add(RunThread(SelfUpdate)); DebugStep("SelfUpdate launched"); // Scan the local installed packages IsProcessing = true; Info("Retrieving packages"); SdkVersionManager.fetchLocal(); SdkVersionManager.synchronizeData(); OnSDKVersionsUpdated(); DebugStep("Local Packages"); // Scan the remote package and update the view SdkVersionManager.fetchServer(); SdkVersionManager.synchronizeData(); OnSDKVersionsUpdated(); IsProcessing = false; if (!SdkVersionManager.serverPackages.IsEmpty()) { Info(""); } DebugStep("Get all server packages"); return(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(); } })); }
// Uninstall a package public void UninstallPackage(IPackage package, Action onComplete = null) { downloadThreads.Add(RunThread(() => { if (!isSafeToProcess()) { return; } Info("Preparing Uninstallation"); OnProcessing(); store.UninstallPackage(package); SdkVersionManager.synchronizeData(); OnSDKVersionsUpdated(); Info(""); OnIdle(); if (onComplete != null) { onComplete(); } })); }