How to define custom launch condition for search result - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

ognaT
Posts: 6
Joined: Sun Jan 08, 2012 7:34 am

How to define custom launch condition for search result

Hi,

I'm trying to use a registry search to determine whether to continue with install and unfortunately it’s not working. Setup proceeds regardless.

I have the following registry search

Code: Select all

[INSTALLERDIR]
Root: HKEY_LOCAL_MACHINE
Key: SOFTWARE\Wow6432Node\MyCompany\MyApplication\setup
Name: UI Directory
Type: Retrieve the raw value
During install, if the registry key exists the value of [INSTALLERDIR] contains the path contained in the Name: field which is used as a target folder. On the other hand, if the registry key does not exist [INSTALLERDIR] returns C:\APPDIR.

What I'm trying to do is if [INSTALLERDIR] = C:\APPDIR then not proceed with setup. I've tried defining a Custom Launch Condition under Launch Conditions but not having much luck with it.

Any help is appreciated.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to define custom launch condition for search result

Hello,

You can try this approach:
  • use the following key for the search:

    Code: Select all

    SOFTWARE\MyCompany\MyApplication\setup
    instead of:

    Code: Select all

    SOFTWARE\Wow6432Node\MyCompany\MyApplication\setup
  • use the following custom launch condition instead:

    Code: Select all

    INSTALLERDIR
    where INSTALLERDIR is the name of your search
If you need to search the 64-bit portion of the registry on 64-bit machines, just enable a search's "Search the 64-bit portion of the registry" option.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ognaT
Posts: 6
Joined: Sun Jan 08, 2012 7:34 am

Re: How to define custom launch condition for search result

Thank you for the reply Mihai.

The registry key location is set by another department. So not sure that change is possible.

I'm a little unclear about the custom launch condition. INSTALLDIR always has a value from what I have experienced. If the registry value is present, INSTALLDIR has the folder path (ex: C:\install the application here.) If the registry value is not present INSTALLDIR has the value C:\APPDIR.

Wouldn't testing INSTALLDIR by itself always be true since it always has a value?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to define custom launch condition for search result

Hi,
INSTALLDIR always has a value from what I have experienced. If the registry value is present, INSTALLDIR has the folder path (ex: C:\install the application here.) If the registry value is not present INSTALLDIR has the value C:\APPDIR. Wouldn't testing INSTALLDIR by itself always be true since it always has a value?
Can you please attach a basic test .AIP project that proves the results of this test case?
As described in the user guide reference, the value of any search name public property will be NULL if the registry location does not exist.

FYI: Our support team usually references the user guide in blue text, thus all inline links from this post are relevant.

I am assuming you need the search result to set the APPDIR at install time. In this case you will be interested in setting the APPDIR property after the AppSearch standard action using a Property set with Formatted custom action. Since you are using a path from the registry, you might also want to conditionally display the FolderDlg dialog depending on whether or not you have the registry value containing the path.

Also, here's a similar post with a sample project attached from my colleague Gabriel.

Please forward this thread to someone who can implement our suggestions and let us know how it turned out.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”