예제 #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);
                }
            }
        }
예제 #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);
                }
            }
        }
예제 #3
0
        /// <summary>
        /// Create a deployment folder
        /// Added Feb 2008 by Tom Clarkson
        /// </summary>
        protected override void Execute()
        {
            WSPFileHandle    wspHandle = new WSPFileHandle(this.DTEInstance);
            WSPBuilderHandle wspTool   = new WSPBuilderHandle(this.DTEInstance);

            wspTool.RunWSPBuilder(wspHandle.SelectedProject.FullPath, "-BuildWSP true -CreateDeploymentFolder all ");
        }
예제 #4
0
        protected override void Execute()
        {
            WSPFileHandle wspHandle = new WSPFileHandle(this.DTEInstance);

            // this.DTEInstance.Application.Solution.SolutionBuild.Build(true);

            ProjectPaths     projectPaths = new ProjectPaths(this.DTEInstance.SelectedProject);
            WSPBuilderHandle wspTool      = new WSPBuilderHandle(this.DTEInstance);

            wspTool.RunWSPBuilder(wspHandle.SelectedProject.FullPath, "-BuildWSP true -projectassembly \"" + projectPaths.OutputFilePath + "\"");
        }
예제 #5
0
        protected override vsCommandStatus Status()
        {
            vsCommandStatus status = vsCommandStatus.vsCommandStatusNinched | vsCommandStatus.vsCommandStatusSupported;

            if (this.DTEInstance.SelectedProject != null)
            {
                WSPFileHandle wspHandle = new WSPFileHandle(this.DTEInstance);
                if (wspHandle.WspFilename != null)
                {
                    status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                }
            }

            return(status);
        }
예제 #6
0
        protected override void Execute()
        {
            WSPFileHandle wspHandle = new WSPFileHandle(this.DTEInstance);

            DialogResult result = DialogResult.No;

            if (result != DialogResult.Cancel)
            {
                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");
                        return; // Exit
                    }
                }

                this.DTEInstance.BuildWindow.Clear();
                this.DTEInstance.BuildWindow.Activate();

                // First recycle all Application pools
                AppPoolHandle appPools = new AppPoolHandle(this.DTEInstance);
                appPools.RecycleAppPools();

                // Should the owstimer service be recycled?
                // Should the Admin service be recycled?


                // Copy to Global Assembly Cache.
                // Install the assembly into the GAC with force
                // --------------------------------------------
                ProjectPaths projectPaths = new ProjectPaths(this.DTEInstance.SelectedProject);

                int      count      = 0;
                bool     errorFound = false;
                string[] dllFiles   = GetDLLS(projectPaths.OutputPathDLL);

                foreach (string dllPath in dllFiles)
                {
                    if (dllPath.EndsWith("Microsoft.SharePoint.dll", StringComparison.OrdinalIgnoreCase) ||
                        dllPath.EndsWith("Microsoft.SharePoint.Security.dll", StringComparison.OrdinalIgnoreCase) ||
                        dllPath.EndsWith("Microsoft.SharePoint.Search.dll", StringComparison.InvariantCultureIgnoreCase) ||
                        dllPath.EndsWith("Microsoft.Office.Server.Search.dll", StringComparison.InvariantCultureIgnoreCase)
                        )
                    {
                        // Do not include Microsoft dlls
                        continue;
                    }
                    else
                    {
                        InstallAssemblyIntoGAC(dllPath);
                    }

                    count++;
                }

                if (errorFound)
                {
                    this.DTEInstance.WriteBuildAndStatusBar("Error copying to Global Assembly Cache!");
                }
                else
                {
                    if (count > 0)
                    {
                        this.DTEInstance.WriteBuildAndStatusBar("Done copy to Global Assembly Cache!");
                    }
                    else
                    {
                        this.DTEInstance.WriteBuildAndStatusBar("No DLL's found!");
                    }
                }
            }
        }