We are trying to deploy an old VB.NET WinForm app on AWS AppStream. It uses a 3rd party component that creates and appends to a text file at runtime. We have the ability to set the directory where this file will be located, so we set the path with an app.config appSetting.
What is the best way to code this for AppStream? At runtime, AppStream users have a very limited list of folders in their File Explorer -- just "Home Folder" and "Temporary Files." I've read the docs, and know that "Home Folder" is saved to an S3 bucket for future user sessions, so that's the obvious candidate. We want users to see their previous work on future logins.
But what path should we put in the app.config? If I define it in my appSetting as "Home Folder\MyNewFile.txt"
then my code is effectively going to do this:
Dim filePath As String = "Home Folder\MyNewFile.txt"
File.AppendAllText(filePath, myNewText)
...and that's not going to work.
At runtime that directory is also C:\Users\PhotonUser\My Files\Home Folder
... but then sometimes it's D:\PhotonUser\My Files\Home Folder
.
I assume these three are really all the same, because when I make a file by hand in one I see it in all three -- but surely there's some single best way to get this done. My working theory is to use the full "C:" path, as that seems to always appear at runtime. I'd welcome any insights or suggestions.