Exemplo n.º 1
0
        protected override void Execute()
        {
            // Check if the wsp if newer than dll's, CS and xml files.
            WSPFileHandle    wspHandle = new WSPFileHandle(this.DTEInstance);
            WSPBuilderHandle wspTool   = new WSPBuilderHandle(this.DTEInstance);

            DialogResult result = DialogResult.No;

            if (wspHandle.ProjectFilesHaveChanged())
            {
                result = MessageBox.Show(Strings.NEEDTOREBUILDSOLUTION,
                                         Strings.REBUILD,
                                         MessageBoxButtons.YesNoCancel);
            }
            if (result == DialogResult.Yes)
            {
                this.DTEInstance.Application.Solution.SolutionBuild.Build(true);
                if (this.DTEInstance.Application.Solution.SolutionBuild.LastBuildInfo > 0)
                {
                    MessageBox.Show("Build Failed. Unable to deploy");
                }
                else
                {
                    wspTool.RunWSPBuilder(wspHandle.SelectedProject.FullPath, "-BuildWSP true -deploy true");
                }
            }
            else
            {
                if (result == DialogResult.No)
                {
                    wspTool.Deploy(wspHandle.SelectedProject.FullPath);
                }
            }
        }
Exemplo n.º 2
0
        protected override void Execute()
        {
            // Check if the wsp if newer than dll's, CS and xml files.
            WSPFileHandle    wspHandle = new WSPFileHandle(this.DTEInstance);
            WSPBuilderHandle wspTool   = new WSPBuilderHandle(this.DTEInstance);

            DialogResult result = DialogResult.No;

            if (wspHandle.ProjectFilesHaveChanged())
            {
                result = MessageBox.Show("One or more files in the project have changed!\r\n\r\n" +
                                         "Do you want to rebuild the project and create a\r\n" +
                                         "new solution package (WSP) before upgrading?",
                                         "Rebuild!",
                                         MessageBoxButtons.YesNoCancel);
            }
            if (result == DialogResult.Yes)
            {
                this.DTEInstance.Application.Solution.SolutionBuild.Build(true);
                wspTool.RunWSPBuilder(wspHandle.SelectedProject.FullPath, "-BuildWSP true -Upgrade " + wspHandle.WspFileInfo.Name);
            }
            else
            {
                if (result == DialogResult.No)
                {
                    wspTool.Upgrade(wspHandle.SelectedProject.FullPath);
                }
            }
        }