Beispiel #1
0
        List <string> runPostInstallAndCleanup(Version newCurrentVersion, bool isBootstrapping)
        {
            log.Debug(CultureInfo.InvariantCulture, "AppDomain ID: {0}", AppDomain.CurrentDomain.Id);

            fixPinnedExecutables(newCurrentVersion);

            var shortcutsToIgnore = cleanUpOldVersions(newCurrentVersion);
            var targetPath        = getDirectoryForRelease(newCurrentVersion);

            return(runPostInstallOnDirectory(targetPath.FullName, isBootstrapping, newCurrentVersion, shortcutsToIgnore));
        }
Beispiel #2
0
        void CopyFileToLocation(FileSystemInfoBase target, IPackageFile x)
        {
            var targetPath = Path.Combine(target.FullName, x.EffectivePath);

            var fi = fileSystem.GetFileInfo(targetPath);

            if (fi.Exists)
            {
                fi.Delete();
            }

            var dir = fileSystem.GetDirectoryInfo(Path.GetDirectoryName(targetPath));

            if (!dir.Exists)
            {
                dir.Create();
            }

            using (var inf = x.GetStream())
                using (var of = fi.Open(FileMode.CreateNew, FileAccess.Write)) {
                    log.Debug("Writing {0} to app directory", targetPath);
                    inf.CopyTo(of);
                }
        }