Hi BigChimp,
thank you for you tips. Here's what've done:
I've attachted a zip-File wich contains a DemoProject of my project:
In the Form's OnCreate-Event, the programs checks wether exists the given Registry-Key, if not it should create it.
That are these lines:
Registry.OpenKey('\CurrentControlSet\Control', true);
// the error occurs in this line:
if not Registry.KeyExists('StorageDevicePolicies') then Registry.CreateKey('StorageDevicePolicies');
Registry.OpenKey('\StorageDevicePolicies', true);
As far as I know, this one line should do the same, but it doesn't:
Registry.OpenKey('\CurrentControlSet\Control\StorageDevicePolicies', true);
The error occurs in the marked line.
Important: To edit the Windows Registry, administration-rights are required! So you've to start the compiled project in name of administrator!
My Lazarus Version is 0.9.30 with FPC Version 2.4.2 inside.
I'm using Windows 7 32bit
Greetings,
bastla