Search code examples
visual-studio-2010visual-studiosetup-project

Install files to each users Application Data Folder using Visual Studio Setup project


I have created a visual studio setup project that writes content files to User's Application Data Folder C:\users\user\AppData\Roaming\CompanyName

I did this By adding User's Application Data Folder in File System on Target Machine link from setup project and adding content files to that folder.

When I install this setup it installs only for one user(active). I want this to install content files to all users AppData folders

Example folder locations:

1.C:\users\user1\AppData\Roaming\CompanyName 2.C:\users\user2\AppData\Roaming\CompanyName

How to install these content files to each and every user's AppData folder on the machine using Visual Studio Setup project.

Any help is greatly appreciated.


Solution

  • The short answer is that you can't. There's no way of enumerating all those folders and installing files to them, and that won't work anyway if a user account gets created after your setup has been installed.

    The good news is that it should just work. Assuming your installed app has a shortcut to the program, and the setup was installed for Everyone, log on as another user and use the shortcut. What should happen is that Windows will notice that the user doesn't have the files and it will ask for the original MSI file to install them. This works even if the user account wasn't present at the time of the install, and will happen just once per new user of the app to install the files.