VS Setup project: installing files in different directories

I have a Visual Studio installation project. And I want to install one of my files in some directory on drive C. How should I do this?

Example:

I install my application in C: \ MyApp. And one file, settings.ini, in C: \ Settings \ MyAppSettings \

+3
source share
2 answers

You can try using the WindowsVolume property:

  • go to file system editor
  • right-click the tree element "File system on the target machine" and select "Add special folder" β†’ "User folder" in the context menu
  • rename the new folder to something friendly, such as "C Drive"
  • select folder
  • in the DefaultLocation property bar - [WindowsVolume]
  • in this custom folder add the desired folder structure (MyApp, Settings, etc.).
+4
source

Since this turned out to be pretty high in Google’s results - anyone who wants to put a file on a drive that is not a Windows volume (i.e. a network drive, or if Windows is not located on drive C):

Follow the answer provided by @Cosmin above (add a special folder to the installer file system), but enter the drive literal.

For example, set DefaultLocation to c:\MyApp or z:\desired\location .

+1
source

Source: https://habr.com/ru/post/1315422/


All Articles