(imported topic written by SystemAdmin)
Installing SAP GUI and then trying to update the saplogin.ini file after the install. SAP GUI install works like a champ and isn’t a problem.
The problem is updating the saplogonl.ini. It so happens that it is kept in different places depending on the OS.
XP:
c:\documents and settings{currentusername}\application data\sap\common\saplogon.ini
Win7
C:\Users{currentusername}\AppData\Roaming\SAP\Common\saplogon.ini
So we need to figure out if the file exists and update it if it does.
We came up with this:
if (not x64 of operating system) then (exists folder (“c:\documents and settings” & name of current user as string & “\application data\sap\common”) AND not exists file (“c:\documents and settings” & name of current user as string & “\application data\sap\common\saplogon.ini”)) OR (exists file (“c:\documents and settings” & name of current user as string & “\application data\sap\common\saplogon.ini”) AND modification time of file (“c:\documents and settings” & name of current user as string & “\application data\sap\common\saplogon.ini”) < " as time) else (exists folder (“c:\users” & name of current user as string & “\appdata\roaming\sap\common”) AND not exists file (“c:\users” & name of current user as string & “\appdata\roaming\sap\common\saplogon.ini”)) OR (exists file (“c:\users” & name of current user as string & “\appdata\roaming\sap\common\saplogon.ini”) AND modification time of file (“c:\users” & name of current user as string & “\appdata\roaming\sap\common\saplogon.ini”) < “Wed, 07 Sep 2011 11:34:50 -0400” as time)
Which is a whole lotta yuck.
We’d like to use something like this:
if (not x64 of operating system) then (exists folder (value “USERPROFILE” of key “Volatile Environment” of current user key (logged on user) of registry as string & “\application data\sap\common”) AND not exists file (value “USERPROFILE” of key “Volatile Environment” of current user key (logged on user) of registry as string & “\application data\sap\common\saplogon.ini”)) OR (exists file (value “USERPROFILE” of key “Volatile Environment” of current user key (logged on user) of registry as string & “\application data\sap\common\saplogin.ini”) AND modification time of file (value “USERPROFILE” of key “Volatile Environment” of current user key (logged on user) of registry as string & “\application data\sap\common\saplogin.ini”) < “Wed, 07 Sep 2011 11:34:50 -0400” as time) else (exists folder (value “APPDATA” of key “Volatile Environment” of current user key (logged on user) of registry as string & “\sap\common”) AND not exists file (value “APPDATA” of key “Volatile Environment” of current user key (logged on user) of registry as string & “\sap\common\saplogin.ini”)) OR (exists file (value “APPDATA” of key “Volatile Environment” of current user key (logged on user) of registry as string & “\sap\common\saplogin.ini”) AND modification time of file (value “APPDATA” of key “Volatile Environment” of current user key (logged on user) of registry as string & “\sap\common\saplogin.ini”) < “Wed, 07 Sep 2011 11:34:50 -0400” as time)
Which is still yuck, but eliminates having to hard code c:\documents and settings or c:\users. And of course we’de like to not evaluate the relevance - (value “APPDATA” of key “Volatile Environment” of current user key (logged on user) of registry - 6 billions times. But the problem seems to be the relevance - (value “APPDATA” of key “Volatile Environment” of current user key (logged on user) of registry - is not written correctly or simply does not work. But it’s hard to tell since it does not run in the debugger. BTW, most of the relevance was lifted from here - http://forum.bigfix.com/viewtopic.php?id=4228 and http://forum.bigfix.com/viewtopic.php?id=3023.
Any takers on getting this working.