[mapguide-commits] r6484 - in trunk/Tools/MgInstantSetup: InstantSetup InstantSetup.Core

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Feb 7 10:40:11 EST 2012


Author: jng
Date: 2012-02-07 07:40:11 -0800 (Tue, 07 Feb 2012)
New Revision: 6484

Added:
   trunk/Tools/MgInstantSetup/InstantSetup.Core/AppCmd.cs
   trunk/Tools/MgInstantSetup/InstantSetup/IISConfigCtrl.resx
   trunk/Tools/MgInstantSetup/InstantSetup/app.manifest
Modified:
   trunk/Tools/MgInstantSetup/InstantSetup.Core/IISSetupConfigurationProcess.cs
   trunk/Tools/MgInstantSetup/InstantSetup.Core/InstantSetup.Core.csproj
   trunk/Tools/MgInstantSetup/InstantSetup/Form1.Designer.cs
   trunk/Tools/MgInstantSetup/InstantSetup/Form1.cs
   trunk/Tools/MgInstantSetup/InstantSetup/IISConfigCtrl.Designer.cs
   trunk/Tools/MgInstantSetup/InstantSetup/IISConfigCtrl.cs
   trunk/Tools/MgInstantSetup/InstantSetup/InstantSetup.csproj
Log:
First cut of IIS7 support for the MgInstantSetup utility. In the process of porting over the appcmd.exe calls from the wix installer, some appcmd.exe calls were invoked incorrectly which I'll have to fix in the Wix installer.

Modified: trunk/Tools/MgInstantSetup/InstantSetup/Form1.Designer.cs
===================================================================
--- trunk/Tools/MgInstantSetup/InstantSetup/Form1.Designer.cs	2012-02-06 16:43:40 UTC (rev 6483)
+++ trunk/Tools/MgInstantSetup/InstantSetup/Form1.Designer.cs	2012-02-07 15:40:11 UTC (rev 6484)
@@ -42,6 +42,7 @@
             this.txtBatchOutput = new System.Windows.Forms.TextBox();
             this.label3 = new System.Windows.Forms.Label();
             this.chkWriteMentorDictPath = new System.Windows.Forms.CheckBox();
+            this.TAB_IIS7 = new System.Windows.Forms.TabPage();
             this.tabControl1.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -62,6 +63,7 @@
                         | System.Windows.Forms.AnchorStyles.Left)
                         | System.Windows.Forms.AnchorStyles.Right)));
             this.tabControl1.Controls.Add(this.TAB_APACHE);
+            this.tabControl1.Controls.Add(this.TAB_IIS7);
             this.tabControl1.Location = new System.Drawing.Point(13, 87);
             this.tabControl1.Name = "tabControl1";
             this.tabControl1.SelectedIndex = 0;
@@ -181,6 +183,16 @@
             this.chkWriteMentorDictPath.UseVisualStyleBackColor = true;
             this.chkWriteMentorDictPath.CheckedChanged += new System.EventHandler(this.chkWriteMentorDictPath_CheckedChanged);
             // 
+            // TAB_IIS7
+            // 
+            this.TAB_IIS7.Location = new System.Drawing.Point(4, 22);
+            this.TAB_IIS7.Name = "TAB_IIS7";
+            this.TAB_IIS7.Padding = new System.Windows.Forms.Padding(3);
+            this.TAB_IIS7.Size = new System.Drawing.Size(519, 390);
+            this.TAB_IIS7.TabIndex = 2;
+            this.TAB_IIS7.Text = "IIS7";
+            this.TAB_IIS7.UseVisualStyleBackColor = true;
+            // 
             // Form1
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -222,6 +234,7 @@
         private System.Windows.Forms.TextBox txtBatchOutput;
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.CheckBox chkWriteMentorDictPath;
+        private System.Windows.Forms.TabPage TAB_IIS7;
     }
 }
 

Modified: trunk/Tools/MgInstantSetup/InstantSetup/Form1.cs
===================================================================
--- trunk/Tools/MgInstantSetup/InstantSetup/Form1.cs	2012-02-06 16:43:40 UTC (rev 6483)
+++ trunk/Tools/MgInstantSetup/InstantSetup/Form1.cs	2012-02-07 15:40:11 UTC (rev 6484)
@@ -32,6 +32,7 @@
         {
             InitializeComponent();
             _apacheConf = new ApacheConfigCtrl();
+            _iis7Conf = new IISConfigCtrl();
 
             txtServiceName.Text = "MapGuide Server Trunk";
         }
@@ -39,11 +40,22 @@
         protected override void OnLoad(EventArgs e)
         {
             _apacheConf.Wrapper.Dock = DockStyle.Fill;
+            _iis7Conf.Wrapper.Dock = DockStyle.Fill;
             TAB_APACHE.Controls.Add(_apacheConf.Wrapper);
+            TAB_IIS7.Controls.Add(_iis7Conf.Wrapper);
         }
 
         private IConfigurationView _apacheConf;
