somethingelse
Posts: 7
Joined: Fri May 04, 2012 9:59 pm

looking to add registry keys if another registry key exists

Hello,

I would like to create a simple patch that checks whether a specific registry key exists and if so add an additional registry key. I was looking through the help documentation on creating custom actions and the interfaces appears to be geared toward creating custom actions that launch a specific file or script rather than simply updating a registry key. In addition, I am having trouble experimenting with custom actions as the [ New Installed Custom Action ] toolbar button listed in the documentation does not seem to be within the 9.1 interface. I unfortunately am unaware on how to create a custom action without using the wizard since I cannot locate this button (and again, the wizard does not appear to be able to create search and add of registry keys). How would you suggest I approach building this small patch that only checks then adds a registry key. Should I be using custom actions or the patch mechanism? A step by step walkthrough or a link to such a walkthrough would be very much appreciated.

Thank you
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: looking to add registry keys if another registry key exi

Hello,

In order to obtain what you want you should proceed like this:
- Go to "Search" page and create a "New Extended Search" (i.e. KEY_SEARCH) like this:
  • Criteria: Registry key exists
    Registry key: KEY PATH
Please keep in mind that by default the registries searches use 32-bit locations no matter on what operating system (32-bit or 64-bit) your application runs. You can take a look on our "Wow6432Node registry key" article.

- If you want your registry search to use 64-bit location, then you should go to "Table Editor" page and select "AI_AppSearchEx" table. Here select the row containing KEY_SEARCH property and set the "Platform" field to 1.
- Go to "Registry" page and create the new registry key you want to be added. Select the new key and from its context menu choose "Properties..." option. In the new dialog select "Create (if absent) at install" option from "Registry Key" tab.
- If you want the new created registry key to be installed based on the KEY_SEARCH result, then you should condition the related key component installation from "Organization" page. Just press F8 keyboard shortcut from the "Registry" page while having the key selected. From "Component Properties" right pane add the following install condition:
  • Condition: KEY_SEARCH
- Also, if you want the new created registry key to be installed, on 64-bit machines, into 64-bit portion of registry then you should mark its component as "64-bit Component".
I am having trouble experimenting with custom actions as the [ New Installed Custom Action ] toolbar button listed in the documentation does not seem to be within the 9.1 interface.
If you want to add a new installed custom action, then you should use [Installed File] toolbar button from "Custom Action" tab.

Let us know if this helps, otherwise please give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
somethingelse
Posts: 7
Joined: Fri May 04, 2012 9:59 pm

Re: looking to add registry keys if another registry key exi

This method did work for me, thank you
Peter
Posts: 17
Joined: Thu Dec 10, 2015 11:52 am

Re: looking to add registry keys if another registry key exi

Daniel wrote:
- If you want your registry search to use 64-bit location, then you should go to "Table Editor" page and select "AI_AppSearchEx" table. Here select the row containing KEY_SEARCH property and set the "Platform" field to 1.
Thank you Daniel,
this also Works for me.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: looking to add registry keys if another registry key exists

You're always welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”