B4J Question [Solved] Determination of application installation folder

bdunkleysmith

Active Member
Licensed User
Longtime User
Following on from this post https://www.b4x.com/android/forum/t...able-controls-from-features-text-file.147581/ where I have successfully recalled a series of application settings from a "Features" file which I have initially stored in the \Users\Public\Documents\BDSConsulting\ApplicationName folder along with other application configuration files, I want to move the "Features" file to a folder within the application installation directory so it is not as visible to the user.

Using:

B4X:
#CustomBuildAction: After Packager, %WINDIR%\System32\robocopy.exe, ..\ temp\build\lib\ Features

I have put the "Features" file in the \lib subfolder of the application's installation folder, but now I'm struggling to work out B4J code that can determine the application installation folder, eg. C:\Program Files\BDS Consulting\BDSSynergyPlayerBoard, at runtime and so be able to read back the data in the "Features" file, .

I can construct it using:

B4X:
Dim FeaturesFolder as String = GetEnvironmentVariable("programfiles", Null) & "\BDS Consulting\BDSSynergyPlayerBoard\lib"

but this assumes the user has installed the app in the default folder defined in Inno and I need to account for the situation where the user chooses to use an alternative installation folder.

Any suggestions would be appreciated.
 

bdunkleysmith

Active Member
Licensed User
Longtime User
Thanks @aeric - so simple. I thought something more complicated was required and that's probably why I couldn't find anything during much searching of the Forum.
 
Upvote 0
Top