Пример #1
0
        public async override Task Install(string file, CancellationToken token = new CancellationToken())
        {
            if (string.IsNullOrEmpty(file))
            {
                throw new ArgumentException(nameof(file));
            }
            if (!File.Exists(file))
            {
                throw new FileNotFoundException($"{Extension} file did not exist: {file}", file);
            }

            var vs = await GetVisualStudioDirectory(token);

            var vsixInstaller = Path.Combine(vs, "Common7", "IDE", "VSIXInstaller.exe");
            var log           = Path.GetTempFileName();

            try {
                using (var process = new AsyncProcess(Boots)
                {
                    Command = vsixInstaller,
                    Arguments = $"/quiet /logFile:{log} \"{file}\"",
                }) {
                    await process.RunAsync(token);
                }
            } finally {
                await ReadLogFile(log, token);
            }
        }
Пример #2
0
        public async override Task Install(string file, CancellationToken token = new CancellationToken())
        {
            if (string.IsNullOrEmpty(file))
            {
                throw new ArgumentException(nameof(file));
            }
            if (!File.Exists(file))
            {
                throw new FileNotFoundException($"{Extension} file did not exist: {file}", file);
            }

            using (var proc = new AsyncProcess(Boots)
            {
                Command = "/usr/sbin/installer",
                Arguments = $"-pkg \"{file}\" -target / -verbose",
                Elevate = true,
            }) {
                await proc.RunAsync(token);
            }
        }