+        private IConfigurationView _iis7Conf;
 
+        private IConfigurationView GetActiveView()
+        {
+            if (tabControl1.SelectedTab == TAB_APACHE)
+                return _apacheConf;
+            else
+                return _iis7Conf;
+        }
+
         private void btnSourceDir_Click(object sender, EventArgs e)
         {
             if (folderBrowser.ShowDialog() == DialogResult.OK)
@@ -54,36 +66,36 @@
 
         private void txtSourceDirectory_TextChanged(object sender, EventArgs e)
         {
-            _apacheConf.Config.BuildOutputPath = txtSourceDirectory.Text;
+            _iis7Conf.Config.BuildOutputPath = _apacheConf.Config.BuildOutputPath = txtSourceDirectory.Text;
         }
 
         private void txtBatchOutput_TextChanged(object sender, EventArgs e)
         {
-            _apacheConf.Config.BatchFileOutputDirectory = txtBatchOutput.Text;
+            _iis7Conf.Config.BatchFileOutputDirectory = _apacheConf.Config.BatchFileOutputDirectory = txtBatchOutput.Text;
         }
 
         private void txtServiceName_TextChanged(object sender, EventArgs e)
         {
-            _apacheConf.Config.MapGuideServiceName = txtServiceName.Text;
+            _iis7Conf.Config.MapGuideServiceName = _apacheConf.Config.MapGuideServiceName = txtServiceName.Text;
         }
 
         private void chkInstallServices_CheckedChanged(object sender, EventArgs e)
         {
-            _apacheConf.Config.InstallServices = chkInstallServices.Checked;
+            _iis7Conf.Config.InstallServices = _apacheConf.Config.InstallServices = chkInstallServices.Checked;
         }
 
         private void chkWriteMentorDictPath_CheckedChanged(object sender, EventArgs e)
         {
-            _apacheConf.Config.WriteMentorDictionaryPath = chkWriteMentorDictPath.Checked;
+            _iis7Conf.Config.WriteMentorDictionaryPath = _apacheConf.Config.WriteMentorDictionaryPath = chkWriteMentorDictPath.Checked;
         }
 
         private void btnConfigure_Click(object sender, EventArgs e)
         {
             try
             {
-                _apacheConf.Config.Execute();
+                GetActiveView().Config.Execute();
                 if (!chkInstallServices.Checked)
-                    MessageBox.Show("Batch scripts saved to " + _apacheConf.Config.BatchFileOutputDirectory);
+                    MessageBox.Show("Batch scripts saved to " + GetActiveView().Config.BatchFileOutputDirectory);
                 //Service install not implemented
             }
             catch (Exception ex)

Modified: trunk/Tools/MgInstantSetup/InstantSetup/IISConfigCtrl.Designer.cs
===================================================================
--- trunk/Tools/MgInstantSetup/InstantSetup/IISConfigCtrl.Designer.cs	2012-02-06 16:43:40 UTC (rev 6483)
+++ trunk/Tools/MgInstantSetup/InstantSetup/IISConfigCtrl.Designer.cs	2012-02-07 15:40:11 UTC (rev 6484)
@@ -28,10 +28,290 @@
         /// </summary>
         private void InitializeComponent()
         {
-            components = new System.ComponentModel.Container();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.txtAppCmd = new System.Windows.Forms.TextBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.txtWebSiteName = new System.Windows.Forms.TextBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.txtVirtualDir = new System.Windows.Forms.TextBox();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.numSitePort = new System.Windows.Forms.NumericUpDown();
+            this.numClientPort = new System.Windows.Forms.NumericUpDown();
+            this.numAdminPort = new System.Windows.Forms.NumericUpDown();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.groupBox4 = new System.Windows.Forms.GroupBox();
+            this.rdDotNet = new System.Windows.Forms.RadioButton();
+            this.rdPhp = new System.Windows.Forms.RadioButton();
+            this.label7 = new System.Windows.Forms.Label();
+            this.txtAppPool = new System.Windows.Forms.TextBox();
+            this.groupBox1.SuspendLayout();
+            this.groupBox2.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.numSitePort)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.numClientPort)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.numAdminPort)).BeginInit();
+            this.groupBox4.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.groupBox1.Controls.Add(this.txtAppPool);
+            this.groupBox1.Controls.Add(this.label7);
+            this.groupBox1.Controls.Add(this.txtVirtualDir);
+            this.groupBox1.Controls.Add(this.label3);
+            this.groupBox1.Controls.Add(this.txtWebSiteName);
+            this.groupBox1.Controls.Add(this.label2);
+            this.groupBox1.Controls.Add(this.txtAppCmd);
+            this.groupBox1.Controls.Add(this.label1);
+            this.groupBox1.Location = new System.Drawing.Point(12, 133);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(390, 163);
+            this.groupBox1.TabIndex = 0;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "IIS General";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(17, 20);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(89, 13);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "appcmd.exe path";
+            // 
+            // txtAppCmd
+            // 
+            this.txtAppCmd.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.txtAppCmd.Location = new System.Drawing.Point(20, 36);
+            this.txtAppCmd.Name = "txtAppCmd";
+            this.txtAppCmd.Size = new System.Drawing.Size(346, 20);
+            this.txtAppCmd.TabIndex = 1;
+            this.txtAppCmd.TextChanged += new System.EventHandler(this.txtAppCmd_TextChanged);
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(17, 73);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(82, 13);
+            this.label2.TabIndex = 2;
+            this.label2.Text = "Web Site Name";
+            // 
+            // txtWebSiteName
+            // 
+            this.txtWebSiteName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.txtWebSiteName.Location = new System.Drawing.Point(144, 70);
+            this.txtWebSiteName.Name = "txtWebSiteName";
+            this.txtWebSiteName.Size = new System.Drawing.Size(222, 20);
+            this.txtWebSiteName.TabIndex = 3;
+            this.txtWebSiteName.TextChanged += new System.EventHandler(this.txtWebSiteName_TextChanged);
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(17, 99);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(112, 13);
+            this.label3.TabIndex = 4;
+            this.label3.Text = "Virtual Directory Name";
+            // 
+            // txtVirtualDir
+            // 
+            this.txtVirtualDir.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.txtVirtualDir.Location = new System.Drawing.Point(144, 96);
+            this.txtVirtualDir.Name = "txtVirtualDir";
+            this.txtVirtualDir.Size = new System.Drawing.Size(222, 20);
+            this.txtVirtualDir.TabIndex = 5;
+            this.txtVirtualDir.TextChanged += new System.EventHandler(this.txtVirtualDir_TextChanged);
+            // 
+            // groupBox2
+            // 
+            this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.groupBox2.Controls.Add(this.numSitePort);
+            this.groupBox2.Controls.Add(this.numClientPort);
+            this.groupBox2.Controls.Add(this.numAdminPort);
+            this.groupBox2.Controls.Add(this.label4);
+            this.groupBox2.Controls.Add(this.label5);
+            this.groupBox2.Controls.Add(this.label6);
+            this.groupBox2.Location = new System.Drawing.Point(12, 12);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Size = new System.Drawing.Size(390, 115);
+            this.groupBox2.TabIndex = 1;
+            this.groupBox2.TabStop = false;
+            this.groupBox2.Text = "Port Numbers";
+            // 
+            // numSitePort
+            // 
+            this.numSitePort.Location = new System.Drawing.Point(154, 78);
+            this.numSitePort.Maximum = new decimal(new int[] {
+            65536,
+            0,
+            0,
+            0});
+            this.numSitePort.Name = "numSitePort";
+            this.numSitePort.Size = new System.Drawing.Size(120, 20);
+            this.numSitePort.TabIndex = 5;
+            this.numSitePort.ValueChanged += new System.EventHandler(this.numSitePort_ValueChanged);
+            // 
+            // numClientPort
+            // 
+            this.numClientPort.Location = new System.Drawing.Point(154, 52);
+            this.numClientPort.Maximum = new decimal(new int[] {
+            65536,
+            0,
+            0,
+            0});
+            this.numClientPort.Name = "numClientPort";
+            this.numClientPort.Size = new System.Drawing.Size(120, 20);
+            this.numClientPort.TabIndex = 4;
+            this.numClientPort.ValueChanged += new System.EventHandler(this.numClientPort_ValueChanged);
+            // 
+            // numAdminPort
+            // 
+            this.numAdminPort.Location = new System.Drawing.Point(154, 26);
+            this.numAdminPort.Maximum = new decimal(new int[] {
+            65536,
+            0,
+            0,
+            0});
+            this.numAdminPort.Name = "numAdminPort";
+            this.numAdminPort.Size = new System.Drawing.Size(120, 20);
+            this.numAdminPort.TabIndex = 3;
+            this.numAdminPort.ValueChanged += new System.EventHandler(this.numAdminPort_ValueChanged);
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(23, 80);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(87, 13);
+            this.label4.TabIndex = 2;
+            this.label4.Text = "Site Connections";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(23, 54);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(95, 13);
+            this.label5.TabIndex = 1;
+            this.label5.Text = "Client Connections";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(23, 26);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(98, 13);
+            this.label6.TabIndex = 0;
+            this.label6.Text = "Admin Connections";
+            // 
+            // groupBox4
+            // 
+            this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.groupBox4.Controls.Add(this.rdDotNet);
+            this.groupBox4.Controls.Add(this.rdPhp);
+            this.groupBox4.Location = new System.Drawing.Point(12, 302);
+            this.groupBox4.Name = "groupBox4";
+            this.groupBox4.Size = new System.Drawing.Size(390, 50);
+            this.groupBox4.TabIndex = 4;
+            this.groupBox4.TabStop = false;
+            this.groupBox4.Text = "Preferred Default Viewer";
+            // 
+            // rdDotNet
+            // 
+            this.rdDotNet.AutoSize = true;
+            this.rdDotNet.Location = new System.Drawing.Point(111, 19);
+            this.rdDotNet.Name = "rdDotNet";
+            this.rdDotNet.Size = new System.Drawing.Size(45, 17);
+            this.rdDotNet.TabIndex = 1;
+            this.rdDotNet.TabStop = true;
+            this.rdDotNet.Text = ".Net";
+            this.rdDotNet.UseVisualStyleBackColor = true;
+            this.rdDotNet.CheckedChanged += new System.EventHandler(this.rdDotNet_CheckedChanged);
+            // 
+            // rdPhp
+            // 
+            this.rdPhp.AutoSize = true;
+            this.rdPhp.Location = new System.Drawing.Point(26, 19);
+            this.rdPhp.Name = "rdPhp";
+            this.rdPhp.Size = new System.Drawing.Size(47, 17);
+            this.rdPhp.TabIndex = 0;
+            this.rdPhp.TabStop = true;
+            this.rdPhp.Text = "PHP";
+            this.rdPhp.UseVisualStyleBackColor = true;
+            this.rdPhp.CheckedChanged += new System.EventHandler(this.rdPhp_CheckedChanged);
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Location = new System.Drawing.Point(17, 125);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(83, 13);
+            this.label7.TabIndex = 6;
+            this.label7.Text = "Application Pool";
+            // 
+            // txtAppPool
+            // 
+            this.txtAppPool.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.txtAppPool.Location = new System.Drawing.Point(144, 122);
+            this.txtAppPool.Name = "txtAppPool";
+            this.txtAppPool.Size = new System.Drawing.Size(222, 20);
+            this.txtAppPool.TabIndex = 7;
+            this.txtAppPool.TextChanged += new System.EventHandler(this.txtAppPool_TextChanged);
+            // 
+            // IISConfigCtrl
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.groupBox4);
+            this.Controls.Add(this.groupBox2);
+            this.Controls.Add(this.groupBox1);
+            this.Name = "IISConfigCtrl";
+            this.Size = new System.Drawing.Size(422, 371);
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            this.groupBox2.ResumeLayout(false);
+            this.groupBox2.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.numSitePort)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.numClientPort)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.numAdminPort)).EndInit();
+            this.groupBox4.ResumeLayout(false);
+            this.groupBox4.PerformLayout();
+            this.ResumeLayout(false);
+
         }
 
         #endregion
