Exemple #1
0
        /// <summary>
        /// Returns after-deploy scripts, ordered by natural sort of file paths inside each package.
        /// </summary>
        private List <Script> GetScripts(InstalledPackage package)
        {
            string afterDeployFolder = Path.GetFullPath(Path.Combine(package.Folder, "AfterDeploy"));

            if (!Directory.Exists(afterDeployFolder))
            {
                return new List <Script> {
                }
            }
            ;

            var files = Directory.GetFiles(afterDeployFolder, "*.*", SearchOption.AllDirectories)
                        .OrderBy(path => CsUtility.GetNaturalSortString(path).Replace(@"\", @" \"));

            const string expectedExtension = ".sql";
            var          badFile           = files.FirstOrDefault(file => Path.GetExtension(file).ToLower() != expectedExtension);

            if (badFile != null)
            {
                throw new FrameworkException("After-deploy script '" + badFile + "' does not have the expected extension '" + expectedExtension + "'.");
            }

            return(files.Select(path => new Script
            {
                Package = package,
                Path = path,
                Name = GetSimpleName(path, afterDeployFolder)
            })
                   .ToList());
        }
        private bool ValidateInstalledInternal(string name, string version)
        {
            var allInstalled = InstalledPackage.GetAllInstalledPackages();
            var found        = allInstalled.FirstOrDefault(x =>
            {
                if (x.Data.Name != name)
                {
                    return(false);
                }
                //match the exact version
                if (x.Data.Version == version)
                {
                    return(true);
                }
                //now try to compare the versions
                Version installed;
                Version selected;
                if (Version.TryParse(x.Data.Version, out installed) && Version.TryParse(version, out selected))
                {
                    if (installed >= selected)
                    {
                        return(true);
                    }
                }
                return(false);
            });

            if (found != null)
            {
                //this package is already installed
                return(false);
            }
            return(true);
        }
        public void Add(InstalledPackage package)
        {
            using (new SecurityDisabler())
            {
                // TODO how does this behave if the package has not been installed?

                var database = Factory.GetDatabase(DATABASE_NAME);
                var rootItem = database.GetItem(HISTORY_FOLDER_PATH);

                TemplateItem template = database.GetTemplate(PACKAGE_HISTORY_TEMPLATE_PATH);
                var          item     = rootItem.Add(package.PackageId, template);

                try
                {
                    item.Editing.BeginEdit();
                    item.Fields[PACKAGE_ID_FIELD_NAME].Value     = package.PackageId;
                    item.Fields[DATE_INSTALLED_FIELD_NAME].Value = package.DateInstalled.ToString();
                    item.Fields[DESCRIPTION_FIELD_NAME].Value    = package.Description;
                }
                finally
                {
                    item.Editing.EndEdit();
                }
            }
        }
 void InstalledPackage_BeforeDelete(InstalledPackage sender, EventArgs e)
 {
     if (sender.Data.Name == Constants.UmbracoPackageName)
     {
         Kraken.Uninstall();
     }
 }
        public IHttpActionResult Uninstall(int packageId)
        {
            try
            {
                var pack = InstalledPackage.GetById(packageId);
                if (pack == null)
                {
                    return(NotFound());
                }

                PerformUninstall(pack);

                //now get all other packages by this name since we'll uninstall all versions
                foreach (var installed in InstalledPackage.GetAllInstalledPackages()
                         .Where(x => x.Data.Name == pack.Data.Name && x.Data.Id != pack.Data.Id))
                {
                    //remove from teh xml
                    installed.Delete(Security.GetUserId());
                }
            }
            catch (Exception e)
            {
                Logger.Error <PackageInstallController>("Failed to uninstall.", e);
                throw;
            }

            return(Ok());
        }
Exemple #6
0
        public static async Task <AppxPackage> ToAppxPackage(this InstalledPackage pkg, CancellationToken cancellationToken = default)
        {
            if (pkg.InstallLocation == null)
            {
                return(null);
            }

            var manifestReader = new AppxManifestReader();

            IAppxFileReader reader;

            if (pkg.ManifestLocation == null || !File.Exists(pkg.ManifestLocation))
            {
                reader = new PackageIdentityFileReaderAdapter(PackageContext.CurrentUser, pkg.PackageId);
            }
            else
            {
                reader = new FileInfoFileReaderAdapter(pkg.ManifestLocation);
            }

            using (reader)
            {
                return(await manifestReader.Read(reader, cancellationToken).ConfigureAwait(false));
            }
        }
Exemple #7
0
        protected void rptPurchasedProducts_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var package       = e.Item.DataItem as Package;
            var lbInstall     = e.Item.FindControl("lbInstall") as LinkButton;
            var lVersionNotes = e.Item.FindControl("lVersionNotes") as Literal;

            InstalledPackage installedPackage = InstalledPackageService.InstalledPackageVersion(package.Id);
            PackageVersion   latestVersion    = null;

            // if package is installed
            if (installedPackage != null)
            {
                // check that latest version is installed
                if (package.Versions.Count > 0)
                {
                    RockSemanticVersion rockVersion = RockSemanticVersion.Parse(Rock.VersionInfo.VersionInfo.GetRockSemanticVersionNumber());
                    latestVersion = package.Versions.Where(v => v.RequiredRockSemanticVersion <= rockVersion).OrderByDescending(v => v.Id).FirstOrDefault();
                }

                if (installedPackage.VersionId != latestVersion.Id)
                {
                    lbInstall.Text = "Update";

                    lVersionNotes.Text = String.Format("<p><strong>Installed Version</strong><br/>{0}</p><p><strong>Latest Version</strong><br/>{1}</p>", installedPackage.VersionLabel, latestVersion.VersionLabel);
                }
                else
                {
                    lbInstall.Text = "Installed";
                    lbInstall.Attributes.Add("disabled", "disabled");
                    lbInstall.CssClass = "btn btn-default margin-b-md";

                    lVersionNotes.Text = String.Format("<p><strong>Installed Version</strong><br/>{0}</p>", installedPackage.VersionLabel);
                }
            }
        }
Exemple #8
0
        public async Task <HttpResponseMessage> Get()
        {
            var umbracoVersion   = UmbracoVersion.Current;
            var footprintVersion = InstalledPackage.GetAllInstalledPackages()
                                   .Select(x => x.Data)
                                   .Concat(CreatedPackage.GetAllCreatedPackages().Select(x => x.Data))
                                   .Where(x => x.Name == "Novicell Footprint")
                                   .Select(x => x.Version)
                                   .FirstOrDefault();

            if (footprintVersion == null)
            {
                LogHelper.Warn <DashboardController>("Footprint version is null.");
            }

            //Use this to return your own custom dashboard content
            //using (var http = new HttpClient())
            //{
            //    return await http.GetAsync($"http://novicell.io/Umbraco/Api/Documentation/Get?umbracoVersion={umbracoVersion}&packageVersion={footprintVersion}&cache={Random.Next()}");
            //}

            /*
             * Example structure:
             * {"umbracoVersion":"7.2.4","packageVersion":"1.4.2","content":"<div ng-controller=\"ncFootprint.Backoffice.OverviewDashboard.Controller\" class=\"ncbt-section-dashboard\">\r\n    <div class=\"span12\">\r\n        <h1>Novicell Footprint 1.4.2.1</h1>\r\n        <p>\r\n            Stay tuned on <a href=\"http://novicell.io/footprint\" target=\"_blank\" title=\"Novicell Footprint\">http://novicell.io/footprint</a> and Our for more information and documentation.\r\n        </p>\r\n\r\n        <p>\r\n        \t<b>The library provides the following methods:</b> <br /><br />\r\n        \t<code>\r\n        \tfootprint.currentVisitor.addToSegment(segmentAlias, onSuccess, onError); <br />\r\n\t\t\tfootprint.currentVisitor.isInSegment(segmentAlias, onSuccess, onError); <br />\r\n\t\t\tfootprint.currentVisitor.setId(visitorId, onSuccess, onError); <br />\r\n\t\t\tfootprint.currentVisitor.setProperties({ key1: value1, key2: value2 }, onSuccess, onError); <br />\r\n\t\t\t</code>\r\n        </p>\r\n        <br />\r\n        <p>\r\n        \t<b>Example</b><br /><br />\r\n        \t<code>\r\n        \tdocument.getElementById(\"newsletter-subscribe-form\").addEventListener(\"submit\", function (e) { <br/>\r\n\t\t\t    console.info(\"\\\"submit\\\" event listener hit.\", arguments);<br/>\r\n\t\t\t    <br/>\r\n\t\t\t    e.preventDefault();<br/>\r\n\t\t\t    <br/>\r\n\t\t\t    // TODO: Subscribe to newsletter via AJAX or somesuch.<br/>\r\n\t\t\t    <br/>\r\n\t\t\t    footprint.currentVisitor.addToSegment(\"newsletter\", function (response, xhr) {<br/>\r\n\t\t\t        console.info(\"\\\"addToSegment\\\" onSuccess.\", arguments);<br/>\r\n\t\t\t    }, function (xhr, statusText) {<br/>\r\n\t\t\t        console.info(\"\\\"addToSegment\\\" onError.\", arguments);<br/>\r\n\t\t\t    });<br/>\r\n\t\t\t});<br/>\r\n\t\t\t</code>\r\n        </p>\r\n\r\n<iframe width=\"420\" height=\"315\" src=\"https://www.youtube.com/embed/NXN0QQRWx5g?rel=0\" frameborder=\"0\" allowfullscreen></iframe>\r\n    </div>\r\n</div>"}
             *
             */
            return(null);
        }
        public void NukeRootInstallTest()
        {
            InstalledPackage ip             = new InstalledPackage();
            string           installed_path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());

            Directory.CreateDirectory(installed_path);

            ip.Install = new InstallSpec[]
            {
                new InstallSpecPath()
                {
                    Type = InstallSpecType.Root,
                    Path = installed_path
                }
            };

            ip.Nuke();

            Assert.IsFalse(Directory.Exists(installed_path));

            // Make sure that the directory is deleted even if the test fails
            if (Directory.Exists(installed_path))
            {
                Directory.Delete(installed_path);
            }
        }
        public async Task RunToolInContext(InstalledPackage package, string toolPath, string arguments, CancellationToken cancellationToken = default, IProgress <ProgressData> progress = default)
        {
            if (package == null)
            {
                throw new ArgumentNullException(nameof(package));
            }

            if (toolPath == null)
            {
                throw new ArgumentNullException(nameof(toolPath));
            }

            using (IAppxFileReader reader = new FileInfoFileReaderAdapter(package.ManifestLocation))
            {
                var maniReader = new AppxManifestReader();
                var manifest   = await maniReader.Read(reader, cancellationToken).ConfigureAwait(false);

                if (!manifest.Applications.Any())
                {
                    throw new InvalidOperationException("Cannot execute a command in this package context. The package does not have any applications defined.");
                }

                await RunToolInContext(package.PackageFamilyName, manifest.Applications[0].Id, toolPath, arguments, cancellationToken, progress).ConfigureAwait(false);
            }
        }
