Merge pull request #3 from actions/master

update master
This commit is contained in:
Dibir Magomedsaygitov
2020-05-11 13:49:25 +03:00
committed by GitHub
35 changed files with 464 additions and 539 deletions

View File

@@ -40,7 +40,7 @@ apt-fast install -y --no-install-recommends \
zip \
zstd
# Electron / VSCode / GitHub Desktop prereqs
# Electron / VSCode / GitHub Desktop / kubectl prereqs
apt-fast install -y --no-install-recommends \
libxkbfile-dev \
pkg-config \
@@ -57,7 +57,8 @@ apt-fast install -y --no-install-recommends \
rpm \
xz-utils \
xorriso \
zsync
zsync \
gnupg2
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
@@ -99,3 +100,4 @@ DocumentInstalledItemIndent "upx"
DocumentInstalledItemIndent "wget"
DocumentInstalledItemIndent "zip"
DocumentInstalledItemIndent "zstd"
DocumentInstalledItemIndent "gnupg2"

View File

@@ -1,40 +0,0 @@
#!/bin/bash
################################################################################
## File: kubernetes-tools.sh
## Desc: Installs kubectl, helm
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
## Install kubectl
apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
touch /etc/apt/sources.list.d/kubernetes.list
echo "deb http://apt.kubernetes.io/ kubernetes-$(lsb_release -cs) main" | tee -a /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install -y kubectl
# Install Helm
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v kubectl; then
echo "kubectl was not installed"
exit 1
fi
if ! command -v helm; then
echo "helm was not installed"
exit 1
fi
echo "Initializing helm"
helm init --client-only
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "kubectl ($(kubectl version --short |& head -n 1))"
DocumentInstalledItem "helm ($(helm version --short |& head -n 1))"

View File

@@ -130,6 +130,9 @@ apt-get install -y --no-install-recommends curl
echo "Install parallel"
apt-get install -y --no-install-recommends parallel
echo "Install gnupg2"
apt-get install -y --no-install-recommends gnupg2
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in curl file ftp jq netcat ssh parallel rsync shellcheck sudo telnet time unzip wget zip; do
@@ -168,3 +171,4 @@ DocumentInstalledItemIndent "upx"
DocumentInstalledItemIndent "wget"
DocumentInstalledItemIndent "zip"
DocumentInstalledItemIndent "zstd"
DocumentInstalledItemIndent "gnupg2"

View File

@@ -52,4 +52,5 @@ foreach ($tool in $tools) {
}
}
chown -R "$($env:SUDO_USER):$($env:SUDO_USER)" /opt/hostedtoolcache/Python
chown -R "$($env:SUDO_USER):$($env:SUDO_USER)" /opt/hostedtoolcache/Python
chown -R "$($env:SUDO_USER):$($env:SUDO_USER)" /opt/hostedtoolcache/node

View File

@@ -26,7 +26,10 @@ function Run-ExecutableTests {
$ErrorActionPreference = "Stop"
# Define executables for cached tools
$toolsExecutables = @{ Python = @("python", "bin/pip") }
$toolsExecutables = @{
Python = @("python", "bin/pip");
node = @("bin/node", "bin/npm")
}
# Get toolset content
$toolsetJson = Get-Content -Path "$env:INSTALLER_SCRIPT_FOLDER/toolset.json" -Raw

View File

@@ -16,4 +16,10 @@ Dpkg::Options {
"--force-confdef";
"--force-confold";
}
EOF
EOF
# hide information about packages that are no longer required
cat <<EOF >> /etc/apt/apt.conf.d/10apt-autoremove
APT::Get::AutomaticRemove "0";
APT::Get::HideAutoRemove "1";
EOF

View File

@@ -9,12 +9,11 @@ source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
## Install kubectl
apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
touch /etc/apt/sources.list.d/kubernetes.list
# Based on https://kubernetes.io/docs/tasks/tools/install-kubectl/, package is still called xenial
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list
# Based on https://kubernetes.io/docs/tasks/tools/install-kubectl/, package is xenial for both OS versions.
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install -y kubectl
@@ -33,10 +32,7 @@ if ! command -v helm; then
exit 1
fi
echo "Initializing helm"
helm init --client-only
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "kubectl ($(kubectl version --short |& head -n 1))"
DocumentInstalledItem "kubectl ($(kubectl version --client --short |& head -n 1))"
DocumentInstalledItem "helm ($(helm version --short |& head -n 1))"

View File

@@ -13,6 +13,18 @@
"3.7.*",
"3.8.*"
]
},
{
"name": "node",
"url" : "https://raw.githubusercontent.com/actions/node-versions/master/versions-manifest.json",
"platform" : "linux",
"arch": "x64",
"versions": [
"8.*",
"10.*",
"12.*",
"14.*"
]
}
]
}

View File

@@ -13,6 +13,18 @@
"3.7.*",
"3.8.*"
]
},
{
"name": "node",
"url" : "https://raw.githubusercontent.com/actions/node-versions/master/versions-manifest.json",
"platform" : "linux",
"arch": "x64",
"versions": [
"8.*",
"10.*",
"12.*",
"14.*"
]
}
]
}

View File

