on 2024 Sep 27 3:00 PM
Hello all,
could you please help? I want to set configuration path for sap logon configuration file SAPUILandscapeGlobal.xml to path: "%AppData%\SAP\Common" via OnInstallationEnd event scripting in SAP GUI single installation package. My script/command looks like:
************************************************************
'Create directory C:\Users\%AppData%\SAP\Common
destFolder = NwEngine.Variables.ResolveString("C:\Users\%AppData%\SAP\Common")
If Not NwEngine.Shell.CreateDirectory( destFolder ) Then
NwEngine.Context.Log.WriteError "Creating directory C:\Users\%AppData%\SAP\Common failed."
End If
'Copy configuraton file from CustomerFiles directory
NwEngine.Context.Log.Write "Event: Copying customized SAPUILandscapeGlobal.xml"
srcFile = NwEngine.Variables.ResolveString("%SapSrcDir%\CustomerFiles\SAPUILandscapeGlobal.xml")
destFile = NwEngine.Variables.ResolveString("C:\Users\%AppData%\SAP\Common\SAPUILandscapeGlobal.xml")
If NwEngine.Shell.FileExist( srcFile ) Then
NwEngine.Shell.CopyFile srcFile, destFile
End If
'Copy services file
NwEngine.Context.Log.Write "Event: Copying customized services"
srcFile = NwEngine.Variables.ResolveString("%SapSrcDir%\CustomerFiles\services")
destFile = NwEngine.Variables.ResolveString("%windir%\System32\drivers\etc\services")
If NwEngine.Shell.FileExist( srcFile ) Then
NwEngine.Shell.CopyFile srcFile, destFile
End If
'Switch off Enhanced Search in setting Visualization 2
If Not NwEngine.Shell.SetRegValue("HKEY_CURRENT_USER\Software\SAP\SAPGUI Front\SAP Frontend Server\Customize\EnhancedSearchMode", "REG_DWORD", "0") Then
NwEngine.Context.Log.WriteError "Writing the registry value HKEY_CURRENT_USER\Software\SAP\SAPGUI Front\SAP Frontend Server\Customize\EnhancedSearchMode has failed."
End If
'Set Path to local configuration files to C:\Users\%AppData%\SAP\Common
If Not NwEngine.Shell.SetRegValue("HKLM\SOFTWARE\SAP\SAPLogon\Options\PathConfigFilesLocal", "REG_EXPAND_SZ", "%AppData%\SAP\Common") Then
NwEngine.Context.Log.WriteError "Writing the registry value HKLM\SOFTWARE\Wow6432Node\SAP\SAPLogon\Options\PathConfigFilesLocal has failed."
End If
'Set Path to global configuration files to C:\Users\%AppData%\SAP\Common
If Not NwEngine.Shell.SetRegValue("HKEY_LOCAL_MACHINE\SOFTWARE\SAP\SAPLogon\Options\LandscapeFileOnServer", "REG_EXPAND_SZ", "%AppData%\SAP\Common") Then
NwEngine.Context.Log.WriteError "Writing the registry value HKEY_LOCAL_MACHINE\SOFTWARE\SAP\SAPLogon\Options\LandscapeFileOnServer has failed."
'Disable user scripting in default
If Not NwEngine.Shell.SetRegValue("HKEY_CURRENT_USER\Software\SAP\SAPGUI Front\SAP Frontend Server\Security\UserScripting", "REG_DWORD", "0") Then
NwEngine.Context.Log.WriteError "Writing the registry value HKEY_CURRENT_USER\Software\SAP\SAPGUI Front\SAP Frontend Server\Security\UserScripting has failed."
End If
************************************************************
It doen't work and installation faild with error.
Could you please help on this?
Martin.
Request clarification before answering.
User | Count |
---|---|
72 | |
21 | |
9 | |
8 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.