예제 #1
0
        /// <summary>
        /// Create installer based on current platform
        /// </summary>
        /// <returns></returns>
        public static Installer CreateInstaller(Bootstrapper bootstrapper)
        {
            Installer installer;

            if (IsWindows)
            {
                installer = new VsixInstaller(bootstrapper);
            }
            else
            {
                installer = new PkgInstaller(bootstrapper);
            }
            return(installer);
        }
예제 #2
0
        public async Task Install(CancellationToken token = new CancellationToken())
        {
            if (string.IsNullOrEmpty(Url))
            {
                if (Channel == null)
                {
                    throw new ArgumentNullException(nameof(Channel));
                }
                if (Product == null)
                {
                    throw new ArgumentNullException(nameof(Product));
                }

                Logger.WriteLine("* Automatic URL resolving is a new feature. File issues at: https://github.com/jonathanpeppers/boots/issues");

                var resolver = Helpers.IsMac ?
                               (UrlResolver) new MacUrlResolver(this) :
                               (UrlResolver) new WindowsUrlResolver(this);
                Url = await resolver.Resolve(Channel.Value, Product.Value);
            }

            Installer installer;

            if (Helpers.IsWindows)
            {
                installer = new VsixInstaller(this);
            }
            else
            {
                installer = new PkgInstaller(this);
            }

            using (var downloader = new Downloader(this, installer.Extension)) {
                await downloader.Download(token);

                await installer.Install(downloader.TempFile, token);
            }
        }
예제 #3
0
        public async Task Install(CancellationToken token = new CancellationToken())
        {
            if (string.IsNullOrEmpty(Url))
            {
                throw new ArgumentNullException(nameof(Uri));
            }

            Installer installer = null;

            if (Helpers.IsWindows)
            {
                installer = new VsixInstaller(this);
            }
            else
            {
                installer = new PkgInstaller(this);
            }

            using (var downloader = new Downloader(this, installer.Extension)) {
                await downloader.Download(token);

                await installer.Install(downloader.TempFile, token);
            }
        }