asif0012
Posts: 44
Joined: Tue Nov 22, 2022 6:30 pm

How to dynamically find a registry value to prevent prerequisite installation

Thu Nov 24, 2022 7:59 am

I want to use a registry key to check if a prerequisite is installed or not. How can I do that in the "Install conditions" section to prevent the prerequisite from being installed?

Below I have attached an image of the registry. I want to find a registry value under the "Uninstall" key. Under the "Uninstall" key, there are subkeys by GUIDs. I want to find the correct subkey which has the desired "DisplayName" and extract some value from that GUID registry key.
Image
Attachments
Screenshot 2022-11-24 124333.png
Screenshot 2022-11-24 124333.png (112.88KiB)Viewed 4318 times

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: How to dynamically find a registry value to prevent prerequisite installation

Thu Nov 24, 2022 11:41 am

Hello and welcome to our forums,

In order to achieve that, please have a look over the following how-to which I've created specifically for this scenario:

Prerequisite install detection criteria - How to create one

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

asif0012
Posts: 44
Joined: Tue Nov 22, 2022 6:30 pm

Re: How to dynamically find a registry value to prevent prerequisite installation

Tue Nov 29, 2022 9:33 am

Hi,
In the suggested link, the process is used to find a subkey that is fixed. The location of the subkey is known. But my use case is a little bit different. I don't know the exact subkey, it can be any GUID. But I know the DisplayName of the registry key. I want to search all the subkeys under a registry key and get my required key. Can I dynamically find the specific key by using the display name? Outside of Advanced Installer, I can find it using PowerShell. Is possible to do it in the "Install conditions" of a prerequisite using a Custom Action or Advanced installer search functionality or any other way?

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: How to dynamically find a registry value to prevent prerequisite installation

Tue Nov 29, 2022 9:44 am

Hello,

I might have misunderstood your first request, sorry for that.

Indeed, I'm afraid that you can not do a search dynamically, at least not with the predefined support we have.

However, it's great that you managed to recursively do the search in PowerShell. You can easily add your PowerShell script in Advanced Installer through a "PowerShell Inline Script" custom action.

You can then schedule the custom action right after the "Search" action group (this is when the searches are performed during the installation).

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”