- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Editing a file to update the file path by opening a choose folder
- 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
Hi,
I need to run a Post-Install action to update a .ENV file with a file path by opening a choose folder dialog box by the end-user.
In the .ENV file, I have the following key-value pair separated by the equal sign as the data path.
DATA_ROOT=<C:\path\to\data\folder>
Once the user selects the folder I need to update the <C:\path\to\data\folder> in the .ENV file.
How can I do this as a Post-Install action?
InstallAnywhere Version is: 2021 SP2
Thank you very much
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
It is simple. Capture the path into a variable and for your debugging purpose first display that value using Show Message Dialog . You already said that you have static line in your file DATA_ROOT=<C:\path\to\data\folder> so use "Modify Text File - Single File" inbuilt option , search for your string and replace it with already captured value which is in variable. just go through the InstallAnywhere help for this option, it is quiet easy.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
It is simple. Capture the path into a variable and for your debugging purpose first display that value using Show Message Dialog . You already said that you have static line in your file DATA_ROOT=<C:\path\to\data\folder> so use "Modify Text File - Single File" inbuilt option , search for your string and replace it with already captured value which is in variable. just go through the InstallAnywhere help for this option, it is quiet easy.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @madhug,
Thank you very much for the reply.
This was very helpful as a beginner to the application.
regards