I am looking for working (obviously) Delphi 7 code so I can check whether my program is started with administrator rights<
The Microsoft recommended way to solve this issue: Split the application into two.
http://msdn.microsoft.com/en-us/library/aa511445.aspx
The first app checks whether it is necessary to run the second one.
The second app contains a "require admin" manifest (like David wrote) and you open it with the ShellExecuteEx 'runas' verb.
In case of a web updater the workflow could be like this:
Updater1.exe
Updater2.exe
This has several advantages:
It also works on Windows XP, you get presented with a login dialog if you are not an admin.