64 bit registry permission does not take effect if "Keep existing permissions" is checked - Advanced Installer Community
alco
Posts: 80
Joined: Thu Nov 18, 2010 5:02 pm

64 bit registry permission does not take effect if "Keep existing permissions" is checked

I sent this issue thru email 2 days ago and still haven't got a reply so I thought I might try here.

We'd like to report what seems like a bug when setting 64 bit registry permissions w/ "Keep existing permissions" checked. With this setting, the installer doesn't seem to add the permissions on top of existing ones.

https://321.show/VmWcGsvXFNW

If we uncheck this box, then we find that the installer removes existing permissions and replaces them w/ the one set in the package.

We're using AI 12.4, so I'm not sure if this was already fixed in recent versions - we'd like to hold off upgrading to avoid possible install issues w/ recent versions. So is there a workaround for this in 12.4? If not, what version has the fix?

Btw, the findings are based on the steps enumerated in https://www.advancedinstaller.com/user- ... istry.html

To clarify, we want the permissions to be set for both the 64 bit & 32 bit registry keys. So for 32 bit system, it must set the permission on

Code: Select all

HKLM\Software\Subkey
and on 64 bit system, it must set permission on

Code: Select all

HKLM\Software\Subkey
HKLM\Software\WOW6432Node\Subkey
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: 64 bit registry permission does not take effect if "Keep existing permissions" is checked

Hello Albert,

First of all, I apologize for the delayed reply but we were quite busy lately.

I have started working on your ticket and as soon as I will have a conclusion, I will get back to you.

Thank you for your patience.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: 64 bit registry permission does not take effect if "Keep existing permissions" is checked

Hello Albert,

First of all, thank you for your patience on this.

Indeed, after further investigating this, you are right, the installer does not add the permissions on top of the existing ones. This was a bug in Advanced Installer and this was fixed in version 12.5.1.

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
alco
Posts: 80
Joined: Thu Nov 18, 2010 5:02 pm

Re: 64 bit registry permission does not take effect if "Keep existing permissions" is checked

Is there a workaround that can be done for 12.4? We'd like to hold off upgrading since it may require more time w/c would delay our release.

Also, why is the fix not listed in 12.5.1 release?
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: 64 bit registry permission does not take effect if "Keep existing permissions" is checked

Hello Albert,

As a workaround, you could try to use a custom action that will set the registry permissions. The custom action could be added after the "Add Resources" action group in the "Custom Actions" page.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: 64 bit registry permission does not take effect if "Keep existing permissions" is checked

Hello Albert,

As a workaround, you could try to use a custom action that will set the registry permissions. The custom action could be added after the "Add Resources" action group in the "Custom Actions" page.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
alco
Posts: 80
Joined: Thu Nov 18, 2010 5:02 pm

Re: 64 bit registry permission does not take effect if "Keep existing permissions" is checked

How would this Custom Action/s look if I want to set the permissions on both the 64-bit registry and the WOW6432Node registry in 64-bit OS and 32-bit OS? Can you give a concrete example?

Also, I still don't see the bugfix listed in the 12.5.1 release notes. Was it intentionally dropped from the list?

Thanks!
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: 64 bit registry permission does not take effect if "Keep existing permissions" is checked

Hello Albert,

In order to achieve that, we will make use of the "Access Control List (ACL)". Here is a PowerShell script that will set the registry permissions as per your needs:

Code: Select all

# gets the access control list and store it in the $acl variable
$acl = Get-Acl "HKLM:\SOFTWARE\MyKey"
# the NTAccount Class represents a user or a group account. In our case, we
# need to make use of the "BuiltIn\Users" account.
$users = [System.Security.Principal.NTAccount]"BuiltIn\Users"
# the RegistryRights Enumeration specifies the access control rights
# that can be applied to registry objects.
$access = [System.Security.AccessControl.RegistryRights]"SetValue"
# the Inheritance flags specify the semantics
# of inheritance for access control entries (ACEs).
$inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit,ObjectInherit"
# the PropagationFlags Enumeration specifies how access control entries (ACEs)
# are propagated to child objects.
$propagation = [System.Security.AccessControl.PropagationFlags]"None"
# the AccessControlType Enumeration specifies whether an AccessRule object is used
# to allow or deny access.
$type = [System.Security.AccessControl.AccessControlType]"Allow"
$rule = New-Object System.Security.AccessControl.RegistryAccessRule($users, $access,$inheritance, $propagation, $type)
$acl.AddAccessRule($rule)
$acl |Set-Acl
The above can be added in your project as a "Run PowerShell inline script" custom action. The custom action should be added after the "Add Resources" action group, because the action that creates the registry\ies specified in the "Registry" page ("WriteRegistryValues" is part of the "Add resources" action group).

The "Execution TIme" for your custom action should be of "When the system is being modified (deferred)" and the "Execution Options" should be as it follows:

- Run under the LocalSystem account with full privileges (no impersonation) --> ticked
- Wait for custom action to finish before proceeding --> ticked
- Fail installation if custom action returns an error --> ticked

Also, you can make your custom action to only execute during the Install process by unchecking the "Uninstall" and "Maintenance" options from under the "Execution Stage Condition" section.
set the permissions on both the 64-bit registry and the WOW6432Node registry in 64-bit OS and 32-bit OS?
This can be done from within your script settings. If you plan on changing the permissions for a registry whose component is of 64-bit (does not write its value under WOW6432NODE), then you can tick the "64-bit script" option which is located to the right side of the "Parameters" field.

In the following lines, you'll find attached a sample project for your reference.
Your Application.aip
(19.31 KiB) Downloaded 449 times
The above project creates two registry keys, with the same name, under both SOFTWARE and SOFTWARE\WOW6432NODE and then the two scripts change the key's permissions.

Also, you can have a look on the following "RegistryAccessRule(String, RegistryRights, InheritanceFlags, PropagationFlags, AccessControlType)" article which I think you may find useful.

Also, the bug fix does not appear in 12.5.1 release notes, because it was actually fixed in 12.5:

https://www.advancedinstaller.com/release-12.5.html

I apologize for the inconvenience.

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
alco
Posts: 80
Joined: Thu Nov 18, 2010 5:02 pm

Re: 64 bit registry permission does not take effect if "Keep existing permissions" is checked

Thanks for the detailed reply and awesome support, Catalin!
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: 64 bit registry permission does not take effect if "Keep existing permissions" is checked

You are always welcome, Albert.

Glad I could help.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”