public PackageInstallResult CleanUp(PackageInstallModel model)
        {
            var ins     = new global::Umbraco.Web._Legacy.Packager.Installer(Security.CurrentUser.Id);
            var tempDir = IOHelper.MapPath(model.TemporaryDirectoryPath);

            ins.LoadConfig(IOHelper.MapPath(model.TemporaryDirectoryPath));
            ins.InstallCleanUp(model.Id, IOHelper.MapPath(model.TemporaryDirectoryPath));

            var clientDependencyConfig  = new ClientDependencyConfiguration(Logger);
            var clientDependencyUpdated = clientDependencyConfig.UpdateVersionNumber(
                UmbracoVersion.SemanticVersion, DateTime.UtcNow, "yyyyMMdd");


            var redirectUrl = "";

            if (ins.Control.IsNullOrWhiteSpace() == false)
            {
                redirectUrl = string.Format("/developer/framed/{0}",
                                            Uri.EscapeDataString(
                                                string.Format("/umbraco/developer/Packages/installer.aspx?installing=custominstaller&dir={0}&pId={1}&customControl={2}&customUrl={3}", tempDir, model.Id, ins.Control, ins.Url)));
            }

            return(new PackageInstallResult
            {
                Id = model.Id,
                ZipFilePath = model.ZipFilePath,
                PackageGuid = model.PackageGuid,
                RepositoryGuid = model.RepositoryGuid,
                TemporaryDirectoryPath = model.TemporaryDirectoryPath,
                PostInstallationPath = redirectUrl
            });
        }
Beispiel #2
0
        public HttpResponseMessage CleanupInstallation(InstallPackageModel model)
        {
            model.PackageFile = HttpUtility.UrlDecode(model.PackageFile);
            var installer = new global::Umbraco.Web._Legacy.Packager.Installer(UmbracoContext.Current.Security.CurrentUser.Id);

            installer.LoadConfig(model.PackageFile);
            installer.InstallCleanUp(model.ManifestId, model.PackageFile);

            // library.RefreshContent is obsolete, would need to RefreshAll... snapshot,
            // but it should be managed automatically by services and caches!
            //DistributedCache.Instance.RefreshAll...();

            return(Json(new
            {
                success = true,
                model.ManifestId,
                model.PackageFile,
                percentage = 100,
                message = "Starter kit has been installed"
            }, HttpStatusCode.OK));
        }