Updating versions, working on new installer.
[shibboleth/sp.git] / msi / scripts / shib_edit_config_files.vbs
index 0f76fe5..350681c 100644 (file)
@@ -35,7 +35,7 @@ Sub ReplaceInFile( filePath, lookForStr, replaceWithStr )
 End Sub
 
 
-Dim FileSystemObj, ConvertedDir, ConfigFile
+Dim FileSystemObj, ConvertedDir, ConfigFile, XMLDir
 Dim customData, msiProperties, InstallDir, ShibdPort
 
 on error resume next
@@ -60,15 +60,25 @@ if (Err = 0) then
   'Afterwards, if the config file doesn't already exist, copy up to etc/shibboleth
   'Also strip *.in for files in dist
 
-  ConfigFile = DistDir & "AAP.xml.in"
+  ConfigFile = DistDir & "attribute-map.xml.in"
   ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth"
-  If (NOT FileSystemObj.FileExists(ConfigDir & "AAP.xml")) then
-    FileSystemObj.CopyFile ConfigFile, ConfigDir & "AAP.xml", false
+  If (NOT FileSystemObj.FileExists(ConfigDir & "attribute-map.xml")) then
+    FileSystemObj.CopyFile ConfigFile, ConfigDir & "attribute-map.xml", false
   End If
-  If (FileSystemObj.FileExists(DistDir & "AAP.xml")) then
-    FileSystemObj.DeleteFile DistDir & "AAP.xml", true
+  If (FileSystemObj.FileExists(DistDir & "attribute-map.xml")) then
+    FileSystemObj.DeleteFile DistDir & "attribute-map.xml", true
   End If
-  FileSystemObj.MoveFile ConfigFile, DistDir & "AAP.xml"
+  FileSystemObj.MoveFile ConfigFile, DistDir & "attribute-map.xml"
+
+  ConfigFile = DistDir & "attribute-policy.xml.in"
+  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth"
+  If (NOT FileSystemObj.FileExists(ConfigDir & "attribute-policy.xml")) then
+    FileSystemObj.CopyFile ConfigFile, ConfigDir & "attribute-policy.xml", false
+  End If
+  If (FileSystemObj.FileExists(DistDir & "attribute-policy.xml")) then
+    FileSystemObj.DeleteFile DistDir & "attribute-policy.xml", true
+  End If
+  FileSystemObj.MoveFile ConfigFile, DistDir & "attribute-policy.xml"
   
   ConfigFile = DistDir & "example-metadata.xml.in"
   ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth"
@@ -80,16 +90,6 @@ if (Err = 0) then
   End If
   FileSystemObj.MoveFile ConfigFile, DistDir & "example-metadata.xml"
 
-  ConfigFile = DistDir & "IQ-metadata.xml.in"
-  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth"
-  If (NOT FileSystemObj.FileExists(ConfigDir & "IQ-metadata.xml")) then
-    FileSystemObj.CopyFile ConfigFile, ConfigDir & "IQ-metadata.xml", false
-  End If
-  If (FileSystemObj.FileExists(DistDir & "IQ-metadata.xml")) then
-    FileSystemObj.DeleteFile DistDir & "IQ-metadata.xml", true
-  End If
-  FileSystemObj.MoveFile ConfigFile, DistDir & "IQ-metadata.xml"
-
   ConfigFile = DistDir & "shibboleth.xml.in"
   ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth"
   ReplaceInFile ConfigFile, "@-PKGSYSCONFDIR-@", ConvertedDir & "/etc/shibboleth"
@@ -152,6 +152,18 @@ if (Err = 0) then
   End If
   FileSystemObj.MoveFile ConfigFile, DistDir & "apache2.config"
 
+  ConfigFile = DistDir & "apache22.config.in"
+  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth"
+  ReplaceInFile ConfigFile, "@-PKGSYSCONFDIR-@", ConvertedDir & "/etc/shibboleth"
+  ReplaceInFile ConfigFile, "@-LIBEXECDIR-@", ConvertedDir & "/libexec"
+  ReplaceInFile ConfigFile, "@-PREFIX-@", ConvertedDir
+  If (NOT FileSystemObj.FileExists(ConfigDir & "apache22.config")) then
+    FileSystemObj.CopyFile ConfigFile, ConfigDir & "apache22.config", false
+  End If
+  If (FileSystemObj.FileExists(DistDir & "apache22.config")) then
+    FileSystemObj.DeleteFile DistDir & "apache22.config", true
+  End If
+  FileSystemObj.MoveFile ConfigFile, DistDir & "apache22.config"
 
   'Now just copy the other non-edited files over as well (if possible)
 
