How to install a file in app data in setup project (C#)
-
27-10-2019 - |
Question
I want to install my database to a separate folder (@ C:\Users\User1\AppData\Roaming\Company1\database.mdb)
I'm using a C# setup project.
How can I do it?
Solution
- Right-click on the project and select View -> File System
- in the new File System screen, right-click the root node (File System on target Machine) and select Add Special Folder -> User's Application Data Folder
- Select the newly added folder form the treeview and create any sub-folder structure you need
- Finally select your destination folder, right-click, Add -> File and select the .mddb file.
OTHER TIPS
Right click on your Setup project -> View -> File System. Then you could add a custom folder and set its default location to [CommonAppDataFolder]
:
Then add your database file to this folder.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow