Skip to content

Instantly share code, notes, and snippets.

@jimevans
Last active April 8, 2020 03:23
Show Gist options
  • Select an option

  • Save jimevans/de8ffe6ae1977e4fdb459e41fa6bbf08 to your computer and use it in GitHub Desktop.

Select an option

Save jimevans/de8ffe6ae1977e4fdb459e41fa6bbf08 to your computer and use it in GitHub Desktop.
Setup of a Selenium Development Environment in Windows (batch and PowerShell versions)
REM Tested and confirmed to work on a newly-installed Windows 10 Professional Build 1909
DISM /Online /Add-Capability /CapabilityName:Tools.DeveloperMode.Core~~~~0.0.1.0
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowAllTrustedApps" /d "1"
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
powershell -NoProfile -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
choco install -y git
choco install -y openjdk11
choco install -y python
choco install -y visualstudio2019community --params "--add Microsoft.VisualStudio.Workload.ManagedDesktop;includeRecommended --add Microsoft.Net.Component.4.6.2.TargetingPack --add Microsoft.Net.Component.4.7.1.TargetingPack --add Microsoft.Net.Component.4.7.TargetingPack --add Microsoft.Net.Component.4.8.TargetingPack --add Microsoft.Net.ComponentGroup.4.6.1.DeveloperTools --add Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools --add Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools --add Microsoft.Net.ComponentGroup.4.7.DeveloperTools --add Microsoft.Net.ComponentGroup.4.8.DeveloperTools --add Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended"
choco install -y msys2 --params "/InstallDir=C:\tools\msys64"
choco install -y bazel
powershell -NoProfile -ExecutionPolicy Bypass -Command "[Environment]::SetEnvironmentVariable(\"BAZEL_SH\", \"C:\tools\msys64\usr\bin\bash.exe\", [System.EnvironmentVariableTarget]::Machine)"
powershell -NoProfile -ExecutionPolicy Bypass -Command "Restart-Computer -Confirm"
# Tested and confirmed to work on a newly-installed Windows 10 Professional Build 1909
Add-WindowsCapability -Online -Name "Tools.DeveloperMode.Core~~~~0.0.1.0"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowAllTrustedApps" -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -Value 1
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -y git
choco install -y openjdk11
choco install -y python
choco install -y visualstudio2019community --params "--add Microsoft.VisualStudio.Workload.ManagedDesktop;includeRecommended --add Microsoft.Net.Component.4.6.2.TargetingPack --add Microsoft.Net.Component.4.7.1.TargetingPack --add Microsoft.Net.Component.4.7.TargetingPack --add Microsoft.Net.Component.4.8.TargetingPack --add Microsoft.Net.ComponentGroup.4.6.1.DeveloperTools --add Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools --add Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools --add Microsoft.Net.ComponentGroup.4.7.DeveloperTools --add Microsoft.Net.ComponentGroup.4.8.DeveloperTools --add Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended"
choco install -y msys2 --params "/InstallDir=C:\tools\msys64"
choco install -y bazel
[Environment]::SetEnvironmentVariable("BAZEL_SH", "C:\tools\msys64\usr\bin\bash.exe", [System.EnvironmentVariableTarget]::Machine)
Restart-Computer -Confirm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment