- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- RegDBSetKeyValue error ACCESS_DENIED on HKCU\...\Policies subkey
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
RegDBSetKeyValue error ACCESS_DENIED on HKCU\...\Policies subkey
In a basic MSI project,
I want to create a subkey in HKCU\SOFTWARE\Policies
(the whole key is HKCU\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallForcelist (*) )
Then I want to set a value and its data under this key.
1°) I create the subkey within a Component. this step is good: the subkey is well installed.
2°) Then i set the value by an InstallScript Custom Action.
the function code contains a call to RegDBSetKeyValueEx with the specified key (*).
This step runs into an error:
The problem is that RegDBSetKeyValueEx fails to update the data
with error ACCESS_DENIED.
The custom action is run in deffered context.
Can I call directly the Win32 API RegSetKeyValue with my script instead?
https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regsetkeyvaluea
What is the prototype to declare in my script ?
Thanks.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)