+
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.TextBox txtAppCmd;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox txtVirtualDir;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.TextBox txtWebSiteName;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.GroupBox groupBox2;
+        private System.Windows.Forms.NumericUpDown numSitePort;
+        private System.Windows.Forms.NumericUpDown numClientPort;
+        private System.Windows.Forms.NumericUpDown numAdminPort;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.GroupBox groupBox4;
+        private System.Windows.Forms.RadioButton rdDotNet;
+        private System.Windows.Forms.RadioButton rdPhp;
+        private System.Windows.Forms.TextBox txtAppPool;
+        private System.Windows.Forms.Label label7;
     }
 }

Modified: trunk/Tools/MgInstantSetup/InstantSetup/IISConfigCtrl.cs
===================================================================
--- trunk/Tools/MgInstantSetup/InstantSetup/IISConfigCtrl.cs	2012-02-06 16:43:40 UTC (rev 6483)
+++ trunk/Tools/MgInstantSetup/InstantSetup/IISConfigCtrl.cs	2012-02-07 15:40:11 UTC (rev 6484)
@@ -29,10 +29,24 @@
 {
     public partial class IISConfigCtrl : UserControl, IConfigurationView
     {
+        private IISSetupConfigurationProcess _confImpl;
+
         public IISConfigCtrl()
         {
             InitializeComponent();
-            this.Config = new IISSetupConfigurationProcess();
+            this.Config = _confImpl = new IISSetupConfigurationProcess();
+
+            numAdminPort.Value = _confImpl.ServerAdminPort;
+            numClientPort.Value = _confImpl.ServerClientPort;
+            numSitePort.Value = _confImpl.ServerSitePort;
+
+            txtWebSiteName.Text = _confImpl.WebSiteName;
+            txtVirtualDir.Text = _confImpl.VirtualDirectoryName;
+            txtAppPool.Text = _confImpl.ApplicationPool;
+            txtAppCmd.Text = _confImpl.AppCmdPath;
+
+            rdDotNet.Checked = _confImpl.EnableDotNet;
+            rdPhp.Checked = _confImpl.EnablePhp;
         }
 
         public AbstractSetupConfigurationProcess Config
@@ -45,5 +59,52 @@
         {
             get { return this; }
         }
+
+        private void rdDotNet_CheckedChanged(object sender, EventArgs e)
+        {
+            _confImpl.EnableDotNet = rdDotNet.Checked;
+            _confImpl.EnablePhp = rdPhp.Checked;
+        }
+
+        private void rdPhp_CheckedChanged(object sender, EventArgs e)
+        {
+            _confImpl.EnableDotNet = rdDotNet.Checked;
+            _confImpl.EnablePhp = rdPhp.Checked;
+        }
+
+        private void txtAppCmd_TextChanged(object sender, EventArgs e)
+        {
+            _confImpl.AppCmdPath = txtAppCmd.Text;
+        }
+
+        private void txtWebSiteName_TextChanged(object sender, EventArgs e)
+        {
+            _confImpl.WebSiteName = txtWebSiteName.Text;
+        }
+
+        private void txtVirtualDir_TextChanged(object sender, EventArgs e)
+        {
+            this.Config.VirtualDirectoryName = txtVirtualDir.Text;
+        }
+
+        private void numAdminPort_ValueChanged(object sender, EventArgs e)
+        {
+            this.Config.ServerAdminPort = Convert.ToInt32(numAdminPort.Value);
+        }
+
+        private void numClientPort_ValueChanged(object sender, EventArgs e)
+        {
+            this.Config.ServerClientPort = Convert.ToInt32(numClientPort.Value);
+        }
+
+        private void numSitePort_ValueChanged(object sender, EventArgs e)
+        {
+            this.Config.ServerSitePort = Convert.ToInt32(numSitePort.Value);
+        }
+
+        private void txtAppPool_TextChanged(object sender, EventArgs e)
+        {
+            _confImpl.ApplicationPool = txtAppPool.Text;
+        }
     }
 }

