]> granicus.if.org Git - icinga2/commitdiff
Add "Install NSClient++" check box in the Windows wizard
authorGunnar Beutner <gunnar@beutner.name>
Mon, 15 Jun 2015 09:19:18 +0000 (11:19 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Mon, 15 Jun 2015 09:19:18 +0000 (11:19 +0200)
fixes #9263

CMakeLists.txt
agent/windows-setup-agent/SetupWizard.Designer.cs
agent/windows-setup-agent/SetupWizard.cs

index a67762f11005ed72a18dbba3d46b10f9187f0fde..203a77e6177d600afd74dab79b224110369fdc59 100644 (file)
@@ -280,6 +280,9 @@ set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
 include(InstallRequiredSystemLibraries)
 
 if(WIN32)
+  file(DOWNLOAD http://files.nsclient.org/released/NSCP-0.4.3.143-Win32.msi ${CMAKE_CURRENT_BINARY_DIR}/NSCP-Win32.msi)
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/NSCP-Win32.msi DESTINATION ${CMAKE_INSTALL_SBINDIR})
+
   install(
     PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
       ${OPENSSL_INCLUDE_DIR}/../bin/libeay32.dll ${OPENSSL_INCLUDE_DIR}/../bin/ssleay32.dll
index 6245d5adc36f9a3b335294e2884a4d892f3db6d1..e026f66e67d6644560a2c0a0e2381bbbe0d6cb18 100644 (file)
@@ -38,6 +38,9 @@
                        this.lblConfigStatus = new System.Windows.Forms.Label();
                        this.prgConfig = new System.Windows.Forms.ProgressBar();
                        this.tabParameters = new System.Windows.Forms.TabPage();
+                       this.groupBox3 = new System.Windows.Forms.GroupBox();
+                       this.chkAcceptConfig = new System.Windows.Forms.CheckBox();
+                       this.chkAcceptCommands = new System.Windows.Forms.CheckBox();
                        this.txtTicket = new System.Windows.Forms.TextBox();
                        this.lblTicket = new System.Windows.Forms.Label();
                        this.txtInstanceName = new System.Windows.Forms.TextBox();
                        this.txtError = new System.Windows.Forms.TextBox();
                        this.lblError = new System.Windows.Forms.Label();
                        this.picBanner = new System.Windows.Forms.PictureBox();
-                       this.groupBox3 = new System.Windows.Forms.GroupBox();
-                       this.chkAcceptCommands = new System.Windows.Forms.CheckBox();
-                       this.chkAcceptConfig = new System.Windows.Forms.CheckBox();
+                       this.chkInstallNSCP = new System.Windows.Forms.CheckBox();
                        this.tabFinish.SuspendLayout();
                        this.tabConfigure.SuspendLayout();
                        this.tabParameters.SuspendLayout();
+                       this.groupBox3.SuspendLayout();
                        this.groupBox2.SuspendLayout();
                        this.groupBox1.SuspendLayout();
                        this.tbcPages.SuspendLayout();
@@ -89,7 +91,6 @@
                        this.grpX509Fields.SuspendLayout();
                        this.tabError.SuspendLayout();
                        ((System.ComponentModel.ISupportInitialize)(this.picBanner)).BeginInit();
-                       this.groupBox3.SuspendLayout();
                        this.SuspendLayout();
                        // 
                        // btnBack
                        this.tabParameters.Text = "Agent Parameters";
                        this.tabParameters.UseVisualStyleBackColor = true;
                        // 
+                       // groupBox3
+                       // 
+                       this.groupBox3.Controls.Add(this.chkInstallNSCP);
+                       this.groupBox3.Controls.Add(this.chkAcceptConfig);
+                       this.groupBox3.Controls.Add(this.chkAcceptCommands);
+                       this.groupBox3.Location = new System.Drawing.Point(308, 359);
+                       this.groupBox3.Name = "groupBox3";
+                       this.groupBox3.Size = new System.Drawing.Size(301, 111);
+                       this.groupBox3.TabIndex = 5;
+                       this.groupBox3.TabStop = false;
+                       this.groupBox3.Text = "Advanced Options";
+                       // 
+                       // chkAcceptConfig
+                       // 
+                       this.chkAcceptConfig.AutoSize = true;
+                       this.chkAcceptConfig.Location = new System.Drawing.Point(9, 47);
+                       this.chkAcceptConfig.Name = "chkAcceptConfig";
+                       this.chkAcceptConfig.Size = new System.Drawing.Size(190, 17);
+                       this.chkAcceptConfig.TabIndex = 1;
+                       this.chkAcceptConfig.Text = "Accept config updates from master";
+                       this.chkAcceptConfig.UseVisualStyleBackColor = true;
+                       // 
+                       // chkAcceptCommands
+                       // 
+                       this.chkAcceptCommands.AutoSize = true;
+                       this.chkAcceptCommands.Location = new System.Drawing.Point(9, 24);
+                       this.chkAcceptCommands.Name = "chkAcceptCommands";
+                       this.chkAcceptCommands.Size = new System.Drawing.Size(171, 17);
+                       this.chkAcceptCommands.TabIndex = 0;
+                       this.chkAcceptCommands.Text = "Accept commands from master";
+                       this.chkAcceptCommands.UseVisualStyleBackColor = true;
+                       // 
                        // txtTicket
                        // 
                        this.txtTicket.Location = new System.Drawing.Point(98, 45);
                        this.picBanner.TabIndex = 1;
                        this.picBanner.TabStop = false;
                        // 
-                       // groupBox3
-                       // 
-                       this.groupBox3.Controls.Add(this.chkAcceptConfig);
-                       this.groupBox3.Controls.Add(this.chkAcceptCommands);
-                       this.groupBox3.Location = new System.Drawing.Point(308, 359);
-                       this.groupBox3.Name = "groupBox3";
-                       this.groupBox3.Size = new System.Drawing.Size(301, 111);
-                       this.groupBox3.TabIndex = 5;
-                       this.groupBox3.TabStop = false;
-                       this.groupBox3.Text = "Advanced Settings";
+                       // chkInstallNSCP
                        // 
-                       // chkAcceptCommands
-                       // 
-                       this.chkAcceptCommands.AutoSize = true;
-                       this.chkAcceptCommands.Location = new System.Drawing.Point(9, 24);
-                       this.chkAcceptCommands.Name = "chkAcceptCommands";
-                       this.chkAcceptCommands.Size = new System.Drawing.Size(171, 17);
-                       this.chkAcceptCommands.TabIndex = 0;
-                       this.chkAcceptCommands.Text = "Accept commands from master";
-                       this.chkAcceptCommands.UseVisualStyleBackColor = true;
-                       // 
-                       // chkAcceptConfig
-                       // 
-                       this.chkAcceptConfig.AutoSize = true;
-                       this.chkAcceptConfig.Location = new System.Drawing.Point(9, 47);
-                       this.chkAcceptConfig.Name = "chkAcceptConfig";
-                       this.chkAcceptConfig.Size = new System.Drawing.Size(190, 17);
-                       this.chkAcceptConfig.TabIndex = 1;
-                       this.chkAcceptConfig.Text = "Accept config updates from master";
-                       this.chkAcceptConfig.UseVisualStyleBackColor = true;
+                       this.chkInstallNSCP.AutoSize = true;
+                       this.chkInstallNSCP.Location = new System.Drawing.Point(9, 70);
+                       this.chkInstallNSCP.Name = "chkInstallNSCP";
+                       this.chkInstallNSCP.Size = new System.Drawing.Size(149, 17);
+                       this.chkInstallNSCP.TabIndex = 6;
+                       this.chkInstallNSCP.Text = "Install/Update NSClient++";
+                       this.chkInstallNSCP.UseVisualStyleBackColor = true;
                        // 
                        // SetupWizard
                        // 
                        this.tabConfigure.PerformLayout();
                        this.tabParameters.ResumeLayout(false);
                        this.tabParameters.PerformLayout();
+                       this.groupBox3.ResumeLayout(false);
+                       this.groupBox3.PerformLayout();
                        this.groupBox2.ResumeLayout(false);
                        this.groupBox2.PerformLayout();
                        this.groupBox1.ResumeLayout(false);
                        this.tabError.ResumeLayout(false);
                        this.tabError.PerformLayout();
                        ((System.ComponentModel.ISupportInitialize)(this.picBanner)).EndInit();
-                       this.groupBox3.ResumeLayout(false);
-                       this.groupBox3.PerformLayout();
                        this.ResumeLayout(false);
 
                }
         private System.Windows.Forms.GroupBox groupBox3;
         private System.Windows.Forms.CheckBox chkAcceptConfig;
         private System.Windows.Forms.CheckBox chkAcceptCommands;
+       private System.Windows.Forms.CheckBox chkInstallNSCP;
        }
 }
 
index 3ade5edc706ace9f9bb76ca1c0c965c1aa99ef26..15952c76a83734fbef036be5b1a88a8ca363e578 100644 (file)
@@ -176,6 +176,17 @@ namespace Icinga
 
                private void ConfigureService()
                {
+                       if (chkInstallNSCP.Checked)
+                       {
+                               SetConfigureStatus(0, "Waiting for NSClient++ installation to complete...");
+
+                               Process proc = new Process();
+                               proc.StartInfo.FileName = "msiexec.exe";
+                               proc.StartInfo.Arguments = "/i \"" + Program.Icinga2InstallDir + "\\sbin\\NSCP-Win32.msi\"";
+                               proc.Start();
+                               proc.WaitForExit();
+                       }
+
                        SetConfigureStatus(0, "Updating configuration files...");
 
                        string output;