I have written a c# application that it is installed as many instances, on different directories defined by the user. e.g.
C:\Program Files(x86)\MyApp1
C:\Program Files(x86)\MyApp2
C:\MyApp1
C:\MyApp2
...
I want to write/read data files in separated directories, one for each of these instances, at Environment.SpecialFolder.LocalApplicationData
.
What is the best approach to use in my code in order to reference the corresponded directory from each installed executable. e.g.
C:\Program Files(x86)\MyApp1\app.exe to reference unique app dir C:\Users\xxxx\AppData\Local\MyApp1\
You can append a unique value onto the end of the path: C:\Users\xxxx\AppData\Local\MyApp\ghfdsjgb23
If there is no such unique value per installation, you can use a hash of the installation path or similar.