private async Task InnerExcuteAsync(UserProject project)
        {
            string error = "";

            if (CertificateSerive.StartSignServer(out error))
            {
                var connected = await CertificateSerive.Connect();

                if (!connected)
                {
                    AutoPackage2019Package.VSOutput.OutputStringThreadSafe($"【{DateTime.Now}】:自动打包结束---{project.SolutionName}\r\n");
                    return;
                }
                await PackageService.Pack(project);

                CertificateSerive.DisConnect();
            }
            else
            {
                VsShellUtilities.ShowMessageBox(
                    this.package,
                    $"自动签名工具启动失败,{error}",
                    "错误",
                    OLEMSGICON.OLEMSGICON_INFO,
                    OLEMSGBUTTON.OLEMSGBUTTON_OK,
                    OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
            }
            AutoPackage2019Package.VSOutput.OutputStringThreadSafe($"【{DateTime.Now}】:自动打包结束---{project.SolutionName}\r\n");
        }
Beispiel #2
0
        public Form1()
        {
            InitializeComponent();
            S s = new S()
            {
                USBToolClientPath = @"",
                SignServerPath    = @"",
                ServerIP          = "",
                ServerPort        = ""
            };

            CertificateSerive.Initial(s);
            PackageService.Initial(s);
        }
Beispiel #3
0
        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        /// <param name="cancellationToken">A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down.</param>
        /// <param name="progress">A provider for progress updates.</param>
        /// <returns>A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method.</returns>
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            // When initialized asynchronously, the current thread may be a background thread at this point.
            // Do any initialization that requires the UI thread after switching to the UI thread.
            await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            var options = (OptionPageGrid)GetDialogPage(typeof(OptionPageGrid));

            CertificateSerive.Initial((IVSConfig)GetDialogPage(typeof(OptionPageGrid)));
            PackageService.Initial((IVSConfig)GetDialogPage(typeof(OptionPageGrid)));
            options.OnPropertyChanged += Options_OnPropertyChanged;
            VSOutput = (IVsOutputWindowPane) await GetServiceAsync(typeof(SVsGeneralOutputWindowPane));

            await AutoPackageCommand.InitializeAsync(this);
        }
Beispiel #4
0
        private async void button1_Click(object sender, EventArgs e)
        {
            string error   = "";
            var    project = new UserProject("xxxxx", "D:\\ApowerCompress\\trunck\\src\\ApowerCompress\\ApowerCompress.csproj", "D:\\ApowerCompress\\trunck\\src");

            if (CertificateSerive.StartSignServer(out error))
            {
                var connected = await CertificateSerive.Connect();

                if (!connected)
                {
                    return;
                }
                await PackageService.Pack(project);

                CertificateSerive.DisConnect();
            }
            else
            {
                MessageBox.Show($"自动签名工具启动失败,{error}");
            }
        }
Beispiel #5
0
 private void Options_OnPropertyChanged()
 {
     CertificateSerive.Initial((IVSConfig)GetDialogPage(typeof(OptionPageGrid)));
     PackageService.Initial((IVSConfig)GetDialogPage(typeof(OptionPageGrid)));
 }