How to detect existence of D: Drive before installation begin - Advanced Installer Community
ejesuraj
Posts: 3
Joined: Wed Apr 10, 2019 5:42 pm

How to detect existence of D: Drive before installation begin

Hi,

I want to fail the installation if there is no D: drive on the system.

How do I search for fixed drives?
Thanks,
Elizabeth.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: How to detect existence of D: Drive before installation begin

Hello Elizabeth and welcome to our forums,

This can be achieved through our support for Searches.

You can go to "Searches" page -> right click on the "Target Computer" --> "New Search" --> right click on the newly created search and select "Add search location" --> "Registry".

The drive letters can be found at the following registry key:

Code: Select all

HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices
For instance, the drive D:\ looks like this:

Name: \DosDevices\D:
Type: REG_BINARY
Data: big binary string

With that being said, your search should look something like this:

Root: HKEY_LOCAL_MACHINE
Key: SYSTEM\MountedDevices
Name: \DosDevices\K:
Type: Retrieve the raw value


The property that stores the search result can have two values:

1. the binary string if it exists
2. empty string if it does not exist

Now, in order to fail the installation, we will use the "ErrorMessage" custom action. To do so, please go to "Custom Actions" page and add the error message custom action with sequence. In order to add a custom action with sequence, all you have to do is to press the "Add custom action with sequence" button which is placed to the right side of the custom action's name.

The custom action needs to be scheduled after the "Paths Resolution" action group (in the "Wizard Dialogs Stage"). To schedule it at that point, simply drag and drop it to the appropriate group.

After doing so, simply condition it as it follows:

Code: Select all

RESULT_PROPERTY = ""
where the "RESULT_PROPERTY" is the property that stores the result of the earlier created search.

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ejesuraj
Posts: 3
Joined: Wed Apr 10, 2019 5:42 pm

Re: How to detect existence of D: Drive before installation begin

Hi Catalin,

Thanks for your reply.

When I right Target Computer->Add Location has 4 submenu. But they are all greyed out. Any idea why this could be?

With Best Regards,
Elizabeth.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: How to detect existence of D: Drive before installation begin

Hello Elizabeth,

First of all, you must create the search and then add the search location. With that being said, when you first right click on the "Target Computer" -> "New Search". After doing so, click on the earlier created search and the select "Add Search Location".

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ejesuraj
Posts: 3
Joined: Wed Apr 10, 2019 5:42 pm

Re: How to detect existence of D: Drive before installation begin

Hello Catalin,

Thanks for the update. My issue is resolved with your help.

Have a great day,
Elizabeth.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: How to detect existence of D: Drive before installation begin

You are always welcome, Elizabeth.

Glad I could help.

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

Return to “Common Problems”