cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
rakesh_dama
Active participant

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.
Labels (1)
0 Kudos
5 Replies
Flexera Flexera_Ian
Flexera

Re: How to list the files in a directory and prompt user to select one and read the selected file

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_pro... 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
0 Kudos
rakesh_dama
Active participant

Re: How to list the files in a directory and prompt user to select one and read the selected file

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.

0 Kudos
Flexera Flexera_Ian
Flexera

Re: How to list the files in a directory and prompt user to select one and read the selected file

Hi Rakesh.,

You could try using the Choose File Panel. This will allow the user to select a file from a folder.

Thanks,

Ian

0 Kudos
rakesh_dama
Active participant

Re: How to list the files in a directory and prompt user to select one and read the selected file

Thanks Ian, Will give it a try and let you know.
0 Kudos
Flexera Flexera_Ian
Flexera

Re: How to list the files in a directory and prompt user to select one and read the selected file

You're welcome, Rakesh. Sounds good. Thanks, Ian
0 Kudos