4

I have Visual Studio Setup project. And I want to install one of my file to some directory on drive C. How am I supposed to do it?

An example:

I'm installing my app in C:\MyApp. And one file, settings.ini, to C:\Settings\MyAppSettings\

Ksice
  • 3,277
  • 9
  • 43
  • 67

2 Answers2

6

You can try using the WindowsVolume property:

  • go to File System Editor
  • right-click the "File System on Target Machine" tree item and select "Add Special Folder" -> "Custom Folder" context menu
  • rename the new folder to something friendly, for example "C Drive"
  • select the folder
  • in its Properties pane set DefaultLocation to [WindowsVolume]
  • in this custom folder add the folder structure you want (MyApp, Settings etc.)
bluish
  • 26,356
  • 27
  • 122
  • 180
Cosmin
  • 21,216
  • 5
  • 45
  • 60
  • 1
    To make it work I had to add a backslash at the end of DefaultLocation, hence: [WindowsVolume]\. – bluish Oct 29 '12 at 13:18
  • I have a file in D:\Insatller and need to copy it to D:\CSS\..\debug, but Didn't understand the procedure, as where the file to be copied is available in the first place and do we need to create folder structure like D->CSS->...->debug under custom folder? – Puneeth Mar 10 '17 at 09:19
  • I have a file in D:\Insatller and need to copy it to D:\CSS\..\debug, but Didn't understand the procedure, as where the file to be copied is available in the first place and do we need to create folder structure like D->CSS->...->debug under custom folder? Or do I need to edit DefaultLocation property to D:\Installer or D:\CSS\..\debug? – Puneeth Mar 10 '17 at 10:13
3

As this turned up quite high in the Google results - anyone looking to put the file onto a drive that is not the Windows volume (ie a network drive, or if Windows is not on C drive):

Follow the answer provided by @Cosmin above (add special folder in installer's file system), but put the literal drive path in.

Eg set DefaultLocation to c:\MyApp or z:\desired\location.

bluish
  • 26,356
  • 27
  • 122
  • 180
SeeMoreGain
  • 1,263
  • 16
  • 36