<?xml version="1.0" encoding="utf-8"?><SapSetup Context="Settings">	<Script ScriptName="Add custom-logging to the log-file" Description="Adds a custom line to NwSAPSetup.log">	<![CDATA[NwEngine.Context.Log.Write "Your custom statement goes here."	]]>	</Script>	<Script ScriptName="Resolve an installation variable" Description="Shows how to resolve installation parameters and environment variables">	<![CDATA[strSrcFile   = NwEngine.Variables.ResolveString("%SapSrcDir%\CustomerFiles\TestFile.txt")strSrcFolder = NwEngine.Variables.ResolveString("%SapSrcDir%\CustomerFiles")strDstFolder = "C:\temp\TestFolder"strDstFile   = "C:\temp\TestFolder\TestFile.txt"strDstFile1  = NwEngine.Variables.ResolveString("%ProgramFiles%\TestFile.txt")strDstFile2  = NwEngine.Variables.ResolveString("%CommonProgramFiles%\TestFile.txt")strDstFile3  = NwEngine.Variables.ResolveString("%WinDir%\TestFile.txt")	]]>	</Script>	<Script ScriptName="Check a file for existence" Description="Checks if 'TestFile.txt' is available on the installation source.">	<![CDATA[strSrcFile   = NwEngine.Variables.ResolveString("%SapSrcDir%\CustomerFiles\TestFile.txt")If NwEngine.Shell.FileExist( strSrcFile ) Then	NwEngine.Context.Log.Write "File exists: " & strSrcFileElse	NwEngine.Context.Log.Write "File missing: " & strSrcFileEnd If	]]>	</Script>	<Script ScriptName="Copy a file" Description="Copies a file given a source and destination path.">	<![CDATA[strSrcFile   = NwEngine.Variables.ResolveString("%SapSrcDir%\CustomerFiles\TestFile.txt")strDstFile   = "C:\temp\TestFolder\TestFile.txt"NwEngine.Shell.CopyFile szSrcFile, szDstFile	]]>	</Script>	<Script ScriptName="Copy a file in force mode" Description="Copies a file without time-stamp or version check.">	<![CDATA[strSrcFile   = NwEngine.Variables.ResolveString("%SapSrcDir%\CustomerFiles\TestFile.txt")strDstFile   = "C:\temp\TestFolder\TestFile.txt"NwEngine.Shell.CopyFileEx szSrcFile, szDstFile, vbTrue	]]>	</Script>	<Script ScriptName="Delete a file" Description="Deletes a file from the file system.">	<![CDATA[strDstFile   = "C:\temp\TestFolder\TestFile.txt"NwEngine.Shell.DeleteFile szDstFile	]]>	</Script>	<Script ScriptName="Copy a directory recursively" Description="Copies the contents of a directory and its subdirectories to a destination path.">	<![CDATA[strSrcFolder = NwEngine.Variables.ResolveString("%SapSrcDir%\CustomerFiles")strDstFolder = "C:\temp\TestFolder"NwEngine.Shell.CopyDirectory strSrcFolder, strDstFolder	]]>	</Script>	<Script ScriptName="Copy a directory recursively in force-mode" Description="Copies the contents of a directory and its subdirectories to a destination path ignoring file-version and time-stamp information.">	<![CDATA[strSrcFolder = NwEngine.Variables.ResolveString("%SapSrcDir%\CustomerFiles")strDstFolder = "C:\temp\TestFolder"NwEngine.Shell.CopyDirectoryEx strSrcFolder, strDstFolder, vbTrue	]]>	</Script>	<Script ScriptName="Create a directory" Description="Creates a new directory and intermediate directories in the supplied path, if they don't already exist.">	<![CDATA[strDstFolder = "C:\temp\TestFolder"NwEngine.Shell.CreateDirectory strDstFolder	]]>	</Script>	<Script ScriptName="Delete a directoy" Description="Delete a directory with all it's contents.">	<![CDATA[strDstFolder = "C:\temp\TestFolder"NwEngine.Shell.DeleteDirectory strDstFolder	]]>	</Script>	<Script ScriptName="Check for the existence of a registry-key" Description="Check whether a registry key (example: 'HKCU\SOFTWARE\SAP\TestKey') exists.">	<![CDATA[If NwEngine.Shell.RegKeyExist("HKCU\SOFTWARE\SAP\TestKey") Then	NwEngine.Context.Log.Write "Key exists: HKCU\SOFTWARE\SAP\TestKey"Else	NwEngine.Context.Log.Write "Key does not exist: HKCU\SOFTWARE\SAP\TestKey"End If	]]>	</Script>	<Script ScriptName="Replace or set a registry value" Description="Sets a 'REG_SZ' and a 'REG_DWORD' value in the Windows registry.">	<![CDATA[NwEngine.Shell.SetRegValue "HKCU\SOFTWARE\SAP\TestKey\TestString", "REG_SZ", "TestValue"NwEngine.Shell.SetRegValue "HKCU\SOFTWARE\SAP\TestKey\TestDWord", "REG_DWORD", "65536"	]]>	</Script>	<Script ScriptName="Read a value from the registry" Description="Shows how to read a value from the Windows registry via a sample that reads the key-value that stores the user's 'My Documents' folder path.">	<![CDATA[szRegValue = NWEngine.Shell.GetRegValue("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal")NwEngine.Context.Log.Write "User's document folder: " & szRegValue	]]>	</Script>	<Script ScriptName="Execute an application and wait" Description="Start an application (example: notepad.exe) and wait until it ends.">	<![CDATA[strCmdLine = NwEngine.Variables.ResolveString("%WinDir%\NotePad.exe")bNoWaiting = vbFalseNwEngine.Shell.Execute strCmdLine, bNoWaiting	]]>	</Script>	<Script ScriptName="Sample 1" Description="Copying a customized version of 'SapLogon.ini' and 'services'-file">	<![CDATA['This scripting can be added to the 'On End Install' section of a SAP GUI 710 package event script.'It distributes your special version of the 'SapLogon.ini' and services file'given these files exist inside a folder ‘\CustomerFiles’ on your installation server share.'NwEngine.Context.Log.Write "Event: Copying customized SapLogon.ini"strSrcFile = NwEngine.Variables.ResolveString("%SapSrcDir%\CustomerFiles\SapLogon.ini")strDstFile = NwEngine.Variables.ResolveString("%WinDir%\SapLogon.ini")If NwEngine.Shell.FileExist( strSrcFile ) Then      NwEngine.Shell.CopyFile strSrcFile, strDstFileEnd IfNwEngine.Context.Log.Write "Event: Copying customized services file"If NwEngine.Shell.FileExist("%SAPSrcDir%\CustomerFiles\services") Then      NwEngine.Shell.CopyFile "%SAPSrcDir%\CustomerFiles\services", "%WinSysDir%\drivers\etc\services"End If	]]>	</Script>	<Script ScriptName="Sample 2" Description="Setting registry values to pre-configure Auto-Update settings for SAP Logon">	<![CDATA['This scripting can be added to the 'On End Install' section of a SAP GUI 710 package event script to pre-define the auto-update settings for SAP Logon.NwEngine.Context.Log.Write "Event: Setting the auto-update registry key for SAP Logon"strRegUpdate = "HKLM\SOFTWARE\SAP\SAPsetup\SAPstart\AutoUpdate\SAPLogon.exe\UpdateMode"strRegProb   = "HKLM\SOFTWARE\SAP\SAPsetup\SAPstart\AutoUpdate\SAPLogon.exe\Prob"'Option 1: Update Mode is switched on with update frequency = 10. The user is not allowed to configure.NwEngine.Shell.SetRegValue strRegUpdate, "REG_SZ", "ForceOn"NwEngine.Shell.SetRegValue strRegProb, "REG_DWORD", "10"'Option 2: Update Mode is switched off. The user is not allowed to switch it on.NwEngine.Shell.SetRegValue strRegUpdate, "REG_SZ", "ForceOff"'Option 3: Update Mode is switched on with update frequency = 10. The user is allowed to change the configuration.NwEngine.Shell.SetRegValue strRegUpdate, "REG_SZ", "On"NwEngine.Shell.SetRegValue strRegProb, "REG_DWORD", "10"'Option 4: Update Mode is switched off. The user is allowed to change the configuration.NwEngine.Shell.SetRegValue strRegUpdate, "REG_SZ", "Off"'The same settings can be applied to the registry values for 'SAPLgPad.exe':' strRegUpdate = "HKLM\SOFTWARE\SAP\SAPsetup\SAPstart\AutoUpdate\SAPLgPad.exe\UpdateMode"' strRegProb   = "HKLM\SOFTWARE\SAP\SAPsetup\SAPstart\AutoUpdate\SAPLgPad.exe\Prob"	]]>	</Script>	<Script ScriptName="Sample 3" Description="Replacing a line inside a text-file">	<![CDATA['This scripting can be added to the 'On End Install' section of a SAP GUI 710 package event script''It replaces the default line' Cmd=""'by the line' Cmd="/ini_file="C:\temp\saplogon.ini""'inside the file '%ProgramFiles%\SAP\SapSetup\setup\SAL\SapLogon.sal'''This way, you can redirect 'SAPLogon.exe' to the INI-file 'C:\temp\saplogon.ini'.NwEngine.Context.Log.Write "Event: Editing SAPLogon.sal"strSalFile = NwEngine.Variables.ResolveString( "%ProgramFiles%\SAP\SapSetup\setup\SAL\SapLogon.sal" )Set objTextFile = CreateObject("NwSapSetupATLCommon.TextFileParser")If objTextFile.Parse( strSalFile ) ThenNwEngine.Context.Log.Write "Event: Open and modify the file " & Chr(34) & strSalFile & Chr(34)      szOldLine = "Cmd=" & Chr(34) & Chr(34)     szNewLine = "Cmd=" & Chr(34) & "/ini_file=" & Chr(34) & "C:\temp\saplogon.ini" & Chr(34) & Chr(34)      objTextFile.ReplaceLineEx szOldLine, szNewLine      objTextFile.Save( strSalFile )Else      NwEngine.Context.Log.WriteWarning "Event: Could not open the file " & Chr(34) & strSalFile & Chr(34)End If	]]>	</Script>	<Script ScriptName="Sample 4" Description="Append content to the 'services'-file. You can run this script on EndInstall.">	<![CDATA['This scripting can be added to the 'On End Install' section of a SAP GUI 710 package event script''It replaces the default line' Cmd=""'by the line' Cmd="/ini_file="C:\temp\saplogon.ini""'inside the file '%ProgramFiles%\SAP\SapSetup\setup\SAL\SapLogon.sal'''This way, you can redirect 'SAPLogon.exe' to the INI-file 'C:\temp\saplogon.ini'.NwEngine.Context.Log.Write "Event: Editing SAPLogon.sal"strSalFile = NwEngine.Variables.ResolveString( "%ProgramFiles%\SAP\SapSetup\setup\SAL\SapLogon.sal" )Set objTextFile = CreateObject("NwSapSetupATLCommon.TextFileParser")If objTextFile.Parse( strSalFile ) ThenNwEngine.Context.Log.Write "Event: Open and modify the file " & Chr(34) & strSalFile & Chr(34)      szOldLine = "Cmd=" & Chr(34) & Chr(34)     szNewLine = "Cmd=" & Chr(34) & "/ini_file=" & Chr(34) & "C:\temp\saplogon.ini" & Chr(34) & Chr(34)      objTextFile.ReplaceLineEx szOldLine, szNewLine      objTextFile.Save( strSalFile )Else      NwEngine.Context.Log.WriteWarning "Event: Could not open the file " & Chr(34) & strSalFile & Chr(34)End If	]]>	</Script>	<Script ScriptName="Sample 5" Description="Removing content from the 'services'-file. You can run it on EndUninstall">	<![CDATA['This scripting can be added to the 'On End UnInstall' section of a SAP GUI 710 package event script''It removes a line from the services files which was set in the last Sample 4.'NwEngine.Context.Log.Write "Event: Removing a line from the services file"strFile = NwEngine.Variables.ResolveString( "%WinSysDir%\drivers\etc\services" )Set objTextFile = CreateObject("NwSapSetupATLCommon.TextFileParser")If objTextFile.Parse( strFile ) Then      NwEngine.Context.Log.Write "Event: Modify the file " & Chr(34) & strFile & Chr(34)      objTextFile.RemoveLine "Alpha  1901/tcp"      objTextFile.Save( strFile )Else      NwEngine.Context.Log.WriteWarning "Event: Could not open the file " & Chr(34) & strSalFile & Chr(34)End If	]]>	</Script></SapSetup>