Added: trunk/Tools/MgInstantSetup/InstantSetup/IISConfigCtrl.resx
===================================================================
--- trunk/Tools/MgInstantSetup/InstantSetup/IISConfigCtrl.resx	                        (rev 0)
+++ trunk/Tools/MgInstantSetup/InstantSetup/IISConfigCtrl.resx	2012-02-07 15:40:11 UTC (rev 6484)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
\ No newline at end of file

Modified: trunk/Tools/MgInstantSetup/InstantSetup/InstantSetup.csproj
===================================================================
--- trunk/Tools/MgInstantSetup/InstantSetup/InstantSetup.csproj	2012-02-06 16:43:40 UTC (rev 6483)
+++ trunk/Tools/MgInstantSetup/InstantSetup/InstantSetup.csproj	2012-02-07 15:40:11 UTC (rev 6484)
@@ -14,6 +14,7 @@
     <FileAlignment>512</FileAlignment>
     <TargetFrameworkSubset>
     </TargetFrameworkSubset>
+    <ApplicationManifest>app.manifest</ApplicationManifest>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -68,6 +69,9 @@
     <EmbeddedResource Include="Form1.resx">
       <DependentUpon>Form1.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="IISConfigCtrl.resx">
+      <DependentUpon>IISConfigCtrl.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -79,6 +83,7 @@
       <DesignTime>True</DesignTime>
     </Compile>
     <None Include="app.config" />
