Allow tools\razzle & nuget restore to work with NuGet 5 and later (#1046)

Since version 5.0.2, NuGet has used the PATH environment variable
to find MSBuild.exe before looking in other file paths.
See NuGet change
21f2b07f2c
(https://github.com/NuGet/NuGet.Client/pull/2687 ).

Unfortunately, in PR
https://github.com/microsoft/terminal/pull/606 ,
`tools\razzle.cmd` was changed to add the MSBuild.exe folder path
in _quotes_ to the PATH environment variable.
Windows itself is fine with this (you can type `msbuild` and
MSBuild runs), but some tools are not, including NuGet itself,
so you would get errors like this:

```
D:\GitHub\metathinker\console> where nuget
C:\ProgramData\chocolatey\bin\nuget.exe
D:\GitHub\metathinker\console\dep\nuget\nuget.exe

D:\GitHub\metathinker\console> nuget restore OpenConsole.sln
Illegal characters in path.
```

`razzle.cmd` runs NuGet itself, but does so before adding
the MSBuild folder to the PATH, so it was not affected by this
problem.

This change fixes the issue by dequotifying the PATH,
so that if you already had a newer version of NuGet on your PATH
before running `tools\razzle.cmd`, that version will continue
to work should you need to run `nuget restore` again
(such as after a `git clean -dx`).
This commit is contained in:
Michael Ratanapintha 2019-05-29 10:02:48 -07:00 committed by Dustin L. Howett (MSFT)
parent 8baba4b46c
commit 2f88c46350

View File

@ -53,7 +53,7 @@ if not defined MSBUILD (
goto :EXIT
)
set PATH=%PATH%"%MSBUILD%\..";
set PATH=%PATH%%MSBUILD%\..;
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
set ARCH=x64