How to install a file in app data in setup project (C#)

Just for completeness, here is the official documentation for changing the folders: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/716bxh4e(v=vs.100)

  1. To add a custom folder that targets a predefined Windows folder In the folder list of the File System Editor, select the File System on Target Machine node.
  2. On the Action menu, point to Add Special Folder, and then click Custom Folder. The new folder is highlighted in the folder list.
  3. Type a name for the custom folder. For example, to target the Temp folder, type "Temp Folder".
  4. In the Properties window, select the DefaultLocation property and enter the Windows Installer system folder property for the folder you wish to target. For example, the property for the Temp folder is [TempFolder]. For a list of system folder properties supported by Windows Installer, see System Folder Properties.

Here is a list of all folder properties: https://learn.microsoft.com/en-us/previous-versions//aa372057(v=vs.85)?redirectedfrom=MSDN

Property Description
AdminToolsFolder The full path to the directory that contains administrative tools.
AppDataFolder The full path to the Roaming folder for the current user.
CommonAppDataFolder The full path to application data for all users.
CommonFiles64Folder The full path to the predefined 64-bit Common Files folder.
CommonFilesFolder The full path to the Common Files folder for the current user.
DesktopFolder The full path to the Desktop folder.
FavoritesFolder The full path to the Favorites folder for the current user.
FontsFolder The full path to the Fonts folder.
LocalAppDataFolder The full path to the folder that contains local (nonroaming) applications.
MyPicturesFolder The full path to the Pictures folder.
PersonalFolder The full path to the Documents folder for the current user.
ProgramFiles64Folder The full path to the predefined 64-bit Program Files folder.
ProgramFilesFolder The full path to the predefined 32-bit Program Files folder.
ProgramMenuFolder The full path to the Program Menu folder.
SendToFolder The full path to the SendTo folder for the current user.
StartMenuFolder The full path to the Start menu folder.
StartupFolder The full path to the Startup folder.
System16Folder The full path to folder for 16-bit system DLLs.
System64Folder The full path to the predefined System64 folder.
SystemFolder The full path to the System folder for the current user.
TempFolder The full path to the Temp folder.
TemplateFolder The full path to the Template folder for the current user.
WindowsFolder The full path to the Windows folder.
WindowsVolume The volume of the Windows folder.

When using them, make sure to use the square brackets [] around the property names.


  1. Right-click on the project and select View -> File System
  2. 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
  3. Select the newly added folder form the treeview and create any sub-folder structure you need
  4. Finally select your destination folder, right-click, Add -> File and select the .mddb file.

Right click on your Setup project -> View -> File System. Then you could add a custom folder and set its default location to [CommonAppDataFolder]:

enter image description here

Then add your database file to this folder.