+    <None Include="app.manifest" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>

Added: trunk/Tools/MgInstantSetup/InstantSetup/app.manifest
===================================================================
--- trunk/Tools/MgInstantSetup/InstantSetup/app.manifest	                        (rev 0)
+++ trunk/Tools/MgInstantSetup/InstantSetup/app.manifest	2012-02-07 15:40:11 UTC (rev 6484)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+    <security>
+      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+        <!-- UAC Manifest Options
+            If you want to change the Windows User Account Control level replace the 
+            requestedExecutionLevel node with one of the following.
+
+        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
+        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
+        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />
+
+            If you want to utilize File and Registry Virtualization for backward 
+            compatibility then delete the requestedExecutionLevel node.
+        -->
+        <requestedExecutionLevel level="highestAvailable" uiAccess="false" />
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
+</asmv1:assembly>

Added: trunk/Tools/MgInstantSetup/InstantSetup.Core/AppCmd.cs
===================================================================
--- trunk/Tools/MgInstantSetup/InstantSetup.Core/AppCmd.cs	                        (rev 0)
+++ trunk/Tools/MgInstantSetup/InstantSetup.Core/AppCmd.cs	2012-02-07 15:40:11 UTC (rev 6484)
@@ -0,0 +1,280 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using System.Diagnostics;
+
+namespace InstantSetup.Core
+{
+    public class AppCmd
+    {
+        //Core
+
+        /// <summary>
+        /// 0 - app pool name
+        /// </summary>
+        const string CREATE_APP_POOL = "add apppool /name:\"{0}\" /managedRuntimeVersion:\"v4.0\"";
+
+        /// <summary>
+        /// 0 - php path
+        /// </summary>
+        const string CREATE_FASTCGI = "set config /section:system.webServer/fastCGI /+\"[fullPath='{0}\\php-cgi.exe']\"";
+
+        /// <summary>
+        /// 0 - app pool name
+        /// </summary>
+        const string SET_APP_POOL_PROPERTIES = "set config /section:applicationPools /[name='{0}'].processModel.idleTimeout:00:00:00  /[name='{0}'].recycling.disallowOverlappingRotation:True";
+
+        /// <summary>
+        /// no parameters
+        /// </summary>
+        const string UNLOCK_SERVER_HANDLERS = "unlock config /section:handlers";
+
+        /// <summary>
+        /// 0 - web site name
+        /// </summary>
+        const string UNLOCK_WEBSITE_HANDLERS = "unlock config \"{0}\" /section:handlers";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir, 2 - web tier root dir
+        /// </summary>
+        const string CREATE_MAPGUIDE_VDIR = "add app /site.name:\"{0}\" /path:\"/{1}\" /physicalPath:\"{2}\\www\"";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir, 2 - php dir
+        /// </summary>
+        const string CREATE_PHP_SCRIPT_MAPPING = "set config \"{0}/{1}\" /section:handlers /+\"[name='PHP_via_FastCGI',path='*.php',verb='*',scriptProcessor='{2}\\php-cgi.exe',modules='FastCgiModule',resourceType='Unspecified']\"";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir, 2 - web tier root dir
+        /// </summary>
+        const string CREATE_MAPAGENT_VDIR = "add app /site.name:\"{0}\" /path:\"/{1}/mapagent\" /physicalPath:\"{2}\\www\\mapagent\"";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir
+        /// </summary>
+        const string UNLOCK_MAPAGENT_HANDLERS = "set config \"{0}/{1}/mapagent\" /section:handlers /accessPolicy:Read,Script,Execute";
+        
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir, 2 - web tier root dir
+        /// </summary>
+        const string SETUP_MAPAGENT_ISAPI = "set config \"{0}/{1}/mapagent\" /section:handlers /+\"[name='MapGuide MapAgent ISAPI handler',path='mapagent.fcgi',verb='*',scriptProcessor='{2}\\www\\mapagent\\isapi_MapAgent.dll',modules='IsapiModule']\"";
+
+        /// <summary>
+        /// 0 - web tier root dir
+        /// </summary>
+        const string SET_MAPAGENT_ISAPI_ACCESS = "set config /section:isapiCgiRestriction /+\"[path='{0}\\www\\mapagent\\isapi_MapAgent.dll',allowed='True',description='MapGuide MapAgent ISAPI handler']\"";
+
+        /// <summary>
+        /// 0 - app pool name
+        /// </summary>
+        const string SET_32BIT_APP_POOL = "set apppool /apppool.name:\"{0}\" /enable32BitAppOnWin64:true";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir, 2 - app pool name
+        /// </summary>
+        const string SET_MAPGUIDE_VDIR_APP_POOL = "set app \"{0}/{1}\" /applicationPool:\"{2}\"";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir, 2 - app pool name
+        /// </summary>
+        const string SET_MAPAGENT_VDIR_APP_POOL = "set app \"{0}/{1}/mapagent\" /applicationPool:\"{2}\"";
+
+        /// <summary>
+        /// no parameters
+        /// </summary>
+        const string UNLOCK_HTTP_ERRORS_SERVER = "unlock config /section:httpErrors";
+        
+        /// <summary>
+        /// 0 - web site name
+        /// </summary>
+        const string UNLOCK_HTTP_ERRORS_WEBSITE = "unlock config \"{0}\" /section:httpErrors";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir
+        /// </summary>
+        const string UNLOCK_HTTP_ERRORS_MAPGUIDE = "unlock config \"{0}/{1}\" /section:httpErrors";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir
+        /// </summary>
+        const string RESET_401_HANDLER = "set config \"{0}/{1}\" /section:httpErrors /-[statusCode='401']";
+
+        /// <summary>
+        /// no parameters
+        /// </summary>
+        const string ADD_JSON_MIME_TYPE = "set config /section:staticContent /+\"[fileExtension='.json',mimeType='application/json']\"";
+        
+        //PHP viewer
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir, 2 - web tier root dir
+        /// </summary>
+        const string CREATE_MAPVIEWERAJAX_PHP = "add app /site.name:\"{0}\" /path:\"/{1}/mapviewerajax\" /physicalPath:\"{2}\\www\\mapviewerphp\"";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir
+        /// </summary>
+        const string SET_MAPVIEWERAJAX_DEFAULT_DOC_PHP = "set config \"{0}/{1}/mapviewerajax\" /section:defaultDocument /+files.[value='ajaxviewer.php']";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir, 2 - app pool name
+        /// </summary>
+        const string SET_MAPVIEWERAJAX_PHP_APP_POOL = "set app \"{0}/{1}/mapviewerajax\" /applicationPool:\"{2}\"";
+
+        //ASP.net viewer
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir, 2 - web tier root dir
+        /// </summary>
+        const string CREATE_MAPVIEWERAJAX_NET = "add app /site.name:\"{0}\" /path:\"/{1}/mapviewerajax\" /physicalPath:\"{2}\\www\\mapviewernet\"";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir
+        /// </summary>
+        const string SET_MAPVIEWERAJAX_DEFAULT_DOC_NET = "set config \"{0}/{1}/mapviewerajax\" /section:defaultDocument /+files.[value='ajaxviewer.aspx']";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir, 2 - app pool name
+        /// </summary>
+        const string SET_MAPVIEWERAJAX_NET_APP_POOL = "set app \"{0}/{1}/mapviewerajax\" /applicationPool:\"{2}\"";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir, 2 - web tier root dir
+        /// </summary>
+        const string CREATE_MAPVIEWERNET_VDIR = "add app /site.name:\"{0}\" /path:\"/{1}/mapviewernet\" /physicalPath:\"{2}\\www\\mapviewernet\"";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir
+        /// </summary>
+        const string SET_MAPVIEWERNET_DEFAULT_DOC = "set config \"{0}/{1}/mapviewernet\" /section:defaultDocument /+files.[value='ajaxviewer.aspx']";
+
+        /// <summary>
+        /// 0 - web site name, 1 - virtual dir, 2 - app pool name
+        /// </summary>
+        const string SET_MAPVIEWERNET_APP_POOL = "set app \"{0}/{1}/mapviewernet\" /applicationPool:\"{2}\"";
+
+        private string _webSite;
+        private string _virtualDir;
+        private string _appPoolName;
+        private string _webExtensionsRootDir;
+        private string _phpDir;
+        private string _appCmdPath;
+
+        public AppCmd(string appCmdPath, string webSite, string virtualDir, string appPoolName, string webExtensionsRootDir, string phpDir)
+        {
+            if (!File.Exists(appCmdPath))
+                throw new FileNotFoundException(appCmdPath);
+            if (string.IsNullOrEmpty(webSite))
+                throw new ArgumentException("Empty value: webSite");
+            if (string.IsNullOrEmpty(virtualDir))
+                throw new ArgumentNullException("Empty value: virtualDir");
+            if (string.IsNullOrEmpty(appPoolName))
+                throw new ArgumentNullException("Empty value: appPoolName");
+            if (!Directory.Exists(webExtensionsRootDir))
+                throw new DirectoryNotFoundException(webExtensionsRootDir);
+            if (!Directory.Exists(phpDir))
+                throw new DirectoryNotFoundException(phpDir);
+
+            _appCmdPath = appCmdPath;
+            _webSite = webSite;
+            _virtualDir = virtualDir;
+            _appPoolName = appPoolName;
+            _webExtensionsRootDir = webExtensionsRootDir;
+            _phpDir = phpDir;
+        }
+
+        private Process StartAppCmdProcess(string args)
+        {
+            var psi = new ProcessStartInfo(_appCmdPath);
+            psi.Arguments = args;
+            psi.RedirectStandardOutput = true;
+            psi.UseShellExecute = false;
+            Trace.TraceInformation("Running appcmd.exe " + args);
+            return Process.Start(psi);
+        }
+
+        internal void SetupCore()
+        {
+            Process p = null;
+            p = StartAppCmdProcess(string.Format(CREATE_FASTCGI, _phpDir));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(CREATE_APP_POOL, _appPoolName));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(SET_APP_POOL_PROPERTIES, _appPoolName));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(UNLOCK_SERVER_HANDLERS);
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(UNLOCK_WEBSITE_HANDLERS, _webSite));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(CREATE_MAPGUIDE_VDIR, _webSite, _virtualDir, _webExtensionsRootDir));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(CREATE_PHP_SCRIPT_MAPPING, _webSite, _virtualDir, _phpDir));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(CREATE_MAPAGENT_VDIR, _webSite, _virtualDir, _webExtensionsRootDir));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(UNLOCK_MAPAGENT_HANDLERS, _webSite, _virtualDir));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(SETUP_MAPAGENT_ISAPI, _webSite, _virtualDir, _webExtensionsRootDir));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(SET_MAPAGENT_ISAPI_ACCESS, _webExtensionsRootDir));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(SET_32BIT_APP_POOL, _appPoolName));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(SET_MAPGUIDE_VDIR_APP_POOL, _webSite, _virtualDir, _appPoolName));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(SET_MAPAGENT_VDIR_APP_POOL, _webSite, _virtualDir, _appPoolName));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(UNLOCK_HTTP_ERRORS_SERVER);
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(UNLOCK_HTTP_ERRORS_WEBSITE, _webSite));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(RESET_401_HANDLER, _webSite, _virtualDir));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(ADD_JSON_MIME_TYPE);
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+
+            //Setup mapviewernet
+            p = StartAppCmdProcess(string.Format(CREATE_MAPVIEWERNET_VDIR, _webSite, _virtualDir, _webExtensionsRootDir));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(SET_MAPVIEWERNET_DEFAULT_DOC, _webSite, _virtualDir));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+            p = StartAppCmdProcess(string.Format(SET_MAPVIEWERNET_APP_POOL, _webSite, _virtualDir, _appPoolName));
+            Trace.TraceInformation(p.StandardOutput.ReadToEnd()); p.WaitForExit();
+            //if (p.ExitCode != 0) Debugger.Break();
+        }
+
+        internal void SetDefaultDotNetViewer()
+        {
+            StartAppCmdProcess(string.Format(CREATE_MAPVIEWERAJAX_NET, _webSite, _virtualDir, _webExtensionsRootDir)).WaitForExit();
+            StartAppCmdProcess(string.Format(SET_MAPVIEWERAJAX_DEFAULT_DOC_NET, _webSite, _virtualDir)).WaitForExit();
+            StartAppCmdProcess(string.Format(SET_MAPVIEWERAJAX_NET_APP_POOL, _webSite, _virtualDir, _appPoolName)).WaitForExit();
+        }
+
+        internal void SetDefaultPhpViewer()
+        {
+            StartAppCmdProcess(string.Format(CREATE_MAPVIEWERAJAX_PHP, _webSite, _virtualDir, _webExtensionsRootDir)).WaitForExit();
+            StartAppCmdProcess(string.Format(SET_MAPVIEWERAJAX_DEFAULT_DOC_PHP, _webSite, _virtualDir)).WaitForExit();
+            StartAppCmdProcess(string.Format(SET_MAPVIEWERAJAX_PHP_APP_POOL, _webSite, _virtualDir, _appPoolName)).WaitForExit();
+        }
+    }
+}

