Add a "full" example config file to demonstrate all the old settings.
[shibboleth/sp.git] / msi / scripts / shib_edit_config_files.vbs
index 154bd20..fcfdfe7 100644 (file)
@@ -35,7 +35,7 @@ Sub ReplaceInFile( filePath, lookForStr, replaceWithStr )
 End Sub
 
 
-Dim FileSystemObj, ConvertedDir, ConfigFile, XMLDir
+Dim FileSystemObj, ConvertedDir, ConfigFile, XMLDir, WshShell
 Dim customData, msiProperties, InstallDir, ShibdPort
 
 on error resume next
@@ -56,6 +56,10 @@ if (Err = 0) then
   ConfigDir = InstallDir & "\etc\shibboleth\"
   DistDir = ConfigDir & "dist\"
 
+  'Set ConvertedDir as the SHIBSP_PREFIX system variable.
+  Set WshShell = CreateObject("WScript.Shell")
+  WshShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\SHIBSP_PREFIX", ConvertedDir, "REG_SZ"
+
   'Perform actual Substitutions
   'Afterwards, if the config file doesn't already exist, copy up to etc/shibboleth
   'Also strip *.in for files in dist
@@ -113,15 +117,12 @@ 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""/>"
+  'Now just copy the other non-edited files over as well (if possible)
+
   If (NOT FileSystemObj.FileExists(ConfigDir & "shibboleth2.xml")) then
-    FileSystemObj.CopyFile ConfigFile, ConfigDir & "shibboleth2.xml", false
+    FileSystemObj.CopyFile DistDir & "shibboleth2.xml", ConfigDir, false
   End If
 
-  'Now just copy the other non-edited files over as well (if possible)
-
   If (NOT FileSystemObj.FileExists(ConfigDir & "accessError.html")) then
     FileSystemObj.CopyFile DistDir & "accessError.html", ConfigDir, false
   End If
@@ -142,6 +143,14 @@ if (Err = 0) then
     FileSystemObj.CopyFile DistDir & "bindingTemplate.html", ConfigDir, false
   End If
 
+  If (NOT FileSystemObj.FileExists(ConfigDir & "discoveryTemplate.html")) then
+    FileSystemObj.CopyFile DistDir & "discoveryTemplate.html", ConfigDir, false
+  End If
+
+  If (NOT FileSystemObj.FileExists(ConfigDir & "postTemplate.html")) then
+    FileSystemObj.CopyFile DistDir & "postTemplate.html", ConfigDir, false
+  End If
+
   If (NOT FileSystemObj.FileExists(ConfigDir & "localLogout.html")) then
     FileSystemObj.CopyFile DistDir & "localLogout.html", ConfigDir, false
   End If
@@ -150,8 +159,8 @@ if (Err = 0) 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
+  If (NOT FileSystemObj.FileExists(ConfigDir & "partialLogout.html")) then
+    FileSystemObj.CopyFile DistDir & "partialLogout.html", ConfigDir, false
   End If
 
   If (NOT FileSystemObj.FileExists(ConfigDir & "console.logger")) then
@@ -166,6 +175,10 @@ if (Err = 0) then
     FileSystemObj.CopyFile DistDir & "example-metadata.xml", ConfigDir, false
   End If
 
+  If (NOT FileSystemObj.FileExists(ConfigDir & "example-shibboleth2.xml")) then
+    FileSystemObj.CopyFile DistDir & "example-shibboleth2.xml", ConfigDir, false
+  End If
+
   If (NOT FileSystemObj.FileExists(ConfigDir & "attribute-map.xml")) then
     FileSystemObj.CopyFile DistDir & "attribute-map.xml", ConfigDir, false
   End If
@@ -174,6 +187,10 @@ if (Err = 0) then
     FileSystemObj.CopyFile DistDir & "attribute-policy.xml", ConfigDir, false
   End If
 
+  If (NOT FileSystemObj.FileExists(ConfigDir & "security-policy.xml")) then
+    FileSystemObj.CopyFile DistDir & "security-policy.xml", ConfigDir, false
+  End If
+
   ' Finally, fix up schema catalogs.
   
   XMLDir = InstallDir & "\share\xml\xmltooling\"