Exemple #11
0
        private void InstalledPackage_BeforeDelete(InstalledPackage sender, EventArgs e)
        {
            if (sender.Data.Name == Constants.PackageName)
            {
                try
                {
                    var mes    = ApplicationContext.Current.Services.MigrationEntryService;
                    var logger = ApplicationContext.Current.ProfilingLogger.Logger;

                    var migrationsRunner = new MigrationRunner(
                        mes,
                        logger,
                        new SemVersion(0),
                        new SemVersion(Constants.VersionNo),
                        Constants.PackageName);

                    var db = UmbracoContext.Current.Application.DatabaseContext.Database;

                    //calls the down method on migration UpdateExamineConfigFiles however the db entry for migration is not removed
                    //need to do that manually
                    migrationsRunner.Execute(db, false);

                    RemoveMigrationFromDb(db);
                }
                catch (Exception ex)
                {
                    LogHelper.Error <MigrationEvents>("Error running DemoPackage migration", ex);
                }
            }
        }
        private void DisplayPackageInfo()
        {
            string errorResponse = string.Empty;

            // check that store is configured
            if (StoreService.OrganizationIsConfigured())
            {
                PackageService packageService = new PackageService();
                var            package        = packageService.GetPackage(packageId, out errorResponse);

                // check for errors
                ErrorCheck(errorResponse);

                lPackageName.Text        = package.Name;
                lPackageDescription.Text = package.Description;

                lPackageImage.Text = String.Format(@"<div class=""margin-b-md"" style=""
                                background: url('{0}') no-repeat center;
                                width: 100%;
                                height: 140px;"">
                                </div>", package.PackageIconBinaryFile.ImageUrl);

                if (package.IsFree)
                {
                    lCost.Text           = "<div class='pricelabel free'><h4>Free</h4></div>";
                    lInstallMessage.Text = _installFreeMessage;
                }
                else
                {
                    lCost.Text           = string.Format("<div class='pricelabel cost'><h4>${0}</h4></div>", package.Price);
                    lInstallMessage.Text = string.Format(_installPurchaseMessage, package.Price.ToString());
                }

                if (package.IsPurchased)
                {
                    // check if it's installed
                    // determine the state of the install button (install, update, buy or installed)
                    InstalledPackage installedPackage = InstalledPackageService.InstalledPackageVersion(package.Id);

                    if (installedPackage == null)
                    {
                        lCost.Visible        = false;
                        lInstallMessage.Text = _installPreviousPurchase;
                    }
                    else
                    {
                        lCost.Visible        = false;
                        lInstallMessage.Text = _updateMessage;
                        btnInstall.Text      = "Update";
                    }
                }
            }
            else
            {
                var queryParams = new Dictionary <string, string>();
                queryParams.Add("ReturnUrl", Request.RawUrl);

                NavigateToLinkedPage("LinkOrganizationPage", queryParams);
            }
        }
Exemple #13
0
        private void DependencyStateBlock(
            DependencyDefinition definition,
            PackageRepo bestMatch,
            PackageRepo latest,
            InstalledPackage installed
            )
        {
            EditorGUILayout.LabelField(definition.Name + ":", EditorStyles.boldLabel);
            EditorGUILayout.LabelField("Requirement: " + definition.Requirement.ToString());
            if (installed != null)
            {
                EditorGUILayout.LabelField("Installed version: " + installed.Version);

                if (VersionParser.GreaterThan(bestMatch.Package.PackageVersion, installed.Version))
                {
                    EditorGUILayout.HelpBox(
                        string.Format(
                            "Package is outdated. You can update it to {0} (from {1})",
                            bestMatch.Package.PackageVersion,
                            bestMatch.Repository.ToString()
                            ),
                        MessageType.Info
                        );
                    if (GUILayout.Button("Update to version " + bestMatch.Package.PackageVersion))
                    {
                        UpliftManager.Instance().UpdatePackage(bestMatch, updateLockfile: true);
                        Init();
                        Repaint();
                    }
                }
                else
                {
                    EditorGUILayout.HelpBox("Package is up to date!", MessageType.Info);
                }

                if (!definition.Requirement.IsMetBy(installed.Version))
                {
                    EditorGUILayout.HelpBox(
                        "The version of the package currently installed does not match the requirements of your project!",
                        installed.Version != bestMatch.Package.PackageVersion ? MessageType.Warning : MessageType.Error
                        );
                }
            }
            else
            {
                EditorGUILayout.LabelField("Not yet installed");
            }

            if (latest.Package.PackageVersion != bestMatch.Package.PackageVersion)
            {
                EditorGUILayout.HelpBox(
                    string.Format(
                        "Note: there is a more recent version of the package ({0} from {1}), but it doesn't match your requirement",
                        latest.Package.PackageVersion,
                        bestMatch.Repository.ToString()
                        ),
                    MessageType.Info
                    );
            }
        }
 private void InstalledPackage_BeforeDelete(InstalledPackage sender, System.EventArgs e)
 {
     if (sender.Data.Name == ExamineInspectorConstants.PackageName)
     {
         ExamineInspectorPackageHelper.RemoveExamineInspectorTabToDashboardSectionIfExists();
     }
 }
Exemple #15
0
        public void RecordInstall(string packageId, string description, DateTime dateInstalled)
        {
            if (!_packageInstallationSettings.RecordInstallationHistory)
            {
                return;
            }

            const string formatString = "Missing {0} parameter, required as installation is being recorded";

            if (string.IsNullOrEmpty(packageId))
            {
                throw new ArgumentException(string.Format(formatString, "PackageId"));
            }
            if (string.IsNullOrEmpty(description))
            {
                throw new ArgumentException(string.Format(formatString, "Description"));
            }

            var record = new InstalledPackage
            {
                DateInstalled = dateInstalled,
                PackageId     = packageId,
                Description   = description
            };

            _packageHistoryRepository.Add(record);
        }
 /// <summary>
 /// Returns all installed packages - only shows their latest versions
 /// </summary>
 /// <returns></returns>
 public IEnumerable <InstalledPackageModel> GetInstalled()
 {
     return(InstalledPackage.GetAllInstalledPackages()
            .GroupBy(
                //group by name
                x => x.Data.Name,
                //select the package with a parsed version
                pck =>
     {
         Version pckVersion;
         return Version.TryParse(pck.Data.Version, out pckVersion)
                     ? new { package = pck, version = pckVersion }
                     : new { package = pck, version = new Version(0, 0, 0) };
     })
            .Select(grouping =>
     {
         //get the max version for the package
         var maxVersion = grouping.Max(x => x.version);
         //only return the first package with this version
         return grouping.First(x => x.version == maxVersion).package;
     })
            .Select(pack => new InstalledPackageModel
     {
         Name = pack.Data.Name,
         Id = pack.Data.Id,
         Author = pack.Data.Author,
         Version = pack.Data.Version,
         Url = pack.Data.Url,
         License = pack.Data.License,
         LicenseUrl = pack.Data.LicenseUrl,
         Files = pack.Data.Files,
         IconUrl = pack.Data.IconUrl
     })
            .ToList());
 }
Exemple #17
0
            void checkInstalledDb()
            {
                string fn = setupDir + setupInstalledDb;

                if (!File.Exists(setupInstalled))
                {
                    Console.WriteLine("Making installed packages database...");
                    List <string> toDelete = new List <string>();
                    installedPackages = new Dictionary <string, InstalledPackage>();
                    var lines = File.ReadAllLines(fn);
                    for (int l = 1; l < lines.Length; l++)
                    {
                        var package = new InstalledPackage();
                        var spaces  = lines[l].Split(' ');
                        var name    = package.Name = spaces[0];
                        var version = package.Version = spaces[1].Substring(name.Length + 1);
                        version = version.Substring(0, version.Length - 8); //remove extension
                        package.DirectlyInstalled = spaces[2] == "0" ? false : true;

                        Console.WriteLine("Working on " + name);

                        var list = setupDir + name + ".lst";
                        if (File.Exists(list + ".gz"))
                        {
                            Env.ExecCmd("gzip -d " + AssertPath(list + ".gz"));
                        }

                        if (File.Exists(list))
                        {
                            var dirs     = new List <string>();
                            var lstLines = File.ReadAllLines(list);
                            foreach (var lin in lstLines)
                            {
                                dirs.Add(lin);
                            }
                            package.Tree = lstLines.ToArray();
                            toDelete.Add(list);
                        }

                        installedPackages[name] = package;
                    }

                    Console.WriteLine("Saving DB");

                    updateInstalledPackages();

                    if (Properties.Debugging)
                    {
                        Console.WriteLine("Removing old files");
                        foreach (var del in toDelete)
                        {
                            File.Delete(del);
                        }
                        File.Delete(fn);
                    }

                    Console.WriteLine("Completed");
                }
            }
 private static IEnumerable <InstalledPackage> GetDependentPackages(InstalledPackage packageToCheck, string packagesDirectory)
 {
     return(packageToCheck.Metadata.GetDependencyGroups()
            .SelectMany(x => x.Packages)
            .Select(x => GetGlobalInstalledPackage(x.Id, x.VersionRange, packagesDirectory))
            .WhereNotNull()
            .Distinct(x => new { x.Id, x.Version }));
 }
Exemple #19
0
        public IEnumerable <InstalledPackage> GetAllInstalledPackages()
        {
            IReadOnlyDictionary <string, string?>?keyValues = _keyValueService.FindByKeyPrefix(Constants.Conventions.Migrations.KeyValuePrefix);

            var installedPackages = new Dictionary <string, InstalledPackage>();

            // Collect the package from the package migration plans
            foreach (PackageMigrationPlan plan in _packageMigrationPlans)
            {
                if (!installedPackages.TryGetValue(plan.PackageName, out InstalledPackage? installedPackage))
                {
                    installedPackage = new InstalledPackage
                    {
                        PackageName = plan.PackageName
                    };
                    installedPackages.Add(plan.PackageName, installedPackage);
                }

                var currentPlans = installedPackage.PackageMigrationPlans.ToList();
                if (keyValues is null || keyValues.TryGetValue(Constants.Conventions.Migrations.KeyValuePrefix + plan.Name,
                                                               out var currentState))
                {
                    currentState = null;
                }

                currentPlans.Add(new InstalledPackageMigrationPlans
                {
                    CurrentMigrationId = currentState,
                    FinalMigrationId   = plan.FinalState
                });

                installedPackage.PackageMigrationPlans = currentPlans;
            }

            // Collect and merge the packages from the manifests
            foreach (PackageManifest package in _manifestParser.GetManifests())
            {
                if (package.PackageName is null)
                {
                    continue;
                }

                if (!installedPackages.TryGetValue(package.PackageName, out InstalledPackage? installedPackage))
                {
                    installedPackage = new InstalledPackage
                    {
                        PackageName = package.PackageName
                    };

                    installedPackages.Add(package.PackageName, installedPackage);
                }

                installedPackage.PackageView = package.PackageView;
            }

            // Return all packages with a name in the package.manifest or package migrations
            return(installedPackages.Values);
        }
Exemple #20
0
        public async Task <List <User> > GetUsersForPackage(InstalledPackage package, CancellationToken cancellationToken = default, IProgress <ProgressData> progress = default)
        {
            var proxyObject = new GetUsersForPackageDto
            {
                Source = package.PackageId
            };

            return(await this.client.Get(proxyObject, cancellationToken, progress).ConfigureAwait(false));
        }
Exemple #21
0
        public Task DismountRegistry(InstalledPackage package, CancellationToken cancellationToken = default, IProgress <ProgressData> progress = default)
        {
            var proxyObject = new DismountRegistryDto
            {
                PackageName = package.Name
            };

            return(this.client.Invoke(proxyObject, cancellationToken, progress));
        }
Exemple #22
0
        // What's the difference between Nuke and Uninstall?
        // Nuke doesn't care for dependencies (if present)
        public void NukePackage(string packageName)
        {
            Upbring          upbring = Upbring.Instance();
            InstalledPackage package = upbring.GetInstalledPackage(packageName);

            package.Nuke();
            upbring.RemovePackage(package);
            upbring.SaveFile();
        }
Exemple #23
0
        private static void OnPackageBusinessLogicInstalled(InstalledPackage e)
        {
            EventHandler <InstalledPackage> handler = PackageBusinessLogicInstalled;

            if (handler != null)
            {
                handler(null, e);
            }
        }
Exemple #24
0
 /// <summary>
 /// Uninstall Package - Before Delete (Old style events, no V6/V7 equivelant)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void InstalledPackage_BeforeDelete(InstalledPackage sender, System.EventArgs e)
 {
     //Check which package is being uninstalled
     if (sender.Data.Name.ToLower() == "ultima")
     {
         //Start Uninstall - clean up process...
         InstallHelpers.RemoveAppConfigSections();
         InstallHelpers.RemoveHttpModule();
     }
 }
Exemple #25
0
 /// <summary>
 /// Uninstall Package - Before Delete (Old style events, no V6/V7 equivelant)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void InstalledPackage_BeforeDelete(InstalledPackage sender, System.EventArgs e)
 {
     //Check which package is being uninstalled
     if (sender.Data.Name == "Analytics")
     {
         //Start Uninstall - clean up process...
         Uninstall.RemoveSection();
         Uninstall.RemoveSectionLanguageKeys();
     }
 }
Exemple #26
0
        public Task <RegistryMountState> GetRegistryMountState(InstalledPackage package, CancellationToken cancellationToken = default, IProgress <ProgressData> progress = default)
        {
            var proxyObject = new GetRegistryMountStateDto
            {
                PackageName     = package.Name,
                InstallLocation = package.InstallLocation
            };

            return(this.client.Get(proxyObject, cancellationToken, progress));
        }
Exemple #27
0
        // What's the difference between Nuke and Uninstall?
        // Nuke doesn't care for dependencies (if present)
        public void NukePackage(string packageName)
        {
            Upbring          upbring = Upbring.Instance();
            InstalledPackage package = upbring.GetInstalledPackage(packageName);

            package.Nuke();
            upbring.RemovePackage(package);
            upbring.SaveFile();
            UnityHacks.BuildSettingsEnforcer.EnforceAssetSave();
        }
Exemple #28
0
        public Task Run(InstalledPackage package, string appId = null, CancellationToken cancellationToken = default, IProgress <ProgressData> progress = default)
        {
            var proxyObject = new RunDto
            {
                ManifestPath  = package.ManifestLocation,
                ApplicationId = appId
            };

            return(this.client.Invoke(proxyObject, cancellationToken, progress));
        }
Exemple #29
0
        public Task MountRegistry(InstalledPackage package, bool startRegedit = false, CancellationToken cancellationToken = default, IProgress <ProgressData> progress = default)
        {
            var proxyObject = new MountRegistryDto
            {
                PackageName     = package.Name,
                InstallLocation = package.ManifestLocation,
                StartRegedit    = startRegedit
            };

            return(this.client.Invoke(proxyObject, cancellationToken, progress));
        }
        public ActionResult <InstalledPackage> GetInstalledPackageByName([FromQuery] string packageName)
        {
            InstalledPackage pack = _packagingService.GetInstalledPackageByName(packageName);

            if (pack == null)
            {
                return(NotFound());
            }

            return(pack);
        }
Exemple #31
0
 /// <summary>
 /// Save installed package id and version
 /// </summary>
 /// <param name="package">Intalled package</param>
 public abstract void SavePackage(InstalledPackage package);