I have a small SSD drive with only 2-3 GB free space. I need the .NET desktop and C++ desktop workloads. I tried creating offline installer, that went fine and I tried -installPath option, but it only affects the studio itself and some other components but not the Windows SDK and .NET SDK, those get installed to system drive.
I did install Windows SDK and .NET SDK's to to different drive but I had to use standalone installers for each. I was wondering if it is possible to accomplish with the installer that VS 2017 comes with.
No, the VS installer only allows you to specify where packages for that instance of VS are installed (i.e. anything that goes into the folder that you do get to choose). It does not currently allow you to specify where other global packages are installed.
Someone proposed a hack in this thread
https://social.msdn.microsoft.com/Forums/en-US/3e7160ef-505e-4c48-a1aa-78e778c13ee0/install-visual-studio-2017-in-d-drive?forum=vssetup
I was able to do this using a Junction. First, I went to the
installer and found where the files on C would be installed, even when
another drive is selected:
C:\Program Files (x86)\Microsoft Visual Studio\Shared
Then, I created a new folder on H, a much larger SSD. I called it
VSSHARED.
Then I opened cmd.exe as an administrator and ran:
mklink /J "C:\Program Files (x86)\Microsoft Visual Studio\Shared"
"H\VSSHARED"
The installer, once run, placed all of the shared information into H
because it thought it was a folder in C.
And right below there's a similar reply:
enter admin privileges in cmd.exe and enter the lines below
mklink / J "C: \ Program Files (x86) \ Microsoft Visual Studio \
Shared" "F: \ msvs2017 \ shared" mklink / J "C: \ Program Files (x86)
\ Microsoft Visual Studio \ Installer" F: \ msvs2017 \ Installer "
mklink / J "C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017
\ Enterprise" "F: \ msvs2017 \ Enterprise"
change "F: \ msvs2017" to the mklink target lines by the drive and
directory where it will be installed.
have Fun
I ignore if there are any downsides to doing this.
Edit: I just noticed someone commented this solution in the comment section. Well, I think it doesn't hurt to have it as an answer.