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!

MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Read registry value for path

Hello,

I have an installer built for application "A" - let's say the application gets installed by the user to "C:\A\bin"

I have another installer built for my plugin "P"

I was thinking about setting a registry key in HKLM under my company key and using the "APPDIR" install property of "A" to set as the base install directory of "P". So "P" would be installed in "C:\A\bin\P" ( see attachments )

I would like to use the FolderDlg "Init Events" somehow to set this path and then make it read only... ( see attachment )

How can I read the value of the registry key during the installation of "P"
Attachments
RegistryValues.PNG
RegistryValues.PNG (29.5 KiB) Viewed 12948 times
FolderDlg.PNG
FolderDlg.PNG (347.33 KiB) Viewed 12948 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Read registry value for path

Hi Mike,

To achieve this you can, indeed, write the "A" application folder to the registry during the installation, then create a registry search in the "P" package that will get that registry value and use a "Set installer property" custom action to set the search value to the "APPDIR" property as in the following example:
  • Property: APPDIR
    Value: MY_SEARCH
As you mentioned, you can set the "Path Edit" field from the "FolderDlg" dialog of the "P" package to read-only.

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

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Read registry value for path

Hello,

I guess I was not clear enough..

How do I "create a registry search in the "P" package that will get that registry value" ?

That's the part I am stuck on... where do you have a registry search function in the installer?

Mike
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Read registry value for path

Hello again,

I dug around and found the "search", made one and hooked it up like I thought it was supposed to run.

I will attach snap shots of my results
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Read registry value for path

Searching the registry
Install_Dir_01.PNG
Install_Dir_01.PNG (47.8 KiB) Viewed 12941 times
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Read registry value for path

Testing the registry search:
Install_Dir_02.PNG
Install_Dir_02.PNG (13.63 KiB) Viewed 12941 times
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Read registry value for path

Edit box "Init Event"
Install_Dir_03.PNG
Install_Dir_03.PNG (12.17 KiB) Viewed 12941 times
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Read registry value for path

Edit box Init Event details:
Install_Dir_04.PNG
Install_Dir_04.PNG (40.93 KiB) Viewed 12941 times
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Read registry value for path

Testing the plugin install package
( picks up the right path from the registry )
Install_Dir_05.PNG
Install_Dir_05.PNG (171.82 KiB) Viewed 12941 times
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Read registry value for path

Error during install:
Install_Dir_06.PNG
Install_Dir_06.PNG (23.94 KiB) Viewed 12941 times
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Read registry value for path

NOTE: The c:\Temp\_Logs directory does exist on disk... but the Plugins\SoftwareInventory part does not... do I need to create that from the installer?
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Read registry value for path

I added the "MANAGER_INSTALL_DIR" to the Files and Folders... but it did not resolve it
Install_Dir_07.PNG
Install_Dir_07.PNG (20.37 KiB) Viewed 12941 times
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Read registry value for path

Please see the attached log file
Attachments
LogFile.txt
Log file with error
(47.02 KiB) Downloaded 631 times
Last edited by MLiss@Cetrus.com on Wed May 11, 2016 4:28 pm, edited 1 time in total.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Read registry value for path

Hi Mike,

The problem appears because the "MANAGER_INSTALL_DIR" value is assigned to the "APPDIR" property, but that value is not a valid path. The value of the "MANAGER_INSTALL_DIR" property should be assigned to the "APPDIR" property, not the "MANAGER_INSTALL_DIR" value itself.

You might have written that value in the "Install Parameters" page or in a "Set installer property" custom action. If you are not able to find it, please send me your AIP file to support at advancedinstaller dot com, so I can investigate it, too.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Read registry value for path

Please review ALL of the snapshots I have provided.

The value of "MANAGER_INSTALL_DIR" IS A VALID path. The "Test result of the searches" confirms it
Install_Dir_02.PNG
Install_Dir_02.PNG (13.63 KiB) Viewed 12934 times

Return to “Building Installers”