Keygen no longer throws a command window up. Add TODOs to mirror documentation....
authorRod Widdowson <rdw@steadingsoftware.com>
Wed, 9 May 2012 11:02:15 +0000 (11:02 +0000)
committerRod Widdowson <rdw@steadingsoftware.com>
Wed, 9 May 2012 11:02:15 +0000 (11:02 +0000)
configs/keygen.bat-wix
msi/WiX/Compile.bat
msi/WiX/MergeModules/OpenSAML-schemas.wxs
msi/WiX/MergeModules/OpenSAML-x64.wxs
msi/WiX/MergeModules/OpenSAML-x86.wxs
msi/WiX/ShibbolethSP-noarch.wxs
msi/scripts/shib_edit_catalog.vbs [new file with mode: 0644]
msi/scripts/shib_edit_config_files.vbs-wix

index 2a3c3f3..45c9e11 100644 (file)
@@ -29,6 +29,7 @@ set /a DAYS=%YEARS%*365
 if not defined FQDN goto guess_fqdn\r
 \r
 :generate\r
+set PATH=%PATH%;%ProgramFiles%\Shibboleth\SP\lib\\r
 set CNF="%PREFIX%sp-cert.cnf"\r
 echo # OpenSSL configuration file for creating sp-cert.pem    >%CNF%\r
 echo [req]                                                   >>%CNF%\r
index 41e5f69..f8df921 100644 (file)
@@ -15,10 +15,10 @@ candle ShibbolethSP-registry-x86.wxs
 
 wixcop -indent:2 ShibbolethSP-main-x64.wxs
 candle ShibbolethSP-main-x64.wxs
-light -sw1055 -sice:ICE82 -o ShibbolethSP-main-x64.msi ShibbolethSP-main-x64.wixobj ShibbolethSP-exe-x64.wixobj ShibbolethSP-registry-x64.wixobj  ShibbolethSP-noarch.wixobj ShibbolethSP-exe-x86.wixobj ShibbolethSP-registry-x86.wixobj
+light -sw1055 -sice:ICE82 -o ShibbolethSP-main-x64.msi ShibbolethSP-main-x64.wixobj ShibbolethSP-exe-x64.wixobj ShibbolethSP-registry-x64.wixobj  ShibbolethSP-noarch.wixobj ShibbolethSP-exe-x86.wixobj ShibbolethSP-registry-x86.wixobj -ext WixUtilExtension.dll
 
 wixcop -indent:2 ShibbolethSP-main-x86.wxs
 candle ShibbolethSP-main-x86.wxs
-light -sw1055 -sice:ICE82 -o ShibbolethSP-main-x86.msi ShibbolethSP-main-x86.wixobj ShibbolethSP-noarch.wixobj ShibbolethSP-exe-x86.wixobj ShibbolethSP-registry-x86.wixobj
+light -sw1055 -sice:ICE82 -o ShibbolethSP-main-x86.msi ShibbolethSP-main-x86.wixobj ShibbolethSP-noarch.wixobj ShibbolethSP-exe-x86.wixobj ShibbolethSP-registry-x86.wixobj -ext WixUtilExtension.dll
 
 
index d5591ea..8791265 100644 (file)
@@ -1,5 +1,6 @@
 <?xml version='1.0' encoding='UTF-8'?>\r
 \r
+<!-- TODO roll in xmltooling, make subsidiary to Shib -->\r
 <!-- Licensed to the University Corporation for Advanced Internet\r
      Development, Inc. (UCAID) under one or more contributor license\r
      agreements.  See the NOTICE file distributed with this work for\r
index c19955f..cbf5887 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8'?>\r
-\r
+<!-- TODO roll in xmltooling, make subsidiary to Shib Ad documentation -->\r
 <!-- Licensed to the University Corporation for Advanced Internet\r
    Development, Inc. (UCAID) under one or more contributor license\r
    agreements.  See the NOTICE file distributed with this work for\r
index 92721c1..f44c829 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version='1.0' encoding='UTF-8'?>\r
+<!-- TODO roll in xmltooling make subsidiary to Shib -->\r
 \r
 <!-- Licensed to the University Corporation for Advanced Internet\r
    Development, Inc. (UCAID) under one or more contributor license\r
index 27ed33d..2a8acd4 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8'?>\r
-\r
+<!-- TODO etc is uninstallable, etc\dist isn't -->\r
 <!-- Licensed to the University Corporation for Advanced Internet\r
      Development, Inc. (UCAID) under one or more contributor license\r
      agreements.  See the NOTICE file distributed with this work for\r
         </Directory><!-- var_run -->\r
       </Directory><!-- var -->\r
     </DirectoryRef>\r
-    \r
+\r
     <Binary Id='EditConfigFileSrc' SourceFile='$(var.BuildDirectory)\cvs\2.0\cpp-sp\msi\scripts\shib_edit_config_files.vbs-wix' />\r
-    <Binary Id='KeyGenSrc' SourceFile='$(var.BuildDirectory)\cvs\2.0\cpp-sp\msi\scripts\shib_keygen.vbs' />\r
+\r
     <CustomAction Id='EditConfigFiles' \r
                   BinaryKey='EditConfigFileSrc' VBScriptCall='' Execute='deferred' Impersonate='no' />\r
