Default location for Browse Button - Advanced Installer Community
baruchi
Posts: 21
Joined: Tue Aug 25, 2020 7:51 pm

Default location for Browse Button

Hi,
I want to set the default location for a brows button based on registry key.
This value will populate the brows text box and be the default search location.
This location will later be used as the application installation folder.

I want to check if
\HKEY_CURRENT_USER\SOFTWARE\...\V2\LastRun
exist and if yes use its value as the default for the browse.
If it does not exist use:
\HKEY_CURRENT_USER\SOFTWARE\...\V1\LastRun

Currently my install dir is set to search criteria [MYINSTALLDIR]
I created another search criteria [MYINSTALLDIR2]. I guess I can also create another search criteria to check if \HKEY_CURRENT_USER\SOFTWARE\...\V2\LastRun exists.

So at the end I want my installation dir to be MYINSTALLDIR2 if \HKEY_CURRENT_USER\SOFTWARE\...\V2\LastRun exists and if not use MYINSTALLDIR

How can I achieve this?

B.
Liviu
Posts: 1419
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Default location for Browse Button

Hello,

Indeed, you can use a search to find the value. After that, you can add a Set installer property custom action scheduled after the Searches action group and before Paths Resolution.

You can use the search result to condition the custom action. For example, if the RESULT_PROPERTY is not empty, you set the APPDIR value to the RESULT_PROPERTY property or any other value.
set property custom action.png
set property custom action.png (91.94 KiB) Viewed 8639 times

Hope this helps! Let us know if you have any questions.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”