@@ -159,24 +171,28 @@ if (Err = 0) then
     FileSystemObj.CopyFile DistDir & "accessError.html", ConfigDir, false
   End If
 
-  If (NOT FileSystemObj.FileExists(ConfigDir & "inqueue.pem")) then
-    FileSystemObj.CopyFile DistDir & "inqueue.pem", ConfigDir, false
-  End If
-
   If (NOT FileSystemObj.FileExists(ConfigDir & "metadataError.html")) then
     FileSystemObj.CopyFile DistDir & "metadataError.html", ConfigDir, false
   End If
 
-  If (NOT FileSystemObj.FileExists(ConfigDir & "openssl.cnf")) then
-    FileSystemObj.CopyFile DistDir & "openssl.cnf", ConfigDir, false
+  If (NOT FileSystemObj.FileExists(ConfigDir & "sessionError.html")) then
+    FileSystemObj.CopyFile DistDir & "sessionError.html", ConfigDir, false
   End If
 
-  If (NOT FileSystemObj.FileExists(ConfigDir & "rmError.html")) then
-    FileSystemObj.CopyFile DistDir & "rmError.html", ConfigDir, false
+  If (NOT FileSystemObj.FileExists(ConfigDir & "sslError.html")) then
+    FileSystemObj.CopyFile DistDir & "sslError.html", ConfigDir, false
   End If
 
-  If (NOT FileSystemObj.FileExists(ConfigDir & "sessionError.html")) then
-    FileSystemObj.CopyFile DistDir & "sessionError.html", ConfigDir, false
+  If (NOT FileSystemObj.FileExists(ConfigDir & "bindingTemplate.html")) then
+    FileSystemObj.CopyFile DistDir & "bindingTemplate.html", ConfigDir, false
+  End If
+
+  If (NOT FileSystemObj.FileExists(ConfigDir & "openssl.cnf")) then
+    FileSystemObj.CopyFile DistDir & "openssl.cnf", ConfigDir, false
+  End If
+
+  If (NOT FileSystemObj.FileExists(ConfigDir & "console.logger")) then
+    FileSystemObj.CopyFile DistDir & "console.logger", ConfigDir, false
   End If
 
   If (NOT FileSystemObj.FileExists(ConfigDir & "shibboleth.logger")) then
@@ -191,9 +207,28 @@ if (Err = 0) then
     FileSystemObj.CopyFile DistDir & "sp-example.key", ConfigDir, false
   End If
 
-  If (NOT FileSystemObj.FileExists(ConfigDir & "sslError.html")) then
-    FileSystemObj.CopyFile DistDir & "sslError.html", ConfigDir, false
-  End If
+  ' Finally, fix up schema catalogs.
+  
+  XMLDir = InstallDir & "\share\xml\xmltooling\"
+  ConfigFile = XMLDir & "catalog.xml.in"
+  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", XMLDir
+  FileSystemObj.MoveFile ConfigFile, XMLDir & "catalog.xml"
+
+  XMLDir = InstallDir & "\share\xml\opensaml\"
+  ConfigFile = XMLDir & "saml20-catalog.xml.in"
+  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", XMLDir
+  FileSystemObj.MoveFile ConfigFile, XMLDir & "saml20-catalog.xml"
+  ConfigFile = XMLDir & "saml11-catalog.xml.in"
+  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", XMLDir
+  FileSystemObj.MoveFile ConfigFile, XMLDir & "saml11-catalog.xml"
+  ConfigFile = XMLDir & "saml10-catalog.xml.in"
+  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", XMLDir
+  FileSystemObj.MoveFile ConfigFile, XMLDir & "saml10-catalog.xml"
+
+  XMLDir = InstallDir & "\share\xml\shibboleth\"
+  ConfigFile = XMLDir & "catalog.xml.in"
+  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", XMLDir
+  FileSystemObj.MoveFile ConfigFile, XMLDir & "catalog.xml"
 
 'Last End If
 End If
\ No newline at end of file