-    <CustomAction Id='SetEditConfigFiles' Property='EditConfigFiles' Value='[INSTALLDIR];@;[SHIBD_PORT];@;[CommonAppDataFolder]' />\r
-    <!-- TODO use QtExecCmdLine -->\r
-    <CustomAction Id='KeyGen' BinaryKey='KeyGenSrc' VBScriptCall='' Execute='deferred' Impersonate='no' />\r
-    <CustomAction Id='SetKeyGen' Property='KeyGen' Value='[INSTALLDIR]' />\r
+    <CustomAction Id='SetEditConfigFiles' Property='EditConfigFiles' Value='[INSTALLDIR];@;[SHIBD_PORT];@;[OUR_DLL_PATH]' />\r
+\r
+    <CustomAction Id='KeyGen' BinaryKey='WixCA' DllEntry='CAQuietExec' Execute='deferred' Impersonate='no' />\r
+    <CustomAction Id='SetKeyGen' Property='KeyGen' Value='&quot;[INSTALLDIR]etc\shibboleth\keygen.bat&quot;' />\r
     \r
     <!-- TODO IIS Install (if not ALREADYINSTALLED)\r
          TODO IIS Uninstalll (if UGRADINGPRODUCTCODE) -->\r
diff --git a/msi/scripts/shib_edit_catalog.vbs b/msi/scripts/shib_edit_catalog.vbs
new file mode 100644 (file)
index 0000000..b30dff6
--- /dev/null
@@ -0,0 +1,54 @@
+Function ReadFile( filePath )\r
+   Dim theFile\r
+\r
+   'OpenTextFile args: <path>, 1 = ForReading\r
+   'If you read an empty file, VBScript throws an error for some reason\r
+   if (FileSystemObj.FileExists(filePath)) then\r
+     Set theFile = FileSystemObj.GetFile(filePath)\r
+     if (theFile.size > 0) then\r
+       Set theFile = FileSystemObj.OpenTextFile(filePath, 1)\r
+       ReadFile = theFile.ReadAll\r
+     else\r
+       ReadFile = ""\r
+     end if\r
+   else\r
+     ReadFile = ""\r
+   end if\r
+End Function\r
+\r
+Sub WriteFile( filePath, contents )\r
+   Dim theFile\r
+\r
+   'OpenTextFile args: <path>, 2 = ForWriting, True = create if not exist\r
+   Set theFile = FileSystemObj.OpenTextFile(filePath, 2, True)\r
+   theFile.Write contents\r
+End Sub\r
+\r
+Sub ReplaceInFile( filePath, lookForStr, replaceWithStr )\r
+  Dim buffer\r
+\r
+  buffer = ReadFile(filePath)\r
+  if (buffer <> "") then\r
+    buffer = Replace(buffer, lookForStr, replaceWithStr)\r
+    WriteFile filePath, buffer\r
+  end if\r
+End Sub\r
+\r
+\r
+Dim FileSystemObj, ConfigFile, ConfigFileName, XMLDir, WshShell\r
+\r
+on error resume next\r
+Set FileSystemObj = CreateObject("Scripting.FileSystemObject")\r
+if (Err = 0) then\r
+\r
+  'Get the parameters via CustomActionData\r
+  customData = Session.Property("CustomActionData")\r
+  msiProperties = split(customData,";@;")\r
+  XMLDir = msiProperties(0) ' \programdata\shibboleth\sp\xml\opensaml\\r
+  ConfigFileName = msiProperties(1) 'catalog\r
+\r
+  ConfigFile = XMLDir & ConfigFileName\r
+  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@/", XMLDir\r
+\r
+'Last End If\r
+End If
\ No newline at end of file
index cbc6bd6..a9ecb9b 100644 (file)
@@ -47,7 +47,7 @@ if (Err = 0) then
   msiProperties = split(customData,";@;")\r
   InstallDir = msiProperties(0)\r
   ShibdPort = msiProperties(1)\r
-  ProgramFiles = msiProperties(2)\r
+  ProgramData = msiProperties(2)\r
 \r
   'Remove all trailing backslashes to normalize\r
   do while (mid(InstallDir,Len(InstallDir),1) = "\")\r
@@ -65,11 +65,6 @@ if (Err = 0) then
   'Afterwards, if the config file doesn't already exist, copy up to etc/shibboleth\r
   'Also strip *.in for files in dist\r
 \r
-  'Keygen.bat is updated in placehowever\r
-  Keygen = ConfigDir & "keygen.bat"\r
-  ReplaceInFile Keygen, "@-PROGRAMFILES-@", ProgramFiles\r
-\r
-\r
   ConfigFile = DistDir & "shibd.logger.in"\r
   ReplaceInFile ConfigFile, "@-PKGLOGDIR-@", ConvertedDir & "/var/log/shibboleth"\r
   If (NOT FileSystemObj.FileExists(ConfigDir & "shibd.logger")) then\r
@@ -193,23 +188,5 @@ if (Err = 0) then
     FileSystemObj.CopyFile DistDir & "protocols.xml", ConfigDir, false\r
   End If\r
   \r
-  'Finally, fix up schema catalogs.\r
-  \r
-  XMLDir = InstallDir & "\share\xml\xmltooling\"\r
-  ConfigFile = XMLDir & "catalog.xml"\r
-  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@/", XMLDir\r
-\r
-  XMLDir = InstallDir & "\share\xml\opensaml\"\r
-  ConfigFile = XMLDir & "saml20-catalog.xml"\r
-  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@/", XMLDir\r
-  ConfigFile = XMLDir & "saml11-catalog.xml"\r
-  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@/", XMLDir\r
-  ConfigFile = XMLDir & "saml10-catalog.xml"\r
-  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@/", XMLDir\r
-\r
-  XMLDir = InstallDir & "\share\xml\shibboleth\"\r
-  ConfigFile = XMLDir & "catalog.xml"\r
-  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@/", XMLDir\r
-\r
 'Last End If\r
 End If
\ No newline at end of file