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!

dplaut
Posts: 3
Joined: Tue May 22, 2018 1:18 pm

Read registry, check for matching text, conditionally install file

Summary: want to install a particular file if a string matches a hard-coded value.

I want to:
1) read the registry and put value into a property. I can do this, test works.
2) read value collected in step one via a custom action:ProcessData and find a matching string. I think I can do this but don't know how to test.
- set property based on this. It will be 1 or 0.
3) install 1 file always
4) install (overwrite) this file with another if the value in step 3 = 1

I can't figure it out. Help, please.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Read registry, check for matching text, conditionally install file

Hello,
2) read value collected in step one via a custom action:ProcessData and find a matching string. I think I can do this but don't know how to test.
- set property based on this. It will be 1 or 0.
To do so you could use indeed our "ProcessData" predefined custom action. To test he results you could display using a "Message Box" predefined action the value of the property (e.g. OUTPUT_PROP) set as output for the "Process Data" action. For instance, after the "Process Data" action add a subsequent "Message Box" action with the "Message" field set like this:

Code: Select all

[OUTPUT_PROP]
3) install 1 file always
4) install (overwrite) this file with another if the value in step 3 = 1
To do so you could use the approach exposed in our "Install files with the same name" article. And just make sure that for the first file component (in "Organization" page) use a condition like this:

Code: Select all

OUTPUT_PROP = "0"
and for the second file use a condition like this:

Code: Select all

OUTPUT_PROP = "1"
Please note that the "Process Data" custom action should be scheduled before the "Paths Resolution" action group.

If you have any questions or doubts just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”