Page 1 of 1

Set registry key permissions in HKLM (Win 7 64bits)

Posted: Fri Jul 26, 2013 12:45 pm
by frank5625
Hi,

I'm trying to add permissions on a registry key in LocalMachine (HKLM) and it doesn't work.
I've enabled the 64 bits mode:
Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
I'm using InstallAware Studio 15. To create my testing project, I've used the Setup64 template on a 64 bit Win 7 machine.

On a native 64-bit project the result is the following:
The registry key is written but permissions aren't set. It works for HKCR and HKCU but not for HKLM.

I've attached the full code of my project (mia.txt) (take a look at lines 167 to 172).
WriteRegistryTest.mia.txt
(8.37 KiB) Downloaded 581 times


Here's what I try to do:

Code: Select all

Check Registry Key HKLM\SOFTWARE\MySoftwareA\ into CHKREGEXISTS
  if Variable CHKREGEXISTS Equals NO$KEY
    Write Registry Key HKLM\SOFTWARE\MySoftwareA\,  (permanent)
    Apply Install
  end
  Set Read Write Permissions on Registry Key "HKLM\SOFTWARE\MySoftwareA" for Everyone


The same code but in MSI format is the following:

Code: Select all

~InstallAware Clipboard Data~
~Set Access Control~
~{54CC5BBE-B905-4F7A-8765-59470545920C}~
~HKLM\SOFTWARE\MySoftwareA~
~TRUE~
~FALSE~
~FALSE~
~FALSE~
~~
~TRUE~
~TRUE~
~TRUE~
~FALSE~
~FALSE~
~FALSE~
~FALSE~
~TRUE~
~FALSE~
~FALSE~
~End~
~{0AA5431A-6C8A-45B0-98EA-5AC2C94BBF5F}~
~Apply Changes~
~{E850121F-2148-4409-BD3E-B576A09258CD}~
~~
~~
~TRUE~
~FALSE~
~Write Registry~
~{53D87458-00E0-49EB-ACA0-C6DFC491B4C1}~
~10~
~2~
~SOFTWARE\MySoftwareA~
~~
~~
~TRUE~
~FALSE~
~If~
~{29B6E05B-13CA-4B44-8DEF-86965CE976DC}~
~CHKREGEXISTS~
~0~
~NO$KEY~
~FALSE~
~Check Registry~
~{520E58F7-92E7-4729-9FBB-DCC30DF50C52}~
~CHKREGEXISTS~
~2~
~SOFTWARE\MySoftwareA~
~~



Thanks a lot!

Re: Set registry key permissions in HKLM (Win 7 64bits)

Posted: Mon Jul 29, 2013 5:48 am
by FrancescoT
Dear Frank,

... let me check it.

Regards

Re: Set registry key permissions in HKLM (Win 7 64bits)

Posted: Mon Jul 29, 2013 9:37 am
by FrancescoT
Dear Frank,

I have just tested what you reported and I am not able to replicate the same.
I used IA 15.51 and IA 16.07 with my verification ... and with both versions, the registry key permissions for "HKLM\SOFTWARE\MySoftwareA" are correctly assigned to Everyone with Read & Write permissions.

Regards

Re: Set registry key permissions in HKLM (Win 7 64bits)

Posted: Mon Jul 29, 2013 12:41 pm
by frank5625
Dear FrancescoT,

Thanks for your reply. I might try with a more recent version then.