Modified: trunk/Tools/MgInstantSetup/InstantSetup.Core/IISSetupConfigurationProcess.cs
===================================================================
--- trunk/Tools/MgInstantSetup/InstantSetup.Core/IISSetupConfigurationProcess.cs	2012-02-06 16:43:40 UTC (rev 6483)
+++ trunk/Tools/MgInstantSetup/InstantSetup.Core/IISSetupConfigurationProcess.cs	2012-02-07 15:40:11 UTC (rev 6484)
@@ -24,6 +24,20 @@
 {
     public class IISSetupConfigurationProcess : AbstractSetupConfigurationProcess
     {
+        public IISSetupConfigurationProcess()
+            : base()
+        {
+            this.VirtualDirectoryName = "mapguide";
+
+            this.UsingIIS7 = true;
+            this.AppCmdPath = "C:\\Windows\\System32\\inetsrv\\appcmd.exe";
+            this.WebSiteName = "Default Web Site";
+            this.ApplicationPool = "MapGuideTrunkAppPool";
+
+            this.EnableDotNet = true;
+            this.EnablePhp = false;
+        }
+
         public bool EnableDotNet { get; set; }
 
         /// <summary>
@@ -32,24 +46,35 @@
         /// </summary>
         public bool UsingIIS7 { get; set; }
 
+        public string AppCmdPath { get; set; }
+
+        public string WebSiteName { get; set; }
+
+        public string ApplicationPool { get; set; }
+
         protected override void DoBackupConfigFiles()
         {
-            throw new NotImplementedException();
+            
         }
 
         protected override void ValidateConfigSettings()
         {
-            throw new NotImplementedException();
+            
         }
 
-        protected override void ConfigureWebServer()
+        protected override void WriteAdditionalBatchFiles()
         {
-            throw new NotImplementedException();
+            
         }
 
-        protected override void WriteAdditionalBatchFiles()
+        protected override void ConfigureWebServer()
         {
-            throw new NotImplementedException();
+            var cmd = new AppCmd(this.AppCmdPath, this.WebSiteName, this.VirtualDirectoryName, this.ApplicationPool, this.WebTierRootDir, this.WebTierPhpDir);
+            cmd.SetupCore();
+            if (this.EnableDotNet)
+                cmd.SetDefaultDotNetViewer();
+            else if (this.EnablePhp)
+                cmd.SetDefaultPhpViewer();
         }
     }
 }

Modified: trunk/Tools/MgInstantSetup/InstantSetup.Core/InstantSetup.Core.csproj
===================================================================
--- trunk/Tools/MgInstantSetup/InstantSetup.Core/InstantSetup.Core.csproj	2012-02-06 16:43:40 UTC (rev 6483)
+++ trunk/Tools/MgInstantSetup/InstantSetup.Core/InstantSetup.Core.csproj	2012-02-07 15:40:11 UTC (rev 6484)
@@ -40,6 +40,7 @@
   <ItemGroup>
     <Compile Include="AbstractSetupConfigurationProcess.cs" />
     <Compile Include="ApacheSetupConfigurationProcess.cs" />
+    <Compile Include="AppCmd.cs" />
     <Compile Include="IISSetupConfigurationProcess.cs" />
     <Compile Include="IniFile.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />



More information about the mapguide-commits mailing list