aboutsummaryrefslogtreecommitdiff
path: root/scripts/findVisualStudioInstallationInstances.ps1
diff options
context:
space:
mode:
authorflysha <flysha@live.com>2017-01-25 10:01:57 +0800
committerflysha <flysha@live.com>2017-01-25 10:01:57 +0800
commit033c7d0af6a5f5129e73ebb63b1abea0db128da6 (patch)
treef0998507be51a02b1b9fa1e4e3836b95fe826ab8 /scripts/findVisualStudioInstallationInstances.ps1
parentce9741f71b079dad944e177daf984160bb9ce1bb (diff)
parenta4bcf67010a438a554696988e17f1066be629dba (diff)
downloadvcpkg-033c7d0af6a5f5129e73ebb63b1abea0db128da6.tar.gz
vcpkg-033c7d0af6a5f5129e73ebb63b1abea0db128da6.zip
Merge remote-tracking branch 'refs/remotes/origin/master'
Diffstat (limited to 'scripts/findVisualStudioInstallationInstances.ps1')
-rw-r--r--scripts/findVisualStudioInstallationInstances.ps140
1 files changed, 40 insertions, 0 deletions
diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1
new file mode 100644
index 000000000..d5faa57d3
--- /dev/null
+++ b/scripts/findVisualStudioInstallationInstances.ps1
@@ -0,0 +1,40 @@
+[CmdletBinding()]
+param(
+
+)
+
+Import-Module BitsTransfer
+
+$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition
+$vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root
+
+$downloadsDir = "$vcpkgRootDir\downloads"
+
+$nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget"
+$nugetPackageDir = "$downloadsDir\nuget-packages"
+
+$SetupAPIVersion = "1.3.269-rc"
+$url = "https://api.nuget.org/packages/microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg"
+$downloadName = "microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg"
+$downloadPath = "$downloadsDir\$downloadName"
+
+if (!(Test-Path $downloadPath))
+{
+ Start-BitsTransfer -Source $url -Destination $downloadPath #-ErrorAction SilentlyContinue
+}
+
+$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1
+
+$SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe"
+
+if (!(Test-Path $SetupConsoleExe))
+{
+ throw $nugetOutput
+}
+
+$consoleOutput = & $SetupConsoleExe 2>&1
+
+$key = "InstallationPath = "
+$paths = $consoleOutput | Select-String -SimpleMatch $key
+$paths = $paths -replace $key, ""
+return $paths \ No newline at end of file