Add Isolated Storage Files into Setup Project

40 views Asked by At

I have a Windows application that makes SQL connections to get some data. These data files are small and stored in .csv files in isolated storage, so that if the live Connection fails, the application warns the user that it is in offline mode and references the local files instead. Every time the user opens the application and connection is available, the .csv files are updated in the background.

The tester has come back to me because if, on the first time the user accesses the application, there is not SQL connection then the .csv files will not exist in isolated storage yet and errors are returned. I would therefore like to put some .csv files in the isolated storage as part of the Setup Project that creates the .msi that is used to install the application.

The Isolated storage doesn't appear in the list of special folders for the Setup Project...

Available Special Folder Types in Setup Project

How do I make it so that the files are created in isolated storage when the .msi file is executed?

Alternatively, do I need to add them to an assets folder and move them programmatically on the first use of the application? I am reluctant to do this as it seems inefficient and will make code that runs every time the application runs, but needs only to run once.

I am using Visual Studio 2019 and .NET 4.8

0

There are 0 answers