This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- How to list the files in a directory and prompt user to select one and read the selected file
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 08, 2019
12:14 PM
How to list the files in a directory and prompt user to select one and read the selected file
Hello Experts, I have a requirement, where I have multiple config files in a directory. And, our InstallAnywhere script should be able to real all the files in the directory and list them with index for user selection. Once user selects a config file, we should take that input and read the file in Linux environment. Do we have any plugins to help with this or can you suggest a way to do this. Thanks, Rakesh.
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 18, 2019
12:13 PM
Hi, rakesh_dama. Thank you for your post.
You could try using the InstallAnywhere Properties File Reader Plugin Action in the online HelpNet documentation here:
https://helpnet.flexerasoftware.com/installanywhere2018/roottopic.htm#helplibrary/ia_ref_plugins_propfilereader.htm
Your config file needs to be in a key-value pair format, such as the following:
MyTestKey=MyTestValue.
I tested with a test config file, which was a plain text file: test.config.
An InstallAnywhere variable $MyTestKey$ is initialized when the action reads the key-value pair from the config file.
You could try resolving $MyTestKey$ with the syntax: $MyTestKey$.
In my test, this resolved to: MyTestValue.
Please give this a try. Does that work for you?
Thanks,
Flexera_Ian
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 19, 2019
04:09 PM
Hi Ian,
Thanks for your response.
The requirement here is not to read config file. That I am doing anyway.
Requirement here is, read the filenames in a folder and prompt user to select a file from that folder.
example: I have a.config,b.config,c.config files in configs directory. I want to prompt user to select one config file among these from configs directory.
Thanks,
Rakesh.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 22, 2019
09:25 AM
Hi Rakesh.,
You could try using the Choose File Panel. This will allow the user to select a file from a folder.
Thanks,
Ian
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 22, 2019
02:48 PM
Thanks Ian, Will give it a try and let you know.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 23, 2019
09:40 AM
You're welcome, Rakesh. Sounds good.
Thanks,
Ian