Path resolution for error templates.
[shibboleth/sp.git] / msi / scripts / shib_edit_config_files.vbs
index 0f76fe5..8316b59 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,52 +60,6 @@ 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"
-  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth"
-  If (NOT FileSystemObj.FileExists(ConfigDir & "AAP.xml")) then
-    FileSystemObj.CopyFile ConfigFile, ConfigDir & "AAP.xml", false
-  End If
-  If (FileSystemObj.FileExists(DistDir & "AAP.xml")) then
-    FileSystemObj.DeleteFile DistDir & "AAP.xml", true
-  End If
-  FileSystemObj.MoveFile ConfigFile, DistDir & "AAP.xml"
-  
-  ConfigFile = DistDir & "example-metadata.xml.in"
-  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth"
-  If (NOT FileSystemObj.FileExists(ConfigDir & "example-metadata.xml")) then
-    FileSystemObj.CopyFile ConfigFile, ConfigDir & "example-metadata.xml", false
-  End If
-  If (FileSystemObj.FileExists(DistDir & "example-metadata.xml")) then
-    FileSystemObj.DeleteFile DistDir & "example-metadata.xml", true
-  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"
-  ReplaceInFile ConfigFile, "@-LIBEXECDIR-@", ConvertedDir & "/libexec"
-  ReplaceInFile ConfigFile, "@-LOGDIR-@", ConvertedDir & "/var/log/shibboleth"
-  ReplaceInFile ConfigFile, "@-PREFIX-@", ConvertedDir
-  ReplaceInFile ConfigFile, "   <UnixListener address=""@-VARRUNDIR-@/shib-shar.sock""/>", "<!-- <UnixListener address=""@-VARRUNDIR-@/shib-shar.sock""/> -->"
-  ReplaceInFile ConfigFile, "<!-- <TCPListener address=""127.0.0.1"" port=""12345"" acl=""127.0.0.1""/> -->", "<TCPListener address=""127.0.0.1"" port=""" & ShibdPort & """ acl=""127.0.0.1""/>"
-  If (NOT FileSystemObj.FileExists(ConfigDir & "shibboleth.xml")) then
-    FileSystemObj.CopyFile ConfigFile, ConfigDir & "shibboleth.xml", false
-  End If
-  If (FileSystemObj.FileExists(DistDir & "shibboleth.xml")) then
-    FileSystemObj.DeleteFile DistDir & "shibboleth.xml", true
-  End If
-  FileSystemObj.MoveFile ConfigFile, DistDir & "shibboleth.xml"
-
   ConfigFile = DistDir & "shibd.logger.in"
   ReplaceInFile ConfigFile, "@-PKGLOGDIR-@", ConvertedDir & "/var/log/shibboleth"
   If (NOT FileSystemObj.FileExists(ConfigDir & "shibd.logger")) then
@@ -127,10 +81,8 @@ if (Err = 0) then
   FileSystemObj.MoveFile ConfigFile, DistDir & "native.logger"
 
   ConfigFile = DistDir & "apache.config.in"
-  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth"
-  ReplaceInFile ConfigFile, "@-PKGSYSCONFDIR-@", ConvertedDir & "/etc/shibboleth"
-  ReplaceInFile ConfigFile, "@-LIBEXECDIR-@", ConvertedDir & "/libexec"
-  ReplaceInFile ConfigFile, "@-PREFIX-@", ConvertedDir
+  ReplaceInFile ConfigFile, "@-PKGLIBDIR-@", ConvertedDir & "/lib/shibboleth"
+  ReplaceInFile ConfigFile, "@-PKGDOCDIR-@", ConvertedDir & "/share/doc/shibboleth"
   If (NOT FileSystemObj.FileExists(ConfigDir & "apache.config")) then
     FileSystemObj.CopyFile ConfigFile, ConfigDir & "apache.config", false
   End If
@@ -140,10 +92,8 @@ if (Err = 0) then
   FileSystemObj.MoveFile ConfigFile, DistDir & "apache.config"
 
   ConfigFile = DistDir & "apache2.config.in"
-  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth"
-  ReplaceInFile ConfigFile, "@-PKGSYSCONFDIR-@", ConvertedDir & "/etc/shibboleth"
-  ReplaceInFile ConfigFile, "@-LIBEXECDIR-@", ConvertedDir & "/libexec"
-  ReplaceInFile ConfigFile, "@-PREFIX-@", ConvertedDir
+  ReplaceInFile ConfigFile, "@-PKGLIBDIR-@", ConvertedDir & "/lib/shibboleth"
+  ReplaceInFile ConfigFile, "@-PKGDOCDIR-@", ConvertedDir & "/share/doc/shibboleth"
   If (NOT FileSystemObj.FileExists(ConfigDir & "apache2.config")) then
     FileSystemObj.CopyFile ConfigFile, ConfigDir & "apache2.config", false
   End If
@@ -152,6 +102,23 @@ if (Err = 0) then
   End If
   FileSystemObj.MoveFile ConfigFile, DistDir & "apache2.config"
 
+  ConfigFile = DistDir & "apache22.config.in"
+  ReplaceInFile ConfigFile, "@-PKGLIBDIR-@", ConvertedDir & "/lib/shibboleth"
+  ReplaceInFile ConfigFile, "@-PKGDOCDIR-@", ConvertedDir & "/share/doc/shibboleth"
+  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"
+
+  ConfigFile = DistDir & "shibboleth2.xml"
+  ReplaceInFile ConfigFile, "   <UnixListener address=""shibd.sock""/>", "<!-- <UnixListener address=""shibd.sock""/> -->"
+  ReplaceInFile ConfigFile, "<!-- <TCPListener address=""127.0.0.1"" port=""12345"" acl=""127.0.0.1""/> -->", "<TCPListener address=""127.0.0.1"" port=""" & ShibdPort & """ acl=""127.0.0.1""/>"
+  If (NOT FileSystemObj.FileExists(ConfigDir & "shibboleth2.xml")) then
+    FileSystemObj.CopyFile ConfigFile, ConfigDir & "shibboleth2.xml", false
+  End If
 
   'Now just copy the other non-edited files over as well (if possible)
 
@@ -159,24 +126,36 @@ 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 & "localLogout.html")) then
+    FileSystemObj.CopyFile DistDir & "localLogout.html", ConfigDir, false
+  End If
+
+  If (NOT FileSystemObj.FileExists(ConfigDir & "globalLogout.html")) then
+    FileSystemObj.CopyFile DistDir & "globalLogout.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 +170,35 @@ 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
+  If (NOT FileSystemObj.FileExists(ConfigDir & "example-metadata.xml")) then
+    FileSystemObj.CopyFile DistDir & "example-metadata.xml", ConfigDir, false
   End If
 
+  If (NOT FileSystemObj.FileExists(ConfigDir & "attribute-map.xml")) then
+    FileSystemObj.CopyFile DistDir & "attribute-map.xml", ConfigDir, false
+  End If
+
+  If (NOT FileSystemObj.FileExists(ConfigDir & "attribute-policy.xml")) then
+    FileSystemObj.CopyFile DistDir & "attribute-policy.xml", ConfigDir, false
+  End If
+
+  ' Finally, fix up schema catalogs.
+  
+  XMLDir = InstallDir & "\share\xml\xmltooling\"
+  ConfigFile = XMLDir & "catalog.xml"
+  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@/", XMLDir
+
+  XMLDir = InstallDir & "\share\xml\opensaml\"
+  ConfigFile = XMLDir & "saml20-catalog.xml"
+  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@/", XMLDir
+  ConfigFile = XMLDir & "saml11-catalog.xml"
+  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@/", XMLDir
+  ConfigFile = XMLDir & "saml10-catalog.xml"
+  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@/", XMLDir
+
+  XMLDir = InstallDir & "\share\xml\shibboleth\"
+  ConfigFile = XMLDir & "catalog.xml"
+  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@/", XMLDir
+
 'Last End If
 End If
\ No newline at end of file