@@ -204,7 +204,7 @@
"{{template_dir}}/scripts/installers/image-magick.sh",
"{{template_dir}}/scripts/installers/java-tools.sh",
"{{template_dir}}/scripts/installers/kind.sh",
"{{template_dir}}/scripts/installers/1604/kubernetes-tools.sh",
"{{template_dir}}/scripts/installers/kubernetes-tools.sh",
"{{template_dir}}/scripts/installers/leiningen.sh",
"{{template_dir}}/scripts/installers/1604/mercurial.sh",
"{{template_dir}}/scripts/installers/miniconda.sh",
@@ -324,12 +324,6 @@
],
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"scripts":[
"{{template_dir}}/scripts/installers/validate-disk-space.sh"
]
},
{
"type": "file",
"source": "{{user `metadata_file`}}",
@@ -345,6 +339,12 @@
],
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"scripts":[
"{{template_dir}}/scripts/installers/validate-disk-space.sh"
]
},
{
"type": "file",
"source": "{{template_dir}}/config/ubuntu1604.conf",

View File

@@ -207,7 +207,7 @@
"{{template_dir}}/scripts/installers/image-magick.sh",
"{{template_dir}}/scripts/installers/java-tools.sh",
"{{template_dir}}/scripts/installers/kind.sh",
"{{template_dir}}/scripts/installers/1804/kubernetes-tools.sh",
"{{template_dir}}/scripts/installers/kubernetes-tools.sh",
"{{template_dir}}/scripts/installers/leiningen.sh",
"{{template_dir}}/scripts/installers/1804/mercurial.sh",
"{{template_dir}}/scripts/installers/miniconda.sh",
@@ -328,12 +328,6 @@
],
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"scripts":[
"{{template_dir}}/scripts/installers/validate-disk-space.sh"
]
},
{
"type": "file",
"source": "{{user `metadata_file`}}",
@@ -349,6 +343,12 @@
],
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"scripts":[
"{{template_dir}}/scripts/installers/validate-disk-space.sh"
]
},
{
"type": "file",
"source": "{{template_dir}}/config/ubuntu1804.conf",

View File

@@ -2,7 +2,7 @@
- System Version: macOS 10.15.4 (19E287)
- Kernel Version: Darwin 19.4.0
- System Integrity Protection: Enabled
- Image Version: 20200425.1
- Image Version: 20200430.1
# Installed Software
## Language and Runtime
@@ -18,9 +18,9 @@
- gcc-9 (Homebrew GCC 9.3.0_1) 9.3.0
- GNU Fortran (Homebrew GCC 8.4.0_1) 8.4.0
- GNU Fortran (Homebrew GCC 9.3.0_1) 9.3.0
- Node.js v12.16.2
- Node.js v12.16.3
- NVM 0.33.11
- NVM - Cached node versions: v6.17.1 v8.17.0 v10.20.1 v12.16.2 v13.13.0
- NVM - Cached node versions: v6.17.1 v8.17.0 v10.20.1 v12.16.3 v13.14.0
- PowerShell 7.0.0
- Python 2.7.17
- Python 3.7.7
@@ -36,7 +36,7 @@
- Bundler version 2.1.4
- Carthage 0.34.0
- CocoaPods 1.9.1
- Homebrew 2.2.13
- Homebrew 2.2.14
- NPM 6.14.4
- Yarn 1.22.4
- NuGet 5.5.0.6382
@@ -50,7 +50,7 @@
- Gradle 6.3
## Utilities
- Curl 7.69.1
- Curl 7.70.0
- Git: 2.26.2
- Git LFS: 2.10.0
- Hub CLI: 2.14.2
@@ -74,20 +74,20 @@
## Tools
- Fastlane 2.146.1
- Cmake 3.17.1
- Cmake 3.17.2
- App Center CLI 2.5.0
- Azure CLI 2.4.0
- AWS CLI 2.0.9
- AWS SAM CLI 0.47.0
- Azure CLI 2.5.1
- AWS CLI 2.0.10
- AWS SAM CLI 0.48.0
- Aliyun CLI 3.0.39
## Browsers
- Safari 13.1 (15609.1.20.111.8)
- SafariDriver 13.1 (15609.1.20.111.8)
- Google Chrome 81.0.4044.122
- Google Chrome 81.0.4044.129
- ChromeDriver 81.0.4044.69
- Microsoft Edge 81.0.416.64
- MSEdgeDriver 81.0.416.64
- Microsoft Edge 81.0.416.68
- MSEdgeDriver 81.0.416.68
- Mozilla Firefox 75.0
- geckodriver 0.26.0
@@ -99,10 +99,10 @@
- 2.7.1
### Python
- 2.7.17
- 2.7.18
- 3.5.9
- 3.6.10
- 3.7.6
- 3.7.7
- 3.8.2
### PyPy
@@ -145,17 +145,18 @@
- NUnit 3.6.1
## Xcode
| Version | Build | Path |
| ---------------- | ------- | ------------------------------ |
| 11.4.1 (default) | 11E503a | /Applications/Xcode_11.4.1.app |
| 11.4 | 11E146 | /Applications/Xcode_11.4.app |
| 11.3.1 | 11C505 | /Applications/Xcode_11.3.1.app |
| 11.3 | 11C29 | /Applications/Xcode_11.3.app |
| 11.2.1 | 11B500 | /Applications/Xcode_11.2.1.app |
| 11.2 | 11B52 | /Applications/Xcode_11.2.app |
| 11.1 | 11A1027 | /Applications/Xcode_11.1.app |
| 11.0 | 11A420a | /Applications/Xcode_11.app |
| 10.3 | 10G8 | /Applications/Xcode_10.3.app |
| Version | Build | Path |
| ---------------- | ------- | --------------------------------- |
| 11.5 (beta) | 11N605c | /Applications/Xcode_11.5_beta.app |
| 11.4.1 (default) | 11E503a | /Applications/Xcode_11.4.1.app |
| 11.4 | 11E146 | /Applications/Xcode_11.4.app |
| 11.3.1 | 11C505 | /Applications/Xcode_11.3.1.app |
| 11.3 | 11C29 | /Applications/Xcode_11.3.app |
| 11.2.1 | 11B500 | /Applications/Xcode_11.2.1.app |
| 11.2 | 11B52 | /Applications/Xcode_11.2.app |
| 11.1 | 11A1027 | /Applications/Xcode_11.1.app |
| 11.0 | 11A420a | /Applications/Xcode_11.app |
| 10.3 | 10G8 | /Applications/Xcode_10.3.app |
### Xcode Support Tools
- Nomad CLI 3.1.2
@@ -165,37 +166,39 @@
- xcversion 2.6.4
### Installed SDKs
| SDK | SDK Name | Xcode Version |
| ----------------------- | -------------------- | ---------------------------------------------------- |
| macOS 10.14 | macosx10.14 | 10.3 |
| macOS 10.15 | macosx10.15 | 11.0, 11.1, 11.2, 11.2.1, 11.3, 11.3.1, 11.4, 11.4.1 |
| iOS 12.4 | iphoneos12.4 | 10.3 |
| iOS 13.0 | iphoneos13.0 | 11.0 |
| iOS 13.1 | iphoneos13.1 | 11.1 |
| iOS 13.2 | iphoneos13.2 | 11.2, 11.2.1, 11.3, 11.3.1 |
| iOS 13.4 | iphoneos13.4 | 11.4, 11.4.1 |
| Simulator - iOS 12.4 | iphonesimulator12.4 | 10.3 |
| Simulator - iOS 13.0 | iphonesimulator13.0 | 11.0 |
| Simulator - iOS 13.1 | iphonesimulator13.1 | 11.1 |
| Simulator - iOS 13.2 | iphonesimulator13.2 | 11.2, 11.2.1, 11.3, 11.3.1 |
| Simulator - iOS 13.4 | iphonesimulator13.4 | 11.4, 11.4.1 |
| tvOS 12.4 | appletvos12.4 | 10.3 |
| tvOS 13.0 | appletvos13.0 | 11.0, 11.1 |
| tvOS 13.2 | appletvos13.2 | 11.2, 11.2.1, 11.3, 11.3.1 |
| tvOS 13.4 | appletvos13.4 | 11.4, 11.4.1 |
| Simulator - tvOS 12.4 | appletvsimulator12.4 | 10.3 |
| Simulator - tvOS 13.0 | appletvsimulator13.0 | 11.0, 11.1 |
| Simulator - tvOS 13.2 | appletvsimulator13.2 | 11.2, 11.2.1, 11.3, 11.3.1 |
| Simulator - tvOS 13.4 | appletvsimulator13.4 | 11.4, 11.4.1 |
| watchOS 5.3 | watchos5.3 | 10.3 |
| watchOS 6.0 | watchos6.0 | 11.0, 11.1 |
| watchOS 6.1 | watchos6.1 | 11.2, 11.2.1, 11.3, 11.3.1 |
| watchOS 6.2 | watchos6.2 | 11.4, 11.4.1 |
| Simulator - watchOS 5.3 | watchsimulator5.3 | 10.3 |
| Simulator - watchOS 6.0 | watchsimulator6.0 | 11.0, 11.1 |
| Simulator - watchOS 6.1 | watchsimulator6.1 | 11.2, 11.2.1, 11.3, 11.3.1 |
| Simulator - watchOS 6.2 | watchsimulator6.2 | 11.4, 11.4.1 |
| DriverKit 19.0 | driverkit.macosx19.0 | 11.0, 11.1, 11.2, 11.2.1, 11.3, 11.3.1, 11.4, 11.4.1 |
| SDK | SDK Name | Xcode Version |
| ----------------------- | -------------------- | ---------------------------------------------------------- |
| macOS 10.14 | macosx10.14 | 10.3 |
| macOS 10.15 | macosx10.15 | 11.0, 11.1, 11.2, 11.2.1, 11.3, 11.3.1, 11.4, 11.4.1, 11.5 |
| iOS 12.4 | iphoneos12.4 | 10.3 |
| iOS 13.0 | iphoneos13.0 | 11.0 |
| iOS 13.1 | iphoneos13.1 | 11.1 |
| iOS 13.2 | iphoneos13.2 | 11.2, 11.2.1, 11.3, 11.3.1 |
| iOS 13.4 | iphoneos13.4 | 11.4, 11.4.1 |
| iOS 13.5 | iphoneos13.5 | 11.5 |
| Simulator - iOS 12.4 | iphonesimulator12.4 | 10.3 |
| Simulator - iOS 13.0 | iphonesimulator13.0 | 11.0 |
| Simulator - iOS 13.1 | iphonesimulator13.1 | 11.1 |
| Simulator - iOS 13.2 | iphonesimulator13.2 | 11.2, 11.2.1, 11.3, 11.3.1 |
| Simulator - iOS 13.4 | iphonesimulator13.4 | 11.4, 11.4.1 |
| Simulator - iOS 13.5 | iphonesimulator13.5 | 11.5 |
| tvOS 12.4 | appletvos12.4 | 10.3 |
| tvOS 13.0 | appletvos13.0 | 11.0, 11.1 |
| tvOS 13.2 | appletvos13.2 | 11.2, 11.2.1, 11.3, 11.3.1 |
| tvOS 13.4 | appletvos13.4 | 11.4, 11.4.1, 11.5 |
| Simulator - tvOS 12.4 | appletvsimulator12.4 | 10.3 |
| Simulator - tvOS 13.0 | appletvsimulator13.0 | 11.0, 11.1 |
| Simulator - tvOS 13.2 | appletvsimulator13.2 | 11.2, 11.2.1, 11.3, 11.3.1 |
| Simulator - tvOS 13.4 | appletvsimulator13.4 | 11.4, 11.4.1, 11.5 |
| watchOS 5.3 | watchos5.3 | 10.3 |
| watchOS 6.0 | watchos6.0 | 11.0, 11.1 |
| watchOS 6.1 | watchos6.1 | 11.2, 11.2.1, 11.3, 11.3.1 |
| watchOS 6.2 | watchos6.2 | 11.4, 11.4.1, 11.5 |
| Simulator - watchOS 5.3 | watchsimulator5.3 | 10.3 |
| Simulator - watchOS 6.0 | watchsimulator6.0 | 11.0, 11.1 |
| Simulator - watchOS 6.1 | watchsimulator6.1 | 11.2, 11.2.1, 11.3, 11.3.1 |
| Simulator - watchOS 6.2 | watchsimulator6.2 | 11.4, 11.4.1, 11.5 |
| DriverKit 19.0 | driverkit.macosx19.0 | 11.0, 11.1, 11.2, 11.2.1, 11.3, 11.3.1, 11.4, 11.4.1, 11.5 |
### Installed Simulators
| OS | Xcode Version | Simulators |
@@ -205,16 +208,17 @@
| iOS 13.1 | 11.1 | iPhone 8<br>iPhone 8 Plus<br>iPhone 11<br>iPhone 11 Pro<br>iPhone 11 Pro Max<br>iPad Pro (9.7-inch)<br>iPad Pro (11-inch)<br>iPad Pro (12.9-inch) (3rd generation)<br>iPad Air (3rd generation) |
| iOS 13.2 | 11.2<br>11.2.1 | iPhone 8<br>iPhone 8 Plus<br>iPhone 11<br>iPhone 11 Pro<br>iPhone 11 Pro Max<br>iPad Pro (9.7-inch)<br>iPad Pro (11-inch)<br>iPad Pro (12.9-inch) (3rd generation)<br>iPad Air (3rd generation) |
| iOS 13.3 | 11.3<br>11.3.1 | iPhone 8<br>iPhone 8 Plus<br>iPhone 11<br>iPhone 11 Pro<br>iPhone 11 Pro Max<br>iPad Pro (9.7-inch)<br>iPad Pro (11-inch)<br>iPad Pro (12.9-inch) (3rd generation)<br>iPad Air (3rd generation) |
| iOS 13.4 | 11.4<br>11.4.1 | iPhone 8<br>iPhone 8 Plus<br>iPhone 11<br>iPhone 11 Pro<br>iPhone 11 Pro Max<br>iPad Pro (9.7-inch)<br>iPad (7th generation)<br>iPad Pro (11-inch) (2nd generation)<br>iPad Pro (12.9-inch) (4th generation)<br>iPad Air (3rd generation)<br>iPhone SE (2nd generation) |
| iOS 13.4 | 11.4<br>11.4.1 | iPhone 8<br>iPhone 8 Plus<br>iPhone 11<br>iPhone 11 Pro<br>iPhone 11 Pro Max<br>iPhone SE (2nd generation)<br>iPad Pro (9.7-inch)<br>iPad (7th generation)<br>iPad Pro (11-inch) (2nd generation)<br>iPad Pro (12.9-inch) (4th generation)<br>iPad Air (3rd generation) |
| iOS 13.5 | 11.5 | iPhone 8<br>iPhone 8 Plus<br>iPhone 11<br>iPhone 11 Pro<br>iPhone 11 Pro Max<br>iPhone SE (2nd generation)<br>iPad Pro (9.7-inch)<br>iPad (7th generation)<br>iPad Pro (11-inch) (2nd generation)<br>iPad Pro (12.9-inch) (4th generation)<br>iPad Air (3rd generation) |
| tvOS 12.4 | 10.3 | Apple TV<br>Apple TV 4K<br>Apple TV 4K (at 1080p) |
| tvOS 13.0 | 11.0<br>11.1 | Apple TV<br>Apple TV 4K<br>Apple TV 4K (at 1080p) |
| tvOS 13.2 | 11.2<br>11.2.1 | Apple TV<br>Apple TV 4K<br>Apple TV 4K (at 1080p) |
| tvOS 13.3 | 11.3<br>11.3.1 | Apple TV<br>Apple TV 4K<br>Apple TV 4K (at 1080p) |
| tvOS 13.4 | 11.4<br>11.4.1 | Apple TV<br>Apple TV 4K<br>Apple TV 4K (at 1080p) |
| tvOS 13.4 | 11.4<br>11.4.1<br>11.5 | Apple TV<br>Apple TV 4K<br>Apple TV 4K (at 1080p) |
| watchOS 5.3 | 10.3 | Apple Watch Series 2 - 38mm<br>Apple Watch Series 2 - 42mm<br>Apple Watch Series 3 - 38mm<br>Apple Watch Series 3 - 42mm<br>Apple Watch Series 4 - 40mm<br>Apple Watch Series 4 - 44mm |
| watchOS 6.0 | 11.0<br>11.1 | Apple Watch Series 4 - 40mm<br>Apple Watch Series 4 - 44mm<br>Apple Watch Series 5 - 40mm<br>Apple Watch Series 5 - 44mm |
| watchOS 6.1 | 11.2<br>11.2.1<br>11.3<br>11.3.1 | Apple Watch Series 4 - 40mm<br>Apple Watch Series 4 - 44mm<br>Apple Watch Series 5 - 40mm<br>Apple Watch Series 5 - 44mm |
| watchOS 6.2 | 11.4<br>11.4.1 | Apple Watch Series 4 - 40mm<br>Apple Watch Series 4 - 44mm<br>Apple Watch Series 5 - 40mm<br>Apple Watch Series 5 - 44mm |
| watchOS 6.2 | 11.4<br>11.4.1<br>11.5 | Apple Watch Series 4 - 40mm<br>Apple Watch Series 4 - 44mm<br>Apple Watch Series 5 - 40mm<br>Apple Watch Series 5 - 44mm |
## Android
### Android SDK Tools

View File

@@ -944,6 +944,12 @@
"{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1"
]
},
{
"type": "powershell",
"inline": [

View File

@@ -947,6 +947,12 @@
"{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1"
]
},
{
"type": "powershell",
"inline": [

View File

@@ -14,6 +14,7 @@ Export-ModuleMember -Function @(
'Get-SystemVariable'
'Set-SystemVariable'
'Install-Binary'
'Install-VisualStudio'
'Get-ToolcachePackages'
'Get-ToolsetContent'
'Get-ToolsByName'

View File

@@ -20,7 +20,8 @@ function Install-Binary
Install-Binary -Url "https://go.microsoft.com/fwlink/p/?linkid=2083338" -Name "winsdksetup.exe" -ArgumentList ("/features", "+", "/quiet")
#>
Param (
Param
(
[Parameter(Mandatory)]
[String] $Url,
[Parameter(Mandatory)]
@@ -62,6 +63,68 @@ function Install-Binary
}
}
Function Install-VisualStudio
{
<#
.SYNOPSIS
A helper function to install Visual Studio.
.DESCRIPTION
Prepare system environment, and install Visual Studio bootstrapper with selected workloads.
.PARAMETER BootstrapperUrl
The URL from which the bootstrapper will be downloaded. Required parameter.
.PARAMETER WorkLoads
The string that contain workloads that will be passed to the installer.
#>
Param
(
[Parameter(Mandatory)]
[String] $BootstrapperUrl,
[String] $WorkLoads
)
Write-Host "Downloading Bootstrapper ..."
$BootstrapperName = [IO.Path]::GetFileName($BootstrapperUrl)
$bootstrapperFilePath = Start-DownloadWithRetry -Url $BootstrapperUrl -Name $BootstrapperName
try
{
Write-Host "Enable short name support on Windows needed for Xamarin Android AOT, defaults appear to have been changed in Azure VMs"
$shortNameEnableProcess = Start-Process -FilePath fsutil.exe -ArgumentList ('8dot3name', 'set', '0') -Wait -PassThru
$shortNameEnableExitCode = $shortNameEnableProcess.ExitCode
if ($shortNameEnableExitCode -ne 0)
{
Write-Host "Enabling short name support on Windows failed. This needs to be enabled prior to VS 2017 install for Xamarin Andriod AOT to work."
exit $shortNameEnableExitCode
}
Write-Host "Starting Install ..."
$bootstrapperArgumentList = ('/c', $bootstrapperFilePath, $WorkLoads, '--quiet', '--norestart', '--wait', '--nocache' )
$process = Start-Process -FilePath cmd.exe -ArgumentList $bootstrapperArgumentList -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host "Installation successful"
return $exitCode
}
else
{
Write-Host "Non zero exit code returned by the installation process : $exitCode"
exit $exitCode
}
}
catch
{
Write-Host "Failed to install Visual Studio; $($_.Exception.Message)"
exit -1
}
}
function Stop-SvcWithErrHandling
{
<#
@@ -74,7 +137,8 @@ function Stop-SvcWithErrHandling
.PARAMETER StopOnError
Switch for stopping the script and exit from PowerShell if one service is absent
#>
param (
param
(
[Parameter(Mandatory, ValueFromPipeLine = $true)]
[string] $ServiceName,
[switch] $StopOnError
@@ -123,7 +187,8 @@ function Set-SvcWithErrHandling
Hashtable for service arguments
#>
param (
param
(
[Parameter(Mandatory, ValueFromPipeLine = $true)]
[string] $ServiceName,
[Parameter(Mandatory)]
@@ -152,7 +217,8 @@ function Set-SvcWithErrHandling
function Start-DownloadWithRetry
{
param (
param
(
[Parameter(Mandatory)]
[string] $Url,
[Parameter(Mandatory)]
@@ -253,7 +319,8 @@ function Install-VsixExtension
function Get-VSExtensionVersion
{
param (
Param
(
[Parameter(Mandatory=$true)]
[string] $packageName
)
@@ -289,7 +356,8 @@ function Get-ToolsetContent {
}
function Get-ToolsByName {
param (
Param
(
[Parameter(Mandatory = $True)]
[string]$SoftwareName
)

View File

@@ -0,0 +1,16 @@
Write-Host "Disable Just-In-Time Debugger"
# Turn off Application Error Debugger
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug" -Name Debugger -Value "-" -Type String -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug" -Name Debugger -Value "-" -Type String -Force
# Turn off the Debug dialog
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework" -Name DbgManagedDebugger -Value "-" -Type String -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework" -Name DbgManagedDebugger -Value "-" -Type String -Force
# Disable the WER UI
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name DontShowUI -Value 1 -Type DWORD -Force
# Send all reports to the user's queue
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name ForceQueue -Value 1 -Type DWORD -Force
# Default consent choice 1 - Always ask (default)
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\Consent" -Name DefaultConsent -Value 1 -Type DWORD -Force

View File

@@ -3,23 +3,25 @@
## Desc: Install Google Chrome
################################################################################
Import-Module -Name ImageHelpers -Force;
Import-Module -Name ImageHelpers -Force
$ChromeInstallerFile = "chrome_installer.exe";
$ChromeInstallerUrl = "https://dl.google.com/chrome/install/375.126/${ChromeInstallerFile}";
# Download and install latest Chrome browser
$ChromeInstallerFile = "chrome_installer.exe"
$ChromeInstallerUrl = "https://dl.google.com/chrome/install/375.126/${ChromeInstallerFile}"
Install-Binary -Url $ChromeInstallerUrl -Name $ChromeInstallerFile -ArgumentList ("/silent", "/install")
Write-Host "Adding the firewall rule for Google update blocking";
New-NetFirewallRule -DisplayName "BlockGoogleUpdate" -Direction Outbound -Action Block -Program "C:\Program Files (x86)\Google\Update\GoogleUpdate.exe";
# Prepare firewall rules
Write-Host "Adding the firewall rule for Google update blocking..."
New-NetFirewallRule -DisplayName "BlockGoogleUpdate" -Direction Outbound -Action Block -Program "C:\Program Files (x86)\Google\Update\GoogleUpdate.exe"
$GoogleSvcs = ('gupdate','gupdatem');
$GoogleSvcs | Stop-SvcWithErrHandling -StopOnError;
$GoogleSvcs | Set-SvcWithErrHandling -Arguments @{StartupType = "Disabled"};
$GoogleSvcs = ('gupdate','gupdatem')
$GoogleSvcs | Stop-SvcWithErrHandling -StopOnError
$GoogleSvcs | Set-SvcWithErrHandling -Arguments @{StartupType = "Disabled"}
$regGoogleUpdatePath = "HKLM:\SOFTWARE\Policies\Google\Update";
$regGoogleUpdateChrome = "HKLM:\SOFTWARE\Policies\Google\Chrome";
$regGoogleUpdatePath = "HKLM:\SOFTWARE\Policies\Google\Update"
$regGoogleUpdateChrome = "HKLM:\SOFTWARE\Policies\Google\Chrome"
($regGoogleUpdatePath, $regGoogleUpdateChrome) | ForEach-Object {
New-Item -Path $_ -Force;
New-Item -Path $_ -Force
}
$regGoogleParameters = @(
@@ -31,52 +33,45 @@ $regGoogleParameters = @(
)
$regGoogleParameters | ForEach-Object {
$Arguments = $_;
if (-not ($Arguments.Path)) {
$Arguments.Add("Path", $regGoogleUpdatePath);
$Arguments = $_
if (-not ($Arguments.Path))
{
$Arguments.Add("Path", $regGoogleUpdatePath)
}
$Arguments.Add("Force", $true);
New-ItemProperty @Arguments;
$Arguments.Add("Force", $true)
New-ItemProperty @Arguments
}
# Reinstall Chrome Web Driver
Write-Host "Install Chrome WebDriver"
$DestinationPath = "$($env:SystemDrive)\";
$ChromeDriverPath = "${DestinationPath}SeleniumWebDrivers\ChromeDriver";
if (-not (Test-Path -Path $ChromeDriverPath)) {
New-Item -Path $ChromeDriverPath -ItemType "directory"
# Install Chrome WebDriver
Write-Host "Install Chrome WebDriver..."
$ChromeDriverPath = "$($env:SystemDrive)\SeleniumWebDrivers\ChromeDriver"
if (-not (Test-Path -Path $ChromeDriverPath))
{
New-Item -Path $ChromeDriverPath -ItemType Directory -Force
}
Write-Host "Get the Chrome WebDriver version..."
$RegistryPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"
$ChromePath = (Get-ItemProperty "$RegistryPath\chrome.exe").'(default)';
[version]$ChromeVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($ChromePath).ProductVersion;
Write-Host "Chrome version: [$ChromeVersion]";
$ChromePath = (Get-ItemProperty "$RegistryPath\chrome.exe").'(default)'
[version]$ChromeVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($ChromePath).ProductVersion
$ChromeDriverVersionUrl = "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$($ChromeVersion.Major).$($ChromeVersion.Minor).$($ChromeVersion.Build)"
$ChromeDriverVersionUri = "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$($ChromeVersion.Major).$($ChromeVersion.Minor).$($ChromeVersion.Build)";
Write-Host "Chrome driver version Uri [$ChromeDriverVersionUri]";
Write-Host "Getting the Chrome driver version...";
$ChromeDriverVersion = Invoke-WebRequest -Uri $ChromeDriverVersionUri;
Write-Host "Current Chrome driver version: [$ChromeDriverVersion]";
$ChromeDriverVersionFile = Start-DownloadWithRetry -Url $ChromeDriverVersionUrl -Name "versioninfo.txt" -DownloadPath $ChromeDriverPath
$ChromeDriverZipDownloadUri = "https://chromedriver.storage.googleapis.com/$($ChromeDriverVersion.ToString())/chromedriver_win32.zip";
Write-Host "Chrome driver zip file download Uri: [$ChromeDriverZipDownloadUri]";
Write-Host "Download Chrome WebDriver..."
$ChromeDriverVersion = Get-Content -Path $ChromeDriverVersionFile
$ChromeDriverArchName = "chromedriver_win32.zip"
$ChromeDriverZipDownloadUrl = "https://chromedriver.storage.googleapis.com/${ChromeDriverVersion}/${ChromeDriverArchName}"
$DestFile= "$ChromeDriverPath\chromedriver_win32.zip";
$ChromeDriverVersion.Content | Out-File -FilePath "$ChromeDriverPath\versioninfo.txt" -Force;
$ChromeDriverArchPath = Start-DownloadWithRetry -Url $ChromeDriverZipDownloadUrl -Name $ChromeDriverArchName
Write-Host "Chrome driver download....";
Invoke-WebRequest -Uri $ChromeDriverZipDownloadUri -OutFile $DestFile;
Write-Host "Expand Chrome WebDriver archive..."
Expand-Archive -Path $ChromeDriverArchPath -DestinationPath $ChromeDriverPath -Force
Write-Host "Chrome driver install....";
Expand-Archive -Path "$ChromeDriverPath\chromedriver_win32.zip" -DestinationPath $ChromeDriverPath -Force;
Remove-Item -Path "$ChromeDriverPath\chromedriver_win32.zip" -Force;
Write-Host "Setting the environment variables..."
setx ChromeWebDriver "$ChromeDriverPath" /M
Write-Host "Setting the environment variables"
setx ChromeWebDriver "$ChromeDriverPath" /M;
$regEnvKey = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\';
$PathValue = Get-ItemPropertyValue -Path $regEnvKey -Name 'Path';
$PathValue += ";$ChromeDriverPath\";
Set-ItemProperty -Path $regEnvKey -Name 'Path' -Value $PathValue;
$regEnvKey = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\'
$PathValue = Get-ItemPropertyValue -Path $regEnvKey -Name 'Path'
$PathValue += ";$ChromeDriverPath\"
Set-ItemProperty -Path $regEnvKey -Name 'Path' -Value $PathValue

View File

@@ -6,19 +6,18 @@
Import-Module -Name ImageHelpers
# Download the latest cf cli exe
Invoke-WebRequest -UseBasicParsing -Uri "https://packages.cloudfoundry.org/stable?release=windows64-exe&source=github" -OutFile cf-cli.zip
$CloudFoundryCliName = "cf-cli.zip"
$CloudFoundryCliUrl = "https://packages.cloudfoundry.org/stable?release=windows64-exe&source=github"
$CloudFoundryArchPath = Start-DownloadWithRetry -Url $CloudFoundryCliUrl -Name $CloudFoundryCliName
# Create directory for cf cli
$cf_cli_path = "C:\cf-cli"
New-Item -Path $cf_cli_path -ItemType Directory -Force
$CloudFoundryCliPath = "C:\cf-cli"
New-Item -Path $CloudFoundryCliPath -ItemType Directory -Force
# Extract the zip archive
Write-Host "Extracting cf cli..."
Expand-Archive -Path cf-cli.zip -DestinationPath $cf_cli_path -Force
Expand-Archive -Path $CloudFoundryArchPath -DestinationPath $CloudFoundryCliPath -Force
# Add cf to path
Add-MachinePathItem $cf_cli_path
# Delete the cfl-cli zip archive
Write-Host "Deleting downloaded archive of cf cli"
Remove-Item cf-cli.zip
Add-MachinePathItem $CloudFoundryCliPath

View File

@@ -32,7 +32,10 @@ function InstallSDKVersion (
}
# Fix for issue 1276. This will be fixed in 3.1.
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/dotnet/sdk/82bc30c99f1325dfaa7ad450be96857a4fca2845/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.ImportPublishProfile.targets" -outfile "C:\Program Files\dotnet\sdk\$sdkVersion\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportPublishProfile.targets"
$sdkTargetsName = "Microsoft.NET.Sdk.ImportPublishProfile.targets"
$sdkTargetsUrl = "https://raw.githubusercontent.com/dotnet/sdk/82bc30c99f1325dfaa7ad450be96857a4fca2845/src/Tasks/Microsoft.NET.Build.Tasks/targets/${sdkTargetsName}"
$sdkTargetsPath = "C:\Program Files\dotnet\sdk\$sdkVersion\Sdks\Microsoft.NET.Sdk\targets"
Start-DownloadWithRetry -Url $sdkTargetsUrl -DownloadPath $sdkTargetsPath -Name $sdkTargetsName
# warm up dotnet for first time experience
$templates | ForEach-Object {
@@ -49,8 +52,10 @@ function InstallSDKVersion (
function InstallAllValidSdks()
{
Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases-index.json' -UseBasicParsing -OutFile 'releases-index.json'
$dotnetChannels = Get-Content -Path 'releases-index.json' | ConvertFrom-Json
$releaseIndexName = "releases-index.json"
$releaseIndexUrl = "https://raw.githubusercontent.com/dotnet/core/master/release-notes/${releaseIndexName}"
$releasesIndexPath = Start-DownloadWithRetry -Url $releaseIndexUrl -Name $releaseIndexName
$dotnetChannels = Get-Content -Path $releasesIndexPath | ConvertFrom-Json
# Consider all channels except preview/eol channels.
# Sort the channels in ascending order
@@ -58,13 +63,15 @@ function InstallAllValidSdks()
$dotnetChannels = $dotnetChannels.'releases-index' | Where-Object { (!$_."support-phase".Equals('preview') -and !$_."support-phase".Equals('eol')) -or ($_."channel-version" -eq "2.2") } | Sort-Object { [Version] $_."channel-version" }
# Download installation script.
Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile 'dotnet-install.ps1'
$installationName = "dotnet-install.ps1"
$installationUrl = "https://dot.net/v1/${installationName}"
Start-DownloadWithRetry -Url $installationUrl -Name $installationName -DownloadPath ".\"
ForEach ($dotnetChannel in $dotnetChannels)
{
$channelVersion = $dotnetChannel.'channel-version';
Invoke-WebRequest -Uri $dotnetChannel.'releases.json' -UseBasicParsing -OutFile "releases-$channelVersion.json"
$currentReleases = Get-Content -Path "releases-$channelVersion.json" | ConvertFrom-Json
$releasesJsonPath = Start-DownloadWithRetry -Url $dotnetChannel.'releases.json' -Name "releases-$channelVersion.json"
$currentReleases = Get-Content -Path $releasesJsonPath | ConvertFrom-Json
# filtering out the preview/rc releases
$currentReleases = $currentReleases.'releases' | Where-Object { !$_.'release-version'.Contains('-') } | Sort-Object { [Version] $_.'release-version' }
@@ -74,7 +81,6 @@ function InstallAllValidSdks()
{
Write-Host 'Found sdks property in release: ' + $release.'release-version' + 'with sdks count: ' + $release.'sdks'.Count
# Remove duplicate entries & preview/rc version from download list
# Sort the sdks on version
$sdks = @($release.'sdk');

View File

@@ -5,37 +5,36 @@
Choco-Install -PackageName microsoft-edge
# Install Microsoft Edge Web Driver
Write-Host "Install Edge WebDriver"
$DestinationPath = "$($env:SystemDrive)\";
$EdgeDriverPath = "${DestinationPath}SeleniumWebDrivers\EdgeDriver"
if (-not (Test-Path -Path $EdgeDriverPath)) {
New-Item -Path $EdgeDriverPath -ItemType "directory"
# Install Microsoft Edge WebDriver
Write-Host "Install Edge WebDriver..."
$EdgeDriverPath = "$($env:SystemDrive)\SeleniumWebDrivers\EdgeDriver"
if (-not (Test-Path -Path $EdgeDriverPath))
{
New-Item -Path $EdgeDriverPath -ItemType Directory -Force
}
Write-Host "Get the Microsoft Edge WebDriver version..."
$RegistryPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"
$EdgePath = (Get-ItemProperty "$RegistryPath\msedge.exe").'(default)'
[version]$EdgeVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($EdgePath).ProductVersion
$EdgeDriverVersionUrl = "https://msedgedriver.azureedge.net/LATEST_RELEASE_$($EdgeVersion.Major)"
$EdgeDriverVersionFile = "$EdgeDriverPath\versioninfo.txt"
Invoke-WebRequest -Uri $EdgeDriverVersionUrl -OutFile $EdgeDriverVersionFile
Write-Host "Microsoft Edge driver download started"
$EdgeDriverVersionFile = Start-DownloadWithRetry -Url $EdgeDriverVersionUrl -Name "versioninfo.txt" -DownloadPath $EdgeDriverPath
Write-Host "Download Microsoft Edge WebDriver..."
$EdgeDriverLatestVersion = Get-Content -Path $EdgeDriverVersionFile
$EdgeDriverDownloadUrl="https://msedgedriver.azureedge.net/${EdgeDriverLatestVersion}/edgedriver_win64.zip"
$DestFile = "$EdgeDriverPath\edgedriver_win64.zip"
Invoke-WebRequest -Uri $EdgeDriverDownloadUrl -OutFile $DestFile
$EdgeDriverArchName = "edgedriver_win64.zip"
$EdgeDriverDownloadUrl="https://msedgedriver.azureedge.net/${EdgeDriverLatestVersion}/${EdgeDriverArchName}"
Write-Host "Microsoft Edge driver installation started"
Expand-Archive -Path $DestFile -DestinationPath $EdgeDriverPath -Force
Remove-Item -Path $DestFile -Force
$EdgeDriverArchPath = Start-DownloadWithRetry -Url $EdgeDriverDownloadUrl -Name $EdgeDriverArchName
Write-Host "Setting the environment variables"
Write-Host "Expand Microsoft Edge WebDriver archive..."
Expand-Archive -Path $EdgeDriverArchPath -DestinationPath $EdgeDriverPath -Force
setx EdgeWebDriver "$EdgeDriverPath" /M;
Write-Host "Setting the environment variables..."
setx EdgeWebDriver "$EdgeDriverPath" /M
$regEnvKey = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\';
$PathValue = Get-ItemPropertyValue -Path $regEnvKey -Name 'Path';
$PathValue += ";$EdgeDriverPath\";
Set-ItemProperty -Path $regEnvKey -Name 'Path' -Value $PathValue;
$regEnvKey = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\'
$PathValue = Get-ItemPropertyValue -Path $regEnvKey -Name 'Path'
$PathValue += ";$EdgeDriverPath\"
Set-ItemProperty -Path $regEnvKey -Name 'Path' -Value $PathValue

View File

@@ -5,71 +5,48 @@
Import-Module -Name ImageHelpers -Force
$temp_install_dir = 'C:\Windows\Installer'
New-Item -Path $temp_install_dir -ItemType Directory -Force
# Install and configure Firefox browser
Write-Host "Install latest Firefox browser..."
$VersionsManifest = Invoke-RestMethod "https://product-details.mozilla.org/1.0/firefox_versions.json"
$InstallerName = "firefox-browser.exe"
$InstallerUrl = "https://download.mozilla.org/?product=firefox-$($VersionsManifest.LATEST_FIREFOX_VERSION)&os=win64&lang=en-US"
$ArgumentList = ("/silent", "/install")
$versionsJson = Invoke-RestMethod "https://product-details.mozilla.org/1.0/firefox_versions.json"
$latestVersion = $versionsJson.LATEST_FIREFOX_VERSION
Write-Host "Firefox latest version: $latestVersion"
Install-Binary -Url $InstallerUrl -Name $InstallerName -ArgumentList $ArgumentList
# url for latest version of firefox
$urlLatestVersion = "https://download.mozilla.org/?product=firefox-${latestVersion}&os=win64&lang=en-US"
Install-Binary -Url $urlLatestVersion -Name "Firefox Setup $latestVersion.exe" -ArgumentList ("/silent", "/install")
# Disable autoupdate
$firefoxDirectoryPath = Join-Path $env:ProgramFiles "Mozilla Firefox"
New-Item -path $firefoxDirectoryPath -Name 'mozilla.cfg' -Value '//
Write-Host "Disable autoupdate..."
$FirefoxDirectoryPath = Join-Path $env:ProgramFiles "Mozilla Firefox"
New-Item -path $FirefoxDirectoryPath -Name 'mozilla.cfg' -Value '//
pref("browser.shell.checkDefaultBrowser", false);
pref("app.update.enabled", false);' -ItemType file -force
$firefoxPreferencesFolder = Join-Path $firefoxDirectoryPath "defaults\pref"
New-Item -path $firefoxPreferencesFolder -Name 'local-settings.js' -Value 'pref("general.config.obscure_value", 0);
$FirefoxPreferencesFolder = Join-Path $FirefoxDirectoryPath "defaults\pref"
New-Item -path $FirefoxPreferencesFolder -Name 'local-settings.js' -Value 'pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");' -ItemType file -force
# Install Firefox gecko Web Driver
Write-Host "Install Firefox WebDriver"
$DestinationPath = "$($env:SystemDrive)\";
$SeleniumWebDriverPath = Join-Path $DestinationPath "SeleniumWebDrivers"
$geckodriverJson = Invoke-RestMethod "https://api.github.com/repos/mozilla/geckodriver/releases/latest"
$geckodriverWindowsAsset = $geckodriverJson.assets | Where-Object { $_.name -Match "win64" } | Select-Object -First 1
$geckodriverVersion = $geckodriverJson.tag_name
Write-Host "Geckodriver version: $geckodriverVersion"
$DriversZipFile = $geckodriverWindowsAsset.name
Write-Host "Selenium drivers download and install..."
$FirefoxDriverPath = Join-Path $SeleniumWebDriverPath "GeckoDriver"
if (-not (Test-Path -Path $FirefoxDriverPath)) {
New-Item -Path $FirefoxDriverPath -ItemType "directory"
# Download and install Gecko WebDriver
Write-Host "Install Gecko WebDriver..."
$GeckoDriverPath = "$($env:SystemDrive)\SeleniumWebDrivers\GeckoDriver"
if (-not (Test-Path -Path $GeckoDriverPath))
{
New-Item -Path $GeckoDriverPath -ItemType Directory -Force
}
$geckodriverVersion.Substring(1) | Out-File -FilePath "$FirefoxDriverPath\versioninfo.txt" -Force;
Write-Host "Get the Gecko WebDriver version..."
$GeckoDriverJson = Invoke-RestMethod "https://api.github.com/repos/mozilla/geckodriver/releases/latest"
$GeckoDriverWindowsAsset = $GeckoDriverJson.assets | Where-Object { $_.name -Match "win64" } | Select-Object -First 1
$GeckoDriverVersion = $GeckoDriverJson.tag_name
$GeckoDriverVersion.Substring(1) | Out-File -FilePath "$GeckoDriverPath\versioninfo.txt" -Force;
# Install Firefox Web Driver
Write-Host "FireFox driver download...."
if (-not (Test-Path -Path $FireFoxDriverPath)) {
New-Item -Path $FireFoxDriverPath -ItemType "directory"
}
Write-Host "Download Gecko WebDriver WebDriver..."
$GeckoDriverArchName = $GeckoDriverWindowsAsset.name
$GeckoDriverDownloadUrl = $GeckoDriverWindowsAsset.browser_download_url
$DestFile = Join-Path $FireFoxDriverPath $DriversZipFile
$FireFoxDriverDownloadUrl = $geckodriverWindowsAsset.browser_download_url
try{
Invoke-WebRequest -Uri $FireFoxDriverDownloadUrl -OutFile $DestFile
} catch {
Write-Error "[!] Failed to download $DriversZipFile"
exit 1
}
$GeckoDriverArchPath = Start-DownloadWithRetry -Url $GeckoDriverDownloadUrl -Name $GeckoDriverArchName
Write-Host "FireFox driver install...."
Expand-Archive -Path $DestFile -DestinationPath $FireFoxDriverPath -Force
Remove-Item -Path $DestFile -Force
Write-Host "Expand Gecko WebDriver archive..."
Expand-Archive -Path $GeckoDriverArchPath -DestinationPath $GeckoDriverPath -Force
Write-Host "Setting the environment variables"
Add-MachinePathItem -PathItem $FireFoxDriverPath
setx GeckoWebDriver "$FirefoxDriverPath" /M;
exit 0
Write-Host "Setting the environment variables..."
Add-MachinePathItem -PathItem $GeckoDriverPath
setx GeckoWebDriver "$GeckoDriverPath" /M

View File

@@ -6,12 +6,13 @@
Import-Module -Name ImageHelpers -Force
$refsJson = Invoke-RestMethod "https://api.github.com/repos/golang/go/git/refs/tags"
function Install-GoVersion
{
Param
(
[String]$goVersion,
[Switch]$addToDefaultPath
[String] $goVersion,
[Switch] $addToDefaultPath
)
$latestVersionObject = $refsJson | Where-Object { $_.ref -Match "refs/tags/go$goVersion[./d]*" } | Select-Object -Last 1
@@ -20,11 +21,15 @@ function Install-GoVersion
# Download the Go zip archive.
Write-Host "Downloading Go $latestVersion..."
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -UseBasicParsing -Uri "https://dl.google.com/go/go$latestVersion.windows-amd64.zip" -OutFile go$latestVersion.windows-amd64.zip
$goArchName = "go${latestVersion}.windows-amd64.zip"
$goArchUrl = "https://dl.google.com/go/${goArchName}"
$goArchPath = Start-DownloadWithRetry -Url $goArchUrl -Name $goArchName
# Extract the zip archive. It contains a single directory named "go".
Write-Host "Extracting Go $latestVersion..."
Expand-Archive -Path go$latestVersion.windows-amd64.zip -DestinationPath "C:\" -Force
Expand-Archive -Path $goArchPath -DestinationPath "C:\" -Force
# Delete unnecessary files to conserve space
Write-Host "Cleaning directories of Go $latestVersion..."
@@ -41,10 +46,6 @@ function Install-GoVersion
$newDirName = "Go$latestVersion"
Rename-Item -path "C:\go" -newName $newDirName
# Delete the Go zip archive.
Write-Host "Deleting downloaded archive of Go $latestVersion..."
Remove-Item go$latestVersion.windows-amd64.zip
# Make this the default version of Go?
if ($addToDefaultPath)
{
@@ -63,13 +64,18 @@ function Install-GoVersion
# Install Go
$goVersionsToInstall = $env:GO_VERSIONS.split(", ", [System.StringSplitOptions]::RemoveEmptyEntries)
foreach($go in $goVersionsToInstall) {
foreach ($go in $goVersionsToInstall)
{
Write-Host "Installing Go ${go}"
if($go -eq $env:GO_DEFAULT) {
if ($go -eq $env:GO_DEFAULT)
{
$installDirectory = Install-GoVersion -goVersion $go -addToDefaultPath
} else {
}
else
{
$installDirectory = Install-GoVersion -goVersion $go
}
$envName = "GOROOT_{0}_{1}_X64" -f $go.split(".")
setx $envName "$installDirectory" /M
}

View File

@@ -3,33 +3,22 @@
## Desc: Install various JDKs and java tools
################################################################################
Import-Module -Name ImageHelpers -Force
# Download the Azul Systems Zulu JDKs
# See https://www.azul.com/downloads/azure-only/zulu/
$azulJDK7Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-7/7u232/zulu-7-azure-jdk_7.31.0.5-7.0.232-win_x64.zip'
$azulJDK8Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-8/8u222/zulu-8-azure-jdk_8.40.0.25-8.0.222-win_x64.zip'
$azulJDK11Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-11/11.0.4/zulu-11-azure-jdk_11.33.15-11.0.4-win_x64.zip'
$azulJDK13Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-13/13.0.3/zulu-13-azure-jdk_13.31.11-13.0.3-win_x64.zip'
$azulJDKURLs = @(
'https://repos.azul.com/azure-only/zulu/packages/zulu-7/7u232/zulu-7-azure-jdk_7.31.0.5-7.0.232-win_x64.zip',
'https://repos.azul.com/azure-only/zulu/packages/zulu-8/8u222/zulu-8-azure-jdk_8.40.0.25-8.0.222-win_x64.zip',
'https://repos.azul.com/azure-only/zulu/packages/zulu-11/11.0.4/zulu-11-azure-jdk_11.33.15-11.0.4-win_x64.zip',
'https://repos.azul.com/azure-only/zulu/packages/zulu-13/13.0.3/zulu-13-azure-jdk_13.31.11-13.0.3-win_x64.zip'
)
cd $env:TEMP
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK7Uri -OutFile azulJDK7.zip
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK8Uri -OutFile azulJDK8.zip
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK11Uri -OutFile azulJDK11.zip
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK13Uri -OutFile azulJDK13.zip
# Expand the zips
Expand-Archive -Path azulJDK7.zip -DestinationPath "C:\Program Files\Java\" -Force
Expand-Archive -Path azulJDK8.zip -DestinationPath "C:\Program Files\Java\" -Force
Expand-Archive -Path azulJDK11.zip -DestinationPath "C:\Program Files\Java\" -Force
Expand-Archive -Path azulJDK13.zip -DestinationPath "C:\Program Files\Java\" -Force
# Deleting zip folders
Remove-Item -Recurse -Force azulJDK7.zip
Remove-Item -Recurse -Force azulJDK8.zip
Remove-Item -Recurse -Force azulJDK11.zip
Remove-Item -Recurse -Force azulJDK13.zip
Import-Module -Name ImageHelpers -Force
foreach ($azulJDKURL in $azulJDKURLs)
{
$archivePath = Start-DownloadWithRetry -Url $azulJDKURL -Name $([IO.Path]::GetFileName($azulJDKURL))
Expand-Archive -Path $archivePath -DestinationPath "C:\Program Files\Java\"
}
$currentPath = Get-MachinePath
@@ -38,7 +27,7 @@ $newPathSegments = @()
foreach ($pathSegment in $pathSegments)
{
if($pathSegment -notlike '*java*')
if ($pathSegment -notlike '*java*')
{
$newPathSegments += $pathSegment
}
@@ -74,8 +63,7 @@ Choco-Install -PackageName maven -ArgumentList "-i", "--version=3.6.3"
Choco-Install -PackageName gradle
# Move maven variables to Machine. They may not be in the environment for this script so we need to read them from the registry.
$userSid = (Get-WmiObject win32_useraccount -Filter "name = '$env:USERNAME' AND domain = '$env:USERDOMAIN'").SID
$userEnvironmentKey = 'Registry::HKEY_USERS\' + $userSid + '\Environment'
$userEnvironmentKey = 'Registry::HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
$m2_home = (Get-ItemProperty -Path $userEnvironmentKey -Name M2_HOME).M2_HOME
$m2 = $m2_home + '\bin'
@@ -93,14 +81,7 @@ setx MAVEN_OPTS $maven_opts /M
$uri = 'https://ayera.dl.sourceforge.net/project/cobertura/cobertura/2.1.1/cobertura-2.1.1-bin.zip'
$coberturaPath = "C:\cobertura-2.1.1"
cd $env:TEMP
Invoke-WebRequest -UseBasicParsing -Uri $uri -OutFile cobertura.zip
# Expand the zip
Expand-Archive -Path cobertura.zip -DestinationPath "C:\" -Force
# Deleting zip folder
Remove-Item -Recurse -Force cobertura.zip
$archivePath = Start-DownloadWithRetry -Url $uri -Name "cobertura.zip"
Expand-Archive -Path $archivePath -DestinationPath "C:\"
setx COBERTURA_HOME $coberturaPath /M

View File

@@ -6,25 +6,24 @@
$stableKindTag = "v0.7.0"
$tagToUse = $stableKindTag;
$destFilePath = "C:\ProgramData\kind"
$outFilePath = "C:\ProgramData\kind\kind.exe"
try
{
$getkindUri = "https://github.com/kubernetes-sigs/kind/releases/download/$tagToUse/kind-windows-amd64"
$kindUrl = "https://github.com/kubernetes-sigs/kind/releases/download/$tagToUse/kind-windows-amd64"
Write-Host "Downloading kind.exe..."
New-Item -Path $destFilePath -ItemType Directory -Force
Invoke-WebRequest -Uri $getkindUri -OutFile $outFilePath
$kindInstallerPath = Start-DownloadWithRetry -Url $kindUrl -Name "kind.exe" -DownloadPath $destFilePath
Write-Host "Starting Install kind.exe..."
$process = Start-Process -FilePath $outFilePath -Wait -PassThru
$process = Start-Process -FilePath $kindInstallerPath -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
Add-MachinePathItem $destFilePath
exit $exitCode
}
else
{

View File

@@ -3,10 +3,10 @@
## Desc: Install Mysql CLI
################################################################################
## Downloading mysql jar
$uri = 'https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21-winx64.zip'
$mysqlPath = 'C:\mysql-5.7.21-winx64\bin'
$MysqlVersionName = "mysql-5.7.21-winx64"
$MysqlVersionUrl = "https://dev.mysql.com/get/Downloads/MySQL-5.7/${MysqlVersionName}.zip"
$MysqlPath = "C:\$MysqlVersionName\bin"
# Installing visual c++ redistibutable package.
$InstallerName = "vcredist_x64.exe"
@@ -19,13 +19,10 @@ Install-Binary -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentLi
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"
# Get the latest mysql command line tools .
Invoke-WebRequest -UseBasicParsing -Uri $uri -OutFile mysql.zip
$mysqlArchPath = Start-DownloadWithRetry -Url $MysqlVersionUrl -Name "mysql.zip"
# Expand the zip
Expand-Archive -Path mysql.zip -DestinationPath "C:\" -Force
# Deleting zip folder
Remove-Item -Recurse -Force mysql.zip
Expand-Archive -Path $mysqlArchPath -DestinationPath "C:\" -Force
# Adding mysql in system environment path
Add-MachinePathItem $mysqlPath

View File

@@ -11,13 +11,10 @@ $env:CARGO_HOME="C:\Rust\.cargo"
# Download the latest rustup-init.exe for Windows x64
# See https://rustup.rs/#
Invoke-WebRequest -UseBasicParsing -Uri "https://win.rustup.rs/x86_64" -OutFile rustup-init.exe
$rustupPath = Start-DownloadWithRetry -Url "https://win.rustup.rs/x86_64" -Name "rustup-init.exe"
# Install Rust by running rustup-init.exe (disabling the confirmation prompt with -y)
.\rustup-init.exe -y --default-toolchain=stable --profile=minimal
# Delete rustup-init.exe when it's no longer needed
Remove-Item -Path .\rustup-init.exe
& $rustupPath -y --default-toolchain=stable --profile=minimal
# Add Rust binaries to the path
Add-MachinePathItem "$env:CARGO_HOME\bin"

View File

@@ -5,57 +5,21 @@
Import-Module -Name ImageHelpers -Force
Function InstallMSI
{
Param
(
[String]$MsiUrl,
[String]$MsiName
)
$exitCode = -1
try
{
Write-Host "Downloading $MsiName..."
$FilePath = "${env:Temp}\$MsiName"
Invoke-WebRequest -Uri $MsiUrl -OutFile $FilePath
$Arguments = ('/i', $FilePath, '/QN', '/norestart' )
Write-Host "Starting Install $MsiName..."
$process = Start-Process -FilePath msiexec.exe -ArgumentList $Arguments -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
return $exitCode
}
else
{
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
exit $exitCode
}
}
catch
{
Write-Host -Object "Failed to install the MSI $MsiName"
Write-Host -Object $_.Exception.Message
exit -1
}
}
$BaseUrl = "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64"
# install required MSIs
$SQLSysClrTypesExitCode = InstallMSI -MsiUrl "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64/SQLSysClrTypes.msi" -MsiName "SQLSysClrTypes.msi"
$SQLSysClrTypesName = "SQLSysClrTypes.msi"
$SQLSysClrTypesUrl = "${BaseUrl}/${SQLSysClrTypesName}"
Install-Binary -Url $SQLSysClrTypesUrl -Name $SQLSysClrTypesName
$SharedManagementObjectsExitCode = InstallMSI -MsiUrl "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64/SharedManagementObjects.msi" -MsiName "SharedManagementObjects.msi"
$SharedManagementObjectsName = "SharedManagementObjects.msi"
$SharedManagementObjectsUrl = "${BaseUrl}/${SharedManagementObjectsName}"
Install-Binary -Url $SharedManagementObjectsUrl -Name $SharedManagementObjectsName
$PowerShellToolsExitCode = InstallMSI -MsiUrl "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64/PowerShellTools.msi" -MsiName "PowerShellTools.msi"
$PowerShellToolsName = "PowerShellTools.msi"
$PowerShellToolsUrl = "${BaseUrl}/${PowerShellToolsName}"
Install-Binary -Url $PowerShellToolsUrl -Name $PowerShellToolsName
# install sqlserver PS module
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name SqlServer -AllowClobber
exit $PowerShellToolsExitCode
Install-Module -Name SqlServer -AllowClobber

View File

@@ -3,6 +3,8 @@
## Desc: Install Selenium Server standalone
################################################################################
Import-Module -Name ImageHelpers -Force
# Acquire latest Selenium release number from GitHub API
$latestReleaseUrl = "https://api.github.com/repos/SeleniumHQ/selenium/releases/latest"
try {
@@ -20,16 +22,13 @@ $seleniumVersion = [version]::Parse($seleniumVersionString)
Write-Host "Downloading selenium-server-standalone v$seleniumVersion..."
$seleniumReleaseUrl = "https://selenium-release.storage.googleapis.com/$($seleniumVersion.ToString(2))/selenium-server-standalone-$($seleniumVersion.ToString(3)).jar"
New-Item -ItemType directory -Path "C:\selenium\"
$seleniumBinPath = "C:\selenium\selenium-server-standalone.jar"
try {
Invoke-WebRequest -UseBasicParsing -Uri $seleniumReleaseUrl -OutFile $seleniumBinPath
} catch {
Write-Error $_
exit 1
}
$seleniumDirectory = "C:\selenium\"
$seleniumFileName = "selenium-server-standalone.jar"
New-Item -ItemType directory -Path $seleniumDirectory
Start-DownloadWithRetry -Url $seleniumReleaseUrl -Name $seleniumFileName -DownloadPath $seleniumDirectory
Write-Host "Add selenium jar to the environment variables..."
$seleniumBinPath = Join-Path $seleniumDirectory $seleniumFileName
setx "SELENIUM_JAR_PATH" "$($seleniumBinPath)" /M
exit 0

View File

@@ -5,10 +5,10 @@
# Download the latest command line tools so that we can accept all of the licenses.
# See https://developer.android.com/studio/#command-tools
Invoke-WebRequest -UseBasicParsing -Uri "https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip" -OutFile android-sdk-tools.zip
$sdkArchPath = Start-DownloadWithRetry -Url "https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip" -Name "android-sdk-tools.zip"
# Don't replace the one that VS installs as it seems to break things.
Expand-Archive -Path android-sdk-tools.zip -DestinationPath android-sdk -Force
Expand-Archive -Path $sdkArchPath -DestinationPath android-sdk -Force
$sdk = Get-Item -Path .\android-sdk

View File

@@ -62,7 +62,10 @@ $ErrorActionPreference = "Stop"
Import-Module -Name ImageHelpers -Force
# Define executables for cached tools
$toolsExecutables = @{ Python = @("python.exe", "Scripts\pip.exe") }
$toolsExecutables = @{
Python = @("python.exe", "Scripts\pip.exe");
node = @("node.exe", "npm")
}
# Get toolcache content from toolset
$tools = Get-ToolsetContent | Select-Object -ExpandProperty toolcache

View File

@@ -3,63 +3,11 @@
## Desc: Install Visual Studio 2017
################################################################################
Function InstallVS
{
Param
(
[String]$WorkLoads,
[String]$Sku,
[String] $VSBootstrapperURL
)
$ErrorActionPreference = "Stop"
$exitCode = -1
Import-Module -Name ImageHelpers -Force
try
{
Write-Host "Enable short name support on Windows needed for Xamarin Android AOT, defaults appear to have been changed in Azure VMs"
$shortNameEnableProcess = Start-Process -FilePath fsutil.exe -ArgumentList ('8dot3name', 'set', '0') -Wait -PassThru
$shortNameEnableExitCode = $shortNameEnableProcess.ExitCode
if ($shortNameEnableExitCode -ne 0)
{
Write-Host -Object 'Enabling short name support on Windows failed. This needs to be enabled prior to VS 2017 install for Xamarin Andriod AOT to work.'
exit $shortNameEnableExitCode
}
Write-Host "Downloading Bootstrapper ..."
Invoke-WebRequest -Uri $VSBootstrapperURL -OutFile "${env:Temp}\vs_$Sku.exe"
$FilePath = "${env:Temp}\vs_$Sku.exe"
$Arguments = ('/c', $FilePath, $WorkLoads, '--quiet', '--norestart', '--wait', '--nocache' )
Write-Host "Starting Install ..."
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
return $exitCode
}
else
{
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
# this wont work because of log size limitation in extension manager
# Get-Content $customLogFilePath | Write-Host
exit $exitCode
}
}
catch
{
Write-Host -Object "Failed to install Visual Studio. Check the logs for details in $customLogFilePath"
Write-Host -Object $_.Exception.Message
exit -1
}
}
$WorkLoads = '--allWorkloads --includeRecommended ' + `
$WorkLoads = '--allWorkloads --includeRecommended ' + `
'--add Microsoft.Net.Component.4.6.2.SDK ' + `
'--add Microsoft.Net.Component.4.6.2.TargetingPack ' + `
'--add Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools ' + `
@@ -129,20 +77,18 @@ $WorkLoads = '--allWorkloads --includeRecommended ' + `
'--add Microsoft.VisualStudio.Workload.Office ' + `
'--add Microsoft.VisualStudio.Workload.OfficeBuildTools '
$Sku = 'Enterprise'
$VSBootstrapperURL = 'https://aka.ms/vs/15/release/vs_enterprise.exe'
$ErrorActionPreference = 'Stop'
$ReleaseInPath = "Enterprise"
$BootstrapperUrl = "https://aka.ms/vs/15/release/vs_${ReleaseInPath}.exe"
# Install VS
$exitCode = InstallVS -WorkLoads $WorkLoads -Sku $Sku -VSBootstrapperURL $VSBootstrapperURL
Install-VisualStudio -BootstrapperUrl $BootstrapperUrl -WorkLoads $WorkLoads
# Find the version of VS installed for this instance
# Only supports a single instance
$vsProgramData = Get-Item -Path "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances"
$instanceFolders = Get-ChildItem -Path $vsProgramData.FullName
if($instanceFolders -is [array])
if ($instanceFolders -is [array])
{
Write-Host "More than one instance installed"
exit 1
@@ -151,20 +97,19 @@ if($instanceFolders -is [array])
$catalogContent = Get-Content -Path ($instanceFolders.FullName + '\catalog.json')
$catalog = $catalogContent | ConvertFrom-Json
$version = $catalog.info.id
$VSInstallRoot = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise"
Write-Host "Visual Studio version" $version "installed"
$VSInstallRoot = "C:\Program Files (x86)\Microsoft Visual Studio\2017\$ReleaseInPath"
Write-Host "Visual Studio version ${version} installed"
# Initialize Visual Studio Experimental Instance for integration testing
&"$VSInstallRoot\Common7\IDE\devenv.exe" /RootSuffix Exp /ResetSettings General.vssettings /Command File.Exit | Wait-Process
& "$VSInstallRoot\Common7\IDE\devenv.exe" /RootSuffix Exp /ResetSettings General.vssettings /Command File.Exit | Wait-Process
# Updating content of MachineState.json file to disable autoupdate of VSIX extensions
$newContent = '{"Extensions":[{"Key":"1e906ff5-9da8-4091-a299-5c253c55fdc9","Value":{"ShouldAutoUpdate":false}},{"Key":"Microsoft.VisualStudio.Web.AzureFunctions","Value":{"ShouldAutoUpdate":false}}],"ShouldAutoUpdate":false,"ShouldCheckForUpdates":false}'
Set-Content -Path "$VSInstallRoot\Common7\IDE\Extensions\MachineState.json" -Value $newContent
# Adding description of the software to Markdown
$SoftwareName = "Visual Studio 2017 Enterprise"
$SoftwareName = "Visual Studio 2017 $ReleaseInPath"
$Description = @"
_Version:_ $version<br/>
@@ -198,8 +143,4 @@ In addition the following optional components are installed:
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
# Adding explicitly added Workloads details to markdown by parsing $Workloads
Add-ContentToMarkdown -Content $($WorkLoads.Split('--') | % { if( ($_.Split(" "))[0] -like "add") { "* " +($_.Split(" "))[1] } } )
exit $exitCode
Add-ContentToMarkdown -Content $($WorkLoads.Split('--') | % { if( ($_.Split(" "))[0] -like "add") { "* " +($_.Split(" "))[1] } } )

View File

@@ -4,61 +4,7 @@
################################################################################
$ErrorActionPreference = "Stop"
Function InstallVS
{
Param
(
[String]$WorkLoads,
[String]$Sku,
[String] $VSBootstrapperURL
)
$exitCode = -1
try
{
Write-Host "Enable short name support on Windows needed for Xamarin Android AOT, defaults appear to have been changed in Azure VMs"
$shortNameEnableProcess = Start-Process -FilePath fsutil.exe -ArgumentList ('8dot3name', 'set', '0') -Wait -PassThru
$shortNameEnableExitCode = $shortNameEnableProcess.ExitCode
if ($shortNameEnableExitCode -ne 0)
{
Write-Host -Object 'Enabling short name support on Windows failed. This needs to be enabled prior to VS 2017 install for Xamarin Andriod AOT to work.'
exit $shortNameEnableExitCode
}
Write-Host "Downloading Bootstrapper ..."
Invoke-WebRequest -Uri $VSBootstrapperURL -OutFile "${env:Temp}\vs_$Sku.exe"
$FilePath = "${env:Temp}\vs_$Sku.exe"
$Arguments = ('/c', $FilePath, $WorkLoads, '--quiet', '--norestart', '--wait', '--nocache' )
Write-Host "Starting Install ..."
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
return $exitCode
}
else
{
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
# this wont work because of log size limitation in extension manager
# Get-Content $customLogFilePath | Write-Host
exit $exitCode
}
}
catch
{
Write-Host -Object "Failed to install Visual Studio. Check the logs for details in $customLogFilePath"
Write-Host -Object $_.Exception.Message
exit -1
}
}
Import-Module -Name ImageHelpers -Force
$WorkLoads = '--allWorkloads --includeRecommended ' + `
'--add Component.Dotfuscator ' + `
@@ -87,6 +33,7 @@ $WorkLoads = '--allWorkloads --includeRecommended ' + `
'--add Microsoft.VisualStudio.Component.EntityFramework ' + `
'--add Microsoft.VisualStudio.Component.FSharp.Desktop ' + `
'--add Microsoft.VisualStudio.Component.LinqToSql ' + `
'--add Microsoft.VisualStudio.Component.SQL.SSDT ' + `
'--add Microsoft.VisualStudio.Component.PortableLibrary ' + `
'--add Microsoft.VisualStudio.Component.TeamOffice ' + `
'--add Microsoft.VisualStudio.Component.TestTools.CodedUITest ' + `
@@ -150,22 +97,18 @@ $WorkLoads = '--allWorkloads --includeRecommended ' + `
'--add Microsoft.VisualStudio.Workload.Universal ' + `
'--add Microsoft.VisualStudio.Workload.VisualStudioExtension'
$ReleaseInPath = 'Enterprise'
$Sku = 'Enterprise'
$VSBootstrapperURL = 'https://aka.ms/vs/16/release/vs_Enterprise.exe'
$ErrorActionPreference = 'Stop'
$ReleaseInPath = "Enterprise"
$BootstrapperUrl = "https://aka.ms/vs/16/release/vs_${ReleaseInPath}.exe"
# Install VS
$exitCode = InstallVS -WorkLoads $WorkLoads -Sku $Sku -VSBootstrapperURL $VSBootstrapperURL
Install-VisualStudio -BootstrapperUrl $BootstrapperUrl -WorkLoads $WorkLoads
# Find the version of VS installed for this instance
# Only supports a single instance
$vsProgramData = Get-Item -Path "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances"
$instanceFolders = Get-ChildItem -Path $vsProgramData.FullName
if($instanceFolders -is [array])
if ($instanceFolders -is [array])
{
Write-Host "More than one instance installed"
exit 1
@@ -174,14 +117,15 @@ if($instanceFolders -is [array])
$catalogContent = Get-Content -Path ($instanceFolders.FullName + '\catalog.json')
$catalog = $catalogContent | ConvertFrom-Json
$version = $catalog.info.id
Write-Host "Visual Studio version" $version "installed"
$VSInstallRoot = "C:\Program Files (x86)\Microsoft Visual Studio\2019\$ReleaseInPath"
Write-Host "Visual Studio version ${version} installed"
# Initialize Visual Studio Experimental Instance
&"C:\Program Files (x86)\Microsoft Visual Studio\2019\$ReleaseInPath\Common7\IDE\devenv.exe" /RootSuffix Exp /ResetSettings General.vssettings /Command File.Exit
& "$VSInstallRoot\Common7\IDE\devenv.exe" /RootSuffix Exp /ResetSettings General.vssettings /Command File.Exit
# Updating content of MachineState.json file to disable autoupdate of VSIX extensions
$newContent = '{"Extensions":[{"Key":"1e906ff5-9da8-4091-a299-5c253c55fdc9","Value":{"ShouldAutoUpdate":false}},{"Key":"Microsoft.VisualStudio.Web.AzureFunctions","Value":{"ShouldAutoUpdate":false}}],"ShouldAutoUpdate":false,"ShouldCheckForUpdates":false}'
Set-Content -Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\$ReleaseInPath\Common7\IDE\Extensions\MachineState.json" -Value $newContent
Set-Content -Path "$VSInstallRoot\Common7\IDE\Extensions\MachineState.json" -Value $newContent
# Adding description of the software to Markdown
@@ -190,7 +134,7 @@ $SoftwareName = "Visual Studio 2019 Enterprise"
$Description = @"
_Version:_ $version<br/>
_Location:_ C:\Program Files (x86)\Microsoft Visual Studio\2019\$ReleaseInPath
_Location:_ $VSInstallRoot
The following workloads and components are installed with Visual Studio 2019:
"@
@@ -198,7 +142,4 @@ The following workloads and components are installed with Visual Studio 2019:
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
# Adding explicitly added Workloads details to markdown by parsing $Workloads
Add-ContentToMarkdown -Content $($WorkLoads.Split('--') | % { if( ($_.Split(" "))[0] -like "add") { "* " +($_.Split(" "))[1] } } )
exit $exitCode
Add-ContentToMarkdown -Content $($WorkLoads.Split('--') | % { if( ($_.Split(" "))[0] -like "add") { "* " +($_.Split(" "))[1] } } )

View File

@@ -26,6 +26,18 @@
"3.7.*",
"3.8.*"
]
},
{
"name": "node",
"url" : "https://raw.githubusercontent.com/actions/node-versions/master/versions-manifest.json",
"arch": "x64",
"platform" : "win32",
"versions": [
"8.*",
"10.*",
"12.*",
"14.*"
]
}
]
}

View File

@@ -26,6 +26,18 @@
"3.7.*",
"3.8.*"
]
},
{
"name": "node",
"url" : "https://raw.githubusercontent.com/actions/node-versions/master/versions-manifest.json",
"arch": "x64",
"platform" : "win32",
"versions": [
"8.*",
"10.*",
"12.*",
"14.*"
]
}
]
}