My VB.NET application needs to store a text file in a local machine. Each time the application starts, it needs to write information to that text file regardless of any user in the machine.
1) Registry is out of option. User has no write access to HKEY_LOCAL_MACHINE\Software. HKEY_CURRENT_USER\Software is not preferred as users need to provide licence unlock key whenever they open application for the first time. I only want the licence unlock key to be provided once after it is installed by any user. The licence unlock key will be written in the text file.
2) I have tried Environment.SpecialFolder.CommonApplicationData
and created a folder to store the text file. It works well when administrator installs it and administrator can open the application. Once the user logs in on the same machine, the application manages to show splash screen but it stops working. No error message appears and it disappears in the Task Manager's Details tab. I still can see the text file in Environment.SpecialFolder.CommonApplicationData
.
3) I have checked other question related to this problem before. One of the comments suggested Isolated Storage. However, I am not sure if I will get the same outcome as (2) above when I use Isolated Storage.
Questions:
1) Where should the licence file be stored in a local machine, which is common to all user and all user should have write, read access to that licence file?