Path resolution for error templates.
[shibboleth/sp.git] / msi / scripts / shib_edit_config_files.vbs
index 9e07d66..8316b59 100644 (file)
@@ -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 & "attribute-map.xml.in"
-  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth"
-  If (NOT FileSystemObj.FileExists(ConfigDir & "attribute-map.xml")) then
-    FileSystemObj.CopyFile ConfigFile, ConfigDir & "attribute-map.xml", false
-  End If
-  If (FileSystemObj.FileExists(DistDir & "attribute-map.xml")) then
-    FileSystemObj.DeleteFile DistDir & "attribute-map.xml", true
-  End If
-  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"
-  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 & "shibboleth2.xml.in"
-  ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth"
-  ReplaceInFile ConfigFile, "@-PKGSYSCONFDIR-@", ConvertedDir & "/etc/shibboleth"
-  ReplaceInFile ConfigFile, "@-PKGLIBDIR-@", ConvertedDir & "/lib/shibboleth"
-  ReplaceInFile ConfigFile, "@-LOGDIR-@", ConvertedDir & "/var/log/shibboleth"
-  ReplaceInFile ConfigFile, "@-PREFIX-@", ConvertedDir
-  ReplaceInFile ConfigFile, "   <UnixListener address=""@-PKGRUNDIR-@/shibd.sock""/>", "<!-- <UnixListener address=""@-PKGRUNDIR-@/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
-  If (FileSystemObj.FileExists(DistDir & "shibboleth2.xml")) then
-    FileSystemObj.DeleteFile DistDir & "shibboleth2.xml", true
-  End If
-  FileSystemObj.MoveFile ConfigFile, DistDir & "shibboleth2.xml"
-
   ConfigFile = DistDir & "shibd.logger.in"
   ReplaceInFile ConfigFile, "@-PKGLOGDIR-@", ConvertedDir & "/var/log/shibboleth"
   If (NOT FileSystemObj.FileExists(ConfigDir & "shibd.logger")) then
@@ -127,11 +81,8 @@ if (Err = 0) then
   FileSystemObj.MoveFile ConfigFile, DistDir & "native.logger"
 
   ConfigFile = DistDir & "apache.config.in"
-  ReplaceInFile ConfigFile, "@-XMLDIR-@", ConvertedDir & "/share/xml"
-  ReplaceInFile ConfigFile, "catalog.xml:", "catalog.xml;"
-  ReplaceInFile ConfigFile, "@-PKGDOCDIR-@", ConvertedDir & "/share/doc/shibboleth"
-  ReplaceInFile ConfigFile, "@-PKGSYSCONFDIR-@", ConvertedDir & "/etc/shibboleth"
   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
@@ -141,11 +92,8 @@ if (Err = 0) then
   FileSystemObj.MoveFile ConfigFile, DistDir & "apache.config"
 
   ConfigFile = DistDir & "apache2.config.in"
-  ReplaceInFile ConfigFile, "@-XMLDIR-@", ConvertedDir & "/share/xml"
-  ReplaceInFile ConfigFile, "catalog.xml:", "catalog.xml;"
-  ReplaceInFile ConfigFile, "@-PKGDOCDIR-@", ConvertedDir & "/share/doc/shibboleth"
-  ReplaceInFile ConfigFile, "@-PKGSYSCONFDIR-@", ConvertedDir & "/etc/shibboleth"
   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
@@ -155,11 +103,8 @@ if (Err = 0) then
   FileSystemObj.MoveFile ConfigFile, DistDir & "apache2.config"
 
   ConfigFile = DistDir & "apache22.config.in"
-  ReplaceInFile ConfigFile, "@-XMLDIR-@", ConvertedDir & "/share/xml"
-  ReplaceInFile ConfigFile, "catalog.xml:", "catalog.xml;"
-  ReplaceInFile ConfigFile, "@-PKGDOCDIR-@", ConvertedDir & "/share/doc/shibboleth"
-  ReplaceInFile ConfigFile, "@-PKGSYSCONFDIR-@", ConvertedDir & "/etc/shibboleth"
   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
@@ -168,6 +113,13 @@ if (Err = 0) then
   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)
 
   If (NOT FileSystemObj.FileExists(ConfigDir & "accessError.html")) then
@@ -218,6 +170,18 @@ if (Err = 0) then
     FileSystemObj.CopyFile DistDir & "sp-example.key", ConfigDir, false
   End If
 
+  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\"