Reputation: 19
I was built an application on Delphi 7 + Windows XP Pro Sp3 platform, the application run correctly, than i sent this application to my friend that have a Windows 7 OS, my application cannot write the initialization data to the registry with an error "Failed to set data ...", i was suggesst my friend to right clik and choose "Run as Administrator...". How can i build my application on Delphi 7 that can run and write a registry on Windows 7?
Please help, because i could not find the right solution on google right now...
Thanks in advance...
Regards Chrisna Obaja
Upvotes: 1
Views: 2971
Reputation: 21
You can only write without restriction in HKEY_CURRENT_USER section only - and that will almost be suficient.
To write other parts of registry make an installer.
Otherwise you need Administrator Rights or manifest file.
Upvotes: 2
Reputation: 613461
Modern versions of Windows have their users running without admin rights by default. This is controlled by UAC.
The solution is usually not to attempt to gain admin rights. Instead you should stop attempting things that need admin rights unless you really do need to. Typically only install programs need admin rights.
You don't say why you are writing to a restricted area of the registry but you should be able to find an alternative to doing so.
Upvotes: 6