[mapguide-commits] r6677 - in trunk/Installer: . Installers/MapGuide Support/Paraffin

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue May 22 09:50:40 EDT 2012


Author: jng
Date: 2012-05-22 06:50:39 -0700 (Tue, 22 May 2012)
New Revision: 6677

Modified:
   trunk/Installer/Installers/MapGuide/MapGuide.wxs
   trunk/Installer/Paraffin.exe
   trunk/Installer/Paraffin.pdb
   trunk/Installer/Support/Paraffin/Main.cs
Log:
#2006: Modify paraffin to auto-create wix components with <CreateFolder /> elements for all empty directories under .svn. This allows for these directories to be created by the installer, ensuring a pristine and functional SVN working copy is installed.
#1850: Turn off viewer/devguide samples in installer where language choice does not match.

Modified: trunk/Installer/Installers/MapGuide/MapGuide.wxs
===================================================================
--- trunk/Installer/Installers/MapGuide/MapGuide.wxs	2012-05-21 16:12:25 UTC (rev 6676)
+++ trunk/Installer/Installers/MapGuide/MapGuide.wxs	2012-05-22 13:50:39 UTC (rev 6677)
@@ -498,7 +498,7 @@
             <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="FdoArcSdeProviderFeature" Order="3">1</Publish>
             <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="FdoKingOracleProviderFeature" Order="4">1</Publish>
             <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="FdoMySqlProviderFeature" Order="5">1</Publish>
-            <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="FdoPostgreSqlProviderFeature" Order="7">1</Publish>
+            <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="FdoPostgreSqlProviderFeature" Order="6">1</Publish>
             <!-- If Apache, or IIS and the .Net Framework is not installed, set feature default for the ASPX viewer to not install -->
             <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="WebExtMapViewerASPXFeature" Order="7">(MGWEB_CONFIG=&quot;APACHE&quot;) OR (MGWEB_CONFIG=&quot;IIS&quot; AND NOT NETFRAMEWORK40FULL)</Publish>
             <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="NewDialog" Value="ApacheConfigDlg" Order="8">MGWEB_CONFIG=&quot;APACHE&quot;</Publish>
@@ -511,14 +511,16 @@
                 - Java Viewer
                 - Java Viewer Sample
                 - Java DevGuide Sample
+                - PHP Viewer Sample
+                - PHP DevGuide Sample
             -->
             <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="WebExtApacheFeature" Order="10">MGWEB_CONFIG=&quot;IIS&quot;</Publish>
             <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="WebExtTomcatFeature" Order="11">MGWEB_CONFIG=&quot;IIS&quot;</Publish>
             <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="WebExtMapViewerJSPFeature" Order="12">MGWEB_CONFIG=&quot;IIS&quot;</Publish>
             <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="WebExtJavaDevGuideSamplesFeature" Order="13">MGWEB_CONFIG=&quot;IIS&quot;</Publish>
             <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="WebExtJavaViewerSampleFeature" Order="14">MGWEB_CONFIG=&quot;IIS&quot;</Publish>
-			<Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="WebExtPhpDevGuideSamplesFeature">MGWEB_CONFIG=&quot;IIS&quot;</Publish>
-			<Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="WebExtPhpViewerSampleFeature">MGWEB_CONFIG=&quot;IIS&quot;</Publish>
+			      <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="WebExtPhpDevGuideSamplesFeature">MGWEB_CONFIG=&quot;IIS&quot;</Publish>
+			      <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="Remove" Value="WebExtPhpViewerSampleFeature">MGWEB_CONFIG=&quot;IIS&quot;</Publish>
             <Publish Dialog="WebServerConfigDlgIIS" Control="Next" Event="NewDialog" Value="IPConfigDlg" Order="13">MGWEB_CONFIG=&quot;MANUAL&quot;</Publish>
             <Publish Dialog="WebServerConfigDlgIIS" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
             <Publish Dialog="WebServerConfigDlgIIS" Control="Cancel" Event="SpawnDialog" Value="CancelDlg">1</Publish>
@@ -604,9 +606,13 @@
             <Publish Dialog="IISLangConfigDlg" Control="Next" Event="NewDialog" Value="IIS7ConfigDlg" Order="4">IISVERSIONMAJOR=&quot;#7&quot;</Publish>
             <!-- Default feature settings for PHP API - AddLocal required in case user changes mind and comes back -->
             <Publish Dialog="IISLangConfigDlg" Control="Next" Event="Remove" Value="WebExtMapViewerASPXFeature">IIS_API_TYPE=&quot;PHP&quot;</Publish>
+            <Publish Dialog="IISLangConfigDlg" Control="Next" Event="Remove" Value="WebExtDotNetDevGuideSamplesFeature">IIS_API_TYPE=&quot;PHP&quot;</Publish>
+            <Publish Dialog="IISLangConfigDlg" Control="Next" Event="Remove" Value="WebExtDotNetViewerSampleFeature">IIS_API_TYPE=&quot;PHP&quot;</Publish>
             <Publish Dialog="IISLangConfigDlg" Control="Next" Event="AddLocal" Value="WebExtMapViewerPHPFeature">IIS_API_TYPE=&quot;PHP&quot;</Publish>
             <!-- Default feature settings for ASP.Net API - AddLocal required in case user changes mind and comes back -->
             <Publish Dialog="IISLangConfigDlg" Control="Next" Event="Remove" Value="WebExtMapViewerPHPFeature">IIS_API_TYPE=&quot;DOTNET&quot;</Publish>
+            <Publish Dialog="IISLangConfigDlg" Control="Next" Event="Remove" Value="WebExtPhpDevGuideSamplesFeature">IIS_API_TYPE=&quot;DOTNET&quot;</Publish>
+            <Publish Dialog="IISLangConfigDlg" Control="Next" Event="Remove" Value="WebExtPhpViewerSampleFeature">IIS_API_TYPE=&quot;DOTNET&quot;</Publish>
             <Publish Dialog="IISLangConfigDlg" Control="Next" Event="AddLocal" Value="WebExtMapViewerASPXFeature">IIS_API_TYPE=&quot;DOTNET&quot;</Publish>
             <!-- Handle special "Back" actions to set UI properties -->
             <Publish Dialog="IISLangConfigDlg" Control="Back" Event="DoAction" Value="MgWeb_Config_To_IIS_CA" Order="1">1</Publish> 

Modified: trunk/Installer/Paraffin.exe
===================================================================
(Binary files differ)

Modified: trunk/Installer/Paraffin.pdb
===================================================================
(Binary files differ)

Modified: trunk/Installer/Support/Paraffin/Main.cs
===================================================================
--- trunk/Installer/Support/Paraffin/Main.cs	2012-05-21 16:12:25 UTC (rev 6676)
+++ trunk/Installer/Support/Paraffin/Main.cs	2012-05-22 13:50:39 UTC (rev 6677)
@@ -130,7 +130,7 @@
         internal static Int32 Main ( string [] args )
         {
             LoadProcessFeatureMap();
-
+            
             directoryNumber = 0;
             componentNumber = 0;
             errorMessage = String.Empty;
@@ -216,6 +216,8 @@
 
             ProcessFeatureMap(doc, Path.GetFileNameWithoutExtension(argValues.FileName) );
 
+            GenerateCreateFolderElements(doc, ".svn", argValues.Win64);
+
             // We're done, save it!
             doc.Save ( argValues.FileName );
             return ( 0 );
@@ -239,7 +241,40 @@
             }
         }
 
+        static int createEmptyFolderCounter = 1;
+
         /// <summary>
+        /// Generates <CreateFolder/> elements for all empty directory elements under the specified name
+        /// </summary>
+        /// <param name="doc"></param>
+        /// <param name="rootDirName"></param>
+        private static void GenerateCreateFolderElements(XDocument doc, string rootDirName, bool win64)
+        {
+            var matches = doc.Descendants("{" + nsWiX3 + "}Directory").Where(x => x.Attribute("Name").Value == rootDirName);
+            foreach (var dir in matches)
+            {
+                int count = 0;
+                Console.WriteLine("\tChecking Directory (Id=" + dir.Attribute("Id") + ") for empty directories");
+                foreach (var emptyDir in dir.Descendants("{" + nsWiX3 + "}Directory").Where(x => !x.HasElements))
+                {
+                    //If you just so happen to have a component named CreateEmptyFolderComponent, well ... too bad :P
+                    var componentId = (emptyDir.Attribute("Id").Value + "CreateEmptyFolderComponent" + createEmptyFolderCounter).Replace(" ", string.Empty);
+                    var el = new XElement("{" + nsWiX3 + "}Component",
+                        new XAttribute("Id", componentId),
+                        new XAttribute("Win64", win64 ? "yes" : "no"),
+                        new XAttribute("Feature", "SvnMetadataFeature"),
+                        new XAttribute("Guid", Guid.NewGuid().ToString()),
+                        new XElement("{" + nsWiX3 + "}CreateFolder")
+                    );
+                    emptyDir.Add(el);
+                    createEmptyFolderCounter++;
+                    count++;
+                }
+                Console.WriteLine(count + " CreateFolder elements generated");
+            }
+        }
+
+        /// <summary>
         /// Performs a search through the given XDocument for Directory fragments
         /// whose name matches the specified items in the FeatureMap, for each matching
         /// directory, all of its child elements will be assigned to the specified feature
@@ -385,6 +420,8 @@
 
                 ProcessFeatureMap(outputDoc, Path.GetFileNameWithoutExtension(outputFile));
 
+                GenerateCreateFolderElements(outputDoc, ".svn", argValues.Win64);
+
                 // All OK, Jumpmaster!
                 outputDoc.Save ( outputFile );
             }



More information about the mapguide-commits mailing list