diff options
| author | TitanSnow <[email protected]> | 2017-04-21 13:25:30 +0800 |
|---|---|---|
| committer | TitanSnow <[email protected]> | 2017-04-21 13:42:24 +0800 |
| commit | 84bbb39981a99fafbb758f82c8e74667502b041d (patch) | |
| tree | 3f14823905d5925a45a1ea22aac7035a835840e9 /scripts | |
| parent | 72752f32575dc454461fabadc9a4c5d7bc82525a (diff) | |
use tmppath to store download file
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/get.ps1 | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/get.ps1 b/scripts/get.ps1 index 734c61bc5..36fb966af 100644 --- a/scripts/get.ps1 +++ b/scripts/get.ps1 @@ -2,10 +2,11 @@ # usage: (in powershell) # Invoke-Expression (Invoke-Webrequest <my location> -UseBasicParsing).Content +$outfile=($env:TEMP,$env:TMP,'.' -ne $null)[0]+"\$pid-xmake-installer.exe" $ver='v2.1.3' -Invoke-Webrequest "https://github.com/tboox/xmake/releases/download/$ver/xmake-$ver.exe" -OutFile "$pid-xmake-installer.exe" -ErrorAction Stop -Start-Process -FilePath "$pid-xmake-installer.exe" -ArgumentList '/S /D=C:\xmake' -Wait -ErrorAction Stop -Remove-Item "$pid-xmake-installer.exe" +Invoke-Webrequest "https://github.com/tboox/xmake/releases/download/$ver/xmake-$ver.exe" -OutFile "$outfile" -ErrorAction Stop +Start-Process -FilePath "$outfile" -ArgumentList '/S /D=C:\xmake' -Wait -ErrorAction Stop +Remove-Item "$outfile" $env:Path+=";C:\xmake" [Environment]::SetEnvironmentVariable("Path",[Environment]::GetEnvironmentVariable("Path",[System.EnvironmentVariableTarget]::User)+";C:\xmake",[System.EnvironmentVariableTarget]::User) xmake --version |
