├── .gitattributes ├── .gitignore ├── DevEnv.wsb ├── DevEnvHighContrast.wsb ├── Downloads.wsb ├── DownloadsDark.wsb ├── DownloadsHighContrast.wsb ├── LICENSE.txt ├── README.md ├── SandboxStartups ├── DevEnv.wsb.cmd ├── DevEnv.wsb.ps1 ├── DevEnvHighContrast.wsb.cmd ├── DevEnvHighContrast.wsb.ps1 ├── Downloads.wsb.cmd ├── Downloads.wsb.ps1 ├── DownloadsDark.wsb.cmd ├── DownloadsDark.wsb.ps1 ├── DownloadsHighContrast.wsb.cmd └── DownloadsHighContrast.wsb.ps1 ├── Scripts ├── DarkMode.ps1 ├── DownloadSoftware │ ├── CppRedists.Get.ps1 │ ├── DotNetSdk.Get.ps1 │ ├── Firefox.Get.ps1 │ ├── PowerShell.Get.ps1 │ └── VSCode.Get.ps1 ├── EnableDevModeSetupExplorer.ps1 ├── Exec-Policy-Fix.cmd ├── HighContrast.ps1 └── InstallSoftware │ ├── CppRedists.Install.ps1 │ ├── DotNetSdk.Install.ps1 │ ├── Firefox.Install.ps1 │ ├── PowerShell.Install.ps1 │ └── VSCode.Install.ps1 └── UpdateCachedExes.ps1 /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Visual Studio 2015/2017 cache/options directory 2 | .vs/ 3 | 4 | # Rider 5 | .idea/ 6 | 7 | # Cached files folder 8 | CachedExes/* -------------------------------------------------------------------------------- /DevEnv.wsb: -------------------------------------------------------------------------------- 1 | 2 | Enable 3 | Enable 4 | 8192 5 | 6 | 7 | C:\Users\%username%\WindowsSandbox-ConfigsAndScripts 8 | C:\Users\WDAGUtilityAccount\Desktop\WindowsSandbox-ConfigsAndScripts 9 | true 10 | 11 | 12 | C:\Users\%username%\source\repos 13 | C:\Users\WDAGUtilityAccount\Desktop\repos 14 | false 15 | 16 | 17 | 18 | C:\Users\WDAGUtilityAccount\Desktop\WindowsSandbox-ConfigsAndScripts\SandboxStartups\DevEnv.wsb.cmd 19 | 20 | 21 | -------------------------------------------------------------------------------- /DevEnvHighContrast.wsb: -------------------------------------------------------------------------------- 1 | 2 | Enable 3 | Enable 4 | 8192 5 | 6 | 7 | C:\Users\%username%\WindowsSandbox-ConfigsAndScripts 8 | C:\Users\WDAGUtilityAccount\Desktop\WindowsSandbox-ConfigsAndScripts 9 | true 10 | 11 | 12 | C:\Users\%username%\source\repos 13 | C:\Users\WDAGUtilityAccount\Desktop\repos 14 | false 15 | 16 | 17 | 18 | C:\Users\WDAGUtilityAccount\Desktop\WindowsSandbox-ConfigsAndScripts\SandboxStartups\DevEnvHighContrast.wsb.cmd 19 | 20 | 21 | -------------------------------------------------------------------------------- /Downloads.wsb: -------------------------------------------------------------------------------- 1 | 2 | Enable 3 | Enable 4 | Enable 5 | 6 | 7 | C:\Users\%username%\WindowsSandbox-ConfigsAndScripts 8 | C:\Users\WDAGUtilityAccount\Desktop\WindowsSandbox-ConfigsAndScripts 9 | true 10 | 11 | 12 | C:\Users\%username%\Downloads 13 | C:\Users\WDAGUtilityAccount\Downloads 14 | true 15 | 16 | 17 | 18 | C:\Users\WDAGUtilityAccount\Desktop\WindowsSandbox-ConfigsAndScripts\SandboxStartups\Downloads.wsb.cmd 19 | 20 | 21 | -------------------------------------------------------------------------------- /DownloadsDark.wsb: -------------------------------------------------------------------------------- 1 | 2 | Enable 3 | Enable 4 | Enable 5 | 6 | 7 | C:\Users\%username%\WindowsSandbox-ConfigsAndScripts 8 | C:\Users\WDAGUtilityAccount\Desktop\WindowsSandbox-ConfigsAndScripts 9 | true 10 | 11 | 12 | C:\Users\%username%\Downloads 13 | C:\Users\WDAGUtilityAccount\Downloads 14 | true 15 | 16 | 17 | 18 | C:\Users\WDAGUtilityAccount\Desktop\WindowsSandbox-ConfigsAndScripts\SandboxStartups\DownloadsDark.wsb.cmd 19 | 20 | 21 | -------------------------------------------------------------------------------- /DownloadsHighContrast.wsb: -------------------------------------------------------------------------------- 1 | 2 | Enable 3 | Enable 4 | Enable 5 | 6 | 7 | C:\Users\%username%\WindowsSandbox-ConfigsAndScripts 8 | C:\Users\WDAGUtilityAccount\Desktop\WindowsSandbox-ConfigsAndScripts 9 | true 10 | 11 | 12 | C:\Users\%username%\Downloads 13 | C:\Users\WDAGUtilityAccount\Downloads 14 | true 15 | 16 | 17 | 18 | C:\Users\WDAGUtilityAccount\Desktop\WindowsSandbox-ConfigsAndScripts\SandboxStartups\DownloadsHighContrast.wsb.cmd 19 | 20 | 21 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright © 2023 flexxxxer Aleksandr. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WindowsSandbox-ConfigsAndScripts 2 | **WindowsSandbox-ConfigsAndScripts** is a set of commonly used [Windows Sandbox 3 | configuration files](https://learn.microsoft.com/en-us/windows/security/threat-protection/windows-sandbox/windows-sandbox-configure-using-wsb-file) 4 | for software development, software testing, and isolated running of untrusted applications. 5 | Because you cannot create Windows Sandbox profiles with preinstalled software and settings 6 | this repository was made to automate frequently performed actions when starting Windows Sandbox 7 | (mainly pre-installing software and libraries, configuring, changing the appearance - turning on 8 | a dark theme or high contrast mode). 9 | 10 | # Get Started 11 | ## Requirements 12 | [Windows Sandbox](https://learn.microsoft.com/en-us/windows/security/threat-protection/windows-sandbox/windows-sandbox-overview) 13 | must be installed (the link also shows installation methods and minimum system requirements). 14 | 15 | ## Changing mapped folders paths 16 | Most Windows Sandbox configurations use mapped folders. The paths specified in the configurations may not be 17 | suitable for your computer and will need to be changed. Because paths must be explicitly specified and cannot be 18 | automatically substituted, let's look at an example. 19 | 20 | [Downloads.wsb](https://github.com/flexxxxer/WindowsSandbox-ConfigsAndScripts/blob/master/Downloads.wsb) 21 | configuration file, which has a mapped folder for the downloads folder: 22 | ```xml 23 | 24 | Enable 25 | Enable 26 | Enable 27 | 28 | 29 | C:\Users\%username%\WindowsSandbox-ConfigsAndScripts 30 | C:\Users\WDAGUtilityAccount\Desktop\WindowsSandbox-ConfigsAndScripts 31 | true 32 | 33 | 34 | C:\Users\%username%\Downloads 35 | C:\Users\WDAGUtilityAccount\Downloads 36 | true 37 | 38 | 39 | 40 | C:\Users\WDAGUtilityAccount\Desktop\WindowsSandbox-ConfigsAndScripts\SandboxStartups\Downloads.wsb.cmd 41 | 42 | 43 | ``` 44 | In this case, there are two HostFolder tags: 45 | 1. `C:\Users\%username%\WindowsSandbox-ConfigsAndScripts` 46 | Specifies the repository folder on the host machine to share into the sandbox. In this case, we specify our 47 | repository folder with the necessary scripts to run it in the `` tag. The folder must already exist on the host, 48 | or the container will fail to start. 49 | `C:\Users\WDAGUtilityAccount\Desktop\WindowsSandbox-ConfigsAndScripts` 50 | Specifies the destination in the sandbox to map the folder to. If the folder doesn't exist, it will be created. 51 | 2. `C:\Users\%username%\Downloads` shows an example of sharing a user folder, such as Downloads, 52 | in a sandbox. If the `` tag is not specified, the folder will be created on the desktop. 53 | 54 | `true` 55 | If true, the shared folder is read-only accessible from the container. The default value is false. 56 | 57 | `C:\Users\WDAGUtilityAccount\Desktop\Scripts\SandboxStartups\Downloads.wsb.cmd` 58 | Specifies a single command that will be invoked automatically after the sandbox logs on. 59 | Make sure, your repository folder must be shared into to the sandbox, to run the script in the tag above. Otherwise a running *.wsb file 60 | will cause a crash. 61 | 62 | Any tag has path, which depends on your computer's username and file structure, and it needs to be changed by your requirements. 63 | 64 | ## Ready-to-use configuration files and their description 65 | [DevEnv.wsb](https://github.com/flexxxxer/WindowsSandbox-ConfigsAndScripts/blob/master/DevEnv.wsb): changes the 66 | appearance of the system by applying a Dark Mode, enabling dev mode in system, showing file extensions and hidden 67 | files and folders in explorer, installing .NET (6, 7, Legacy Framework from 4.6.2 up to 4.8.1), latest PowerShell, 68 | C++ Redistributable packages from 2008 up to latest (2022), Firefox and Visual Studio Code. 69 | 70 | [DevEnvHighContrast.wsb](https://github.com/flexxxxer/WindowsSandbox-ConfigsAndScripts/blob/master/DevEnvHighContrast.wsb): 71 | like previous one, but instead of applying a Dark Mode, this applying a high contrast. 72 | 73 | [Downloads.wsb](https://github.com/flexxxxer/WindowsSandbox-ConfigsAndScripts/blob/master/Downloads.wsb): 74 | enabling dev mode in system, showing file extensions and hidden 75 | files and folders in explorer, opens explorer window at mapped from host downloads folder. 76 | 77 | [DownloadsDark.wsb](https://github.com/flexxxxer/WindowsSandbox-ConfigsAndScripts/blob/master/DownloadsDark.wsb): changes the 78 | like previous one, but in a Dark Mode. 79 | 80 | [DownloadsHighContrast.wsb](https://github.com/flexxxxer/WindowsSandbox-ConfigsAndScripts/blob/master/DownloadsHighContrast.wsb): changes the 81 | like previous one, but instead of applying a Dark Mode, this applying a high contrast. 82 | 83 | ## How its working 84 | Each `ConfigurationName.wsb` has a `ConfigurationName.wsb.cmd` and a `ConfigurationName.wsb.ps1`. Using `` 85 | `ConfigurationName.wsb` runs the `ConfigurationName.wsb.cmd` script in `Windows Sandbox`. Further, 86 | `ConfigurationName.wsb.cmd` allows the execution of any PowerShell scripts in the system (by default this is 87 | disabled for security reasons, but we are in a virtual sandbox), after which it launches `ConfigurationName.wsb.ps1`, 88 | which launches scripts that execute other scripts that automate routine (installing software and libraries, 89 | configuring, changing the appearance, etc). 90 | 91 | # FAQ 92 | Q: When i launching some `.wsb` configuration, then i have error "The configuration file was invalid" with 93 | "The system cannot find the path specified". 94 | 95 | A: Check all `` paths for validity and change change if path is invalid. 96 | 97 | Q: When i launching some `.wsb` configuration, then i have error "only one running instance of windows sandbox is allowed...". 98 | 99 | A: Kill stucked `Windows Sandbox` process in Task Manager. (Hotkey: Ctrl+Shift+ESC) 100 | 101 | Q: Downloading and installing software in Windows Sandbox is too long. How can i fix it? 102 | 103 | A: Run `UpdateCachedExes.ps1` (which in root of repo) before running Windows Sandbox. This script simply 104 | downloads the .exe/.msi/etc application installer files to the CachedExes folder, which is located in the folder 105 | next to UpdateCachedExes.ps1. **It is enough to run this script once, it does not need to be run every time before 106 | starting Windows Sandbox**. 107 | 108 | Q: When i using VPN at host, internet in Windows Sandbox not working. How to fix that? 109 | 110 | A: No way to fix that. Need to wait for a fix from microsoft. 111 | 112 | # License 113 | WindowsSandbox-ConfigsAndScripts is Copyright © 2023 flexxxxer Aleksandr under the [Apache License, Version 2.0](https://github.com/flexxxxer/WindowsSandbox-ConfigsAndScripts/blob/master/LICENSE.txt). 114 | -------------------------------------------------------------------------------- /SandboxStartups/DevEnv.wsb.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | start /wait "" %~dp0\..\Scripts\Exec-Policy-Fix.cmd 4 | start /wait "" powershell.exe -File %~dp0\..\SandboxStartups\DevEnv.wsb.ps1 5 | 6 | exit -------------------------------------------------------------------------------- /SandboxStartups/DevEnv.wsb.ps1: -------------------------------------------------------------------------------- 1 | "Making new directory: C:\users\WDAGUtilityAccount\Desktop\Exes\" | Write-Output 2 | New-Item -Path "C:\users\WDAGUtilityAccount\Desktop\" ` 3 | -Name "Exes" ` 4 | -ItemType "directory" -Force | Out-Null 5 | 6 | & $PSScriptRoot\..\Scripts\DarkMode.ps1 | Write-Output 7 | 8 | & $PSScriptRoot\..\Scripts\EnableDevModeSetupExplorer.ps1 | Write-Output 9 | & $PSScriptRoot\..\Scripts\InstallSoftware\PowerShell.Install.ps1 | Write-Output 10 | $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" ` 11 | + [System.Environment]::GetEnvironmentVariable("Path","User") 12 | & pwsh.exe -File $PSScriptRoot\..\Scripts\InstallSoftware\CppRedists.Install.ps1 | Write-Output 13 | & pwsh.exe -File $PSScriptRoot\..\Scripts\InstallSoftware\DotNetSdk.Install.ps1 -GetLegacyFramework:True | Write-Output 14 | & pwsh.exe -File $PSScriptRoot\..\Scripts\InstallSoftware\Firefox.Install.ps1 True | Write-Output 15 | & pwsh.exe -File $PSScriptRoot\..\Scripts\InstallSoftware\VSCode.Install.ps1 True | Write-Output 16 | 17 | "Done." | Write-Output 18 | Start-Sleep -Seconds 5 -------------------------------------------------------------------------------- /SandboxStartups/DevEnvHighContrast.wsb.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | start /wait "" %~dp0\..\Scripts\Exec-Policy-Fix.cmd 4 | start /wait "" powershell.exe -File %~dp0\..\SandboxStartups\DevEnvHighContrast.wsb.ps1 5 | 6 | exit -------------------------------------------------------------------------------- /SandboxStartups/DevEnvHighContrast.wsb.ps1: -------------------------------------------------------------------------------- 1 | "Making new directory: C:\users\WDAGUtilityAccount\Desktop\Exes\" | Write-Output 2 | New-Item -Path "C:\users\WDAGUtilityAccount\Desktop\" ` 3 | -Name "Exes" ` 4 | -ItemType "directory" -Force | Out-Null 5 | 6 | & $PSScriptRoot\..\Scripts\HighContrast.ps1 | Write-Output 7 | 8 | & $PSScriptRoot\..\Scripts\EnableDevModeSetupExplorer.ps1 | Write-Output 9 | & $PSScriptRoot\..\Scripts\InstallSoftware\PowerShell.Install.ps1 | Write-Output 10 | $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" ` 11 | + [System.Environment]::GetEnvironmentVariable("Path","User") 12 | & pwsh.exe -File $PSScriptRoot\..\Scripts\InstallSoftware\CppRedists.Install.ps1 | Write-Output 13 | & pwsh.exe -File $PSScriptRoot\..\Scripts\InstallSoftware\DotNetSdk.Install.ps1 -GetLegacyFramework:True | Write-Output 14 | & pwsh.exe -File $PSScriptRoot\..\Scripts\InstallSoftware\Firefox.Install.ps1 True | Write-Output 15 | & pwsh.exe -File $PSScriptRoot\..\Scripts\InstallSoftware\VSCode.Install.ps1 True | Write-Output 16 | 17 | "Done." | Write-Output 18 | Start-Sleep -Seconds 5 -------------------------------------------------------------------------------- /SandboxStartups/Downloads.wsb.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | start /wait "" %~dp0\..\Scripts\Exec-Policy-Fix.cmd 4 | start /wait "" powershell.exe -File %~dp0\..\SandboxStartups\Downloads.wsb.ps1 5 | 6 | exit -------------------------------------------------------------------------------- /SandboxStartups/Downloads.wsb.ps1: -------------------------------------------------------------------------------- 1 | & $PSScriptRoot\..\Scripts\EnableDevModeSetupExplorer.ps1 | Write-Output 2 | 3 | Start-Process explorer.exe C:\users\WDAGUtilityAccount\Downloads | Out-Null -------------------------------------------------------------------------------- /SandboxStartups/DownloadsDark.wsb.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | start /wait "" %~dp0\..\Scripts\Exec-Policy-Fix.cmd 4 | start /wait "" powershell.exe -File %~dp0\..\SandboxStartups\DownloadsDark.wsb.ps1 5 | 6 | exit -------------------------------------------------------------------------------- /SandboxStartups/DownloadsDark.wsb.ps1: -------------------------------------------------------------------------------- 1 | & $PSScriptRoot\..\Scripts\DarkMode.ps1 | Write-Output 2 | & $PSScriptRoot\..\Scripts\EnableDevModeSetupExplorer.ps1 | Write-Output 3 | 4 | Start-Process explorer.exe C:\users\WDAGUtilityAccount\Downloads | Out-Null -------------------------------------------------------------------------------- /SandboxStartups/DownloadsHighContrast.wsb.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | start /wait "" %~dp0\..\Scripts\Exec-Policy-Fix.cmd 4 | start /wait "" powershell.exe -File %~dp0\..\SandboxStartups\DownloadsHighContrast.wsb.ps1 5 | 6 | exit -------------------------------------------------------------------------------- /SandboxStartups/DownloadsHighContrast.wsb.ps1: -------------------------------------------------------------------------------- 1 | & $PSScriptRoot\..\Scripts\HighContrast.ps1 | Write-Output 2 | & $PSScriptRoot\..\Scripts\EnableDevModeSetupExplorer.ps1 | Write-Output 3 | 4 | Start-Process explorer.exe C:\users\WDAGUtilityAccount\Downloads | Out-Null -------------------------------------------------------------------------------- /Scripts/DarkMode.ps1: -------------------------------------------------------------------------------- 1 | $ThemeFolder="HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" 2 | $DesktopFolder="HKCU:\Control Panel\Desktop" 3 | 4 | "Dark Mode applying: step 1" | Write-Output 5 | # hack 1 6 | Set-ItemProperty -Path $ThemeFolder -Name "SystemUsesLightTheme" -Value 0 7 | Set-ItemProperty -Path $ThemeFolder -Name "AppsUseLightTheme" -Value 0 8 | 9 | "Dark Mode applying: step 2" | Write-Output 10 | # hack 2 11 | Set-ItemProperty -Path $DesktopFolder -Name "Wallpaper" -Value "" 12 | Set-ItemProperty -Path $DesktopFolder -Name "Wallpaper" -Value "C:\Windows\web\wallpaper\Windows\img19.jpg" 13 | 14 | 1..5 | ForEach-Object { 15 | "Dark Mode applying: some hacking things" | Write-Output 16 | 1..5 | ForEach-Object { 17 | RUNDLL32.EXE USER32.DLL, UpdatePerUserSystemParameters 1, True 18 | } 19 | 20 | "Dark Mode applying: explorer.exe kill and start" | Write-Output 21 | taskkill /im explorer.exe /f | Out-Null 22 | Start-Process explorer.exe | Out-Null 23 | Start-Sleep -m 500 24 | } 25 | 26 | exit -------------------------------------------------------------------------------- /Scripts/DownloadSoftware/CppRedists.Get.ps1: -------------------------------------------------------------------------------- 1 | param([String] $OutFolder) 2 | 3 | if ($OutFolder.Length -eq 0 -or -not (Test-Path -Path $OutFolder)) { 4 | $OutFolder = "$PSScriptRoot\..\..\CachedExes\" 5 | } 6 | 7 | $cppRedistsAndLinks = @{ 8 | # 2015, 2017, 2019, 2022 9 | "vc_redist.17.x64.exe" = "https://aka.ms/vs/17/release/vc_redist.x64.exe"; 10 | "vc_redist.17.x86.exe" = "https://aka.ms/vs/17/release/vc_redist.x86.exe"; 11 | # 2013 12 | "vc_redist.13.x64.exe" = "https://aka.ms/highdpimfc2013x64enu"; 13 | "vc_redist.13.x86.exe" = "https://aka.ms/highdpimfc2013x86enu"; 14 | # 2012 15 | "vc_redist.12.x64.exe" = "https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe"; 16 | "vc_redist.12.x86.exe" = "https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x86.exe"; 17 | # 2010 18 | "vc_redist.10.x64.exe" = "https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe"; 19 | "vc_redist.10.x86.exe" = "https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe"; 20 | # 2008 21 | "vc_redist.8.x64.exe" = "https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x64.exe"; 22 | "vc_redist.8.x86.exe" = "https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe"; 23 | } 24 | 25 | $ProgressPreference = 'SilentlyContinue' 26 | $cppRedistsAndLinks.GetEnumerator() | ForEach-Object { 27 | $fileToSave = "$OutFolder" + $_.Key 28 | $linkToDownload = $_.Value 29 | 30 | "Fetching CppRedist: " + $_.Key | Write-Output 31 | Invoke-RestMethod -Uri $linkToDownload -OutFile $fileToSave 32 | } 33 | 34 | exit -------------------------------------------------------------------------------- /Scripts/DownloadSoftware/DotNetSdk.Get.ps1: -------------------------------------------------------------------------------- 1 | param([String] $OutFolder, [Boolean] $GetLegacyFramework = $false) 2 | 3 | if ($OutFolder.Length -eq 0 -or -not (Test-Path -Path $OutFolder)) { 4 | $OutFolder = "$PSScriptRoot\..\..\CachedExes\" 5 | } 6 | 7 | $dotnetSdkAndLinks = @{ 8 | "dotnet-sdk-7.0.exe" = "https://download.visualstudio.microsoft.com/download/pr/35660869-0942-4c5d-8692-6e0d4040137a/4921a36b578d8358dac4c27598519832/dotnet-sdk-7.0.101-win-x64.exe"; 9 | "dotnet-sdk-6.0.exe" = "https://download.visualstudio.microsoft.com/download/pr/0a672516-37fb-40de-8bef-725975e0b137/a632cde8d629f9ba9c12196f7e7660db/dotnet-sdk-6.0.404-win-x64.exe"; 10 | } 11 | 12 | $legacyFrameworkSdkAndLinks = @{ 13 | "net481-developer-pack.exe" = "https://go.microsoft.com/fwlink/?linkid=2203306"; 14 | "net48-developer-pack.exe" = "https://go.microsoft.com/fwlink/?linkid=2088517"; 15 | "net472-developer-pack.exe" = "https://go.microsoft.com/fwlink/?linkid=874338"; 16 | "net471-developer-pack.exe" = "https://go.microsoft.com/fwlink/?linkid=2099382"; 17 | "net47-developer-pack.exe" = "https://go.microsoft.com/fwlink/?linkid=2099465"; 18 | "net462-developer-pack.exe" = "https://go.microsoft.com/fwlink/?linkid=2099466"; 19 | } 20 | 21 | if ($GetLegacyFramework) { 22 | $dotnetSdkAndLinks += $legacyFrameworkSdkAndLinks 23 | } 24 | 25 | $ProgressPreference = 'SilentlyContinue' 26 | $dotnetSdkAndLinks.GetEnumerator() | ForEach-Object { 27 | $fileToSave = "$OutFolder" + $_.Key 28 | $linkToDownload = $_.Value 29 | "Fetching .NET SDK: " + $_.Key | Write-Output 30 | Invoke-RestMethod -Uri $linkToDownload -OutFile $fileToSave 31 | } 32 | 33 | exit -------------------------------------------------------------------------------- /Scripts/DownloadSoftware/Firefox.Get.ps1: -------------------------------------------------------------------------------- 1 | param([String] $OutFolder) 2 | 3 | if ($OutFolder.Length -eq 0 -or -not (Test-Path -Path $OutFolder)) { 4 | $OutFolder = "$PSScriptRoot\..\..\CachedExes\" 5 | } 6 | 7 | $linkToDownload = "https://download.mozilla.org/?product=firefox-stub&os=win&lang=en-US" 8 | $fileToSave = "firefox.exe" 9 | $ProgressPreference = 'SilentlyContinue' 10 | 11 | "Fetching Firefox..." | Write-Output 12 | Invoke-RestMethod -Uri $linkToDownload -OutFile ($OutFolder + $fileToSave) -------------------------------------------------------------------------------- /Scripts/DownloadSoftware/PowerShell.Get.ps1: -------------------------------------------------------------------------------- 1 | param([String] $OutFolder) 2 | 3 | if ($OutFolder.Length -eq 0 -or -not (Test-Path -Path $OutFolder)) { 4 | $OutFolder = "$PSScriptRoot\..\..\CachedExes\" 5 | } 6 | 7 | $linkToDownload = "https://github.com/PowerShell/PowerShell/releases/download/v7.3.2/PowerShell-7.3.2-win-x64.msi" 8 | $fileToSave = "powershell-7.3.2.msi" 9 | $ProgressPreference = 'SilentlyContinue' 10 | "Fetching PowerShell..." | Write-Output 11 | Invoke-RestMethod -Uri $linkToDownload -OutFile ($OutFolder + $fileToSave) -------------------------------------------------------------------------------- /Scripts/DownloadSoftware/VSCode.Get.ps1: -------------------------------------------------------------------------------- 1 | param([String] $OutFolder) 2 | 3 | if ($OutFolder.Length -eq 0 -or -not (Test-Path -Path $OutFolder)) { 4 | $OutFolder = "$PSScriptRoot\..\..\CachedExes\" 5 | } 6 | 7 | $linkToDownload = "https://update.code.visualstudio.com/latest/win32-x64-user/stable" 8 | $fileToSave = "vscode.exe" 9 | $ProgressPreference = 'SilentlyContinue' 10 | 11 | "Fetching Visual Studio Code..." | Write-Output 12 | Invoke-RestMethod -Uri $linkToDownload -OutFile ($OutFolder + $fileToSave) -------------------------------------------------------------------------------- /Scripts/EnableDevModeSetupExplorer.ps1: -------------------------------------------------------------------------------- 1 |  2 | "Enabling Developer Mode..." | Write-Output 3 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" ` 4 | -Name "AllowDevelopmentWithoutDevLicense" -Value 1 5 | 6 | "Enabling Showing file extensions..." | Write-Output 7 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" ` 8 | -Name "HideFileExt" -Value 0 9 | 10 | "Enabling Showing hidden files..." | Write-Output 11 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" ` 12 | -Name "Hidden" -Value 1 -------------------------------------------------------------------------------- /Scripts/Exec-Policy-Fix.cmd: -------------------------------------------------------------------------------- 1 | powershell.exe "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser" 2 | 3 | exit -------------------------------------------------------------------------------- /Scripts/HighContrast.ps1: -------------------------------------------------------------------------------- 1 | "High Contrast applying..." | Write-Output 2 | 3 | # there are hc1.theme, hc2.theme, hcblack.theme and hcwhite.theme 4 | Invoke-Item "C:\Windows\Resources\Ease of Access Themes\hcblack.theme" | Out-Null 5 | 6 | Start-Sleep -Seconds 4 7 | taskkill /im SystemSettings.exe /f | Out-Null 8 | 9 | exit -------------------------------------------------------------------------------- /Scripts/InstallSoftware/CppRedists.Install.ps1: -------------------------------------------------------------------------------- 1 | $FolderWithExes = "$PSScriptRoot\..\..\CachedExes\" 2 | 3 | $cppRedists = ` 4 | "vc_redist.17.x64.exe", ` 5 | "vc_redist.17.x86.exe", ` 6 | "vc_redist.13.x64.exe", ` 7 | "vc_redist.13.x86.exe", ` 8 | "vc_redist.12.x64.exe", ` 9 | "vc_redist.12.x86.exe", ` 10 | "vc_redist.10.x64.exe", ` 11 | "vc_redist.10.x86.exe", ` 12 | "vc_redist.8.x64.exe", ` 13 | "vc_redist.8.x86.exe" 14 | 15 | $cppRedists | ForEach-Object { 16 | if (-not (Test-Path -Path ($FolderWithExes + $_) -PathType Leaf)) { 17 | $FolderWithExes = "$PSScriptRoot\..\..\..\Exes\" 18 | & $PSScriptRoot\..\..\Scripts\DownloadSoftware\CppRedists.Get.ps1 $FolderWithExes | Write-Output 19 | } 20 | 21 | "Installing CppRedist: " + $_ | Write-Output 22 | & ($FolderWithExes + $_) /install /quiet /norestart | Out-Null 23 | } 24 | 25 | exit -------------------------------------------------------------------------------- /Scripts/InstallSoftware/DotNetSdk.Install.ps1: -------------------------------------------------------------------------------- 1 | param([Boolean] $GetLegacyFramework = $false) 2 | 3 | $FolderWithExes = "$PSScriptRoot\..\..\CachedExes\" 4 | 5 | $dotnetSdkAndLinks = ` 6 | "dotnet-sdk-7.0.exe", ` 7 | "dotnet-sdk-6.0.exe" 8 | 9 | $legacyFrameworkSdkAndLinks = ` 10 | "net481-developer-pack.exe", ` 11 | "net48-developer-pack.exe", ` 12 | "net472-developer-pack.exe", ` 13 | "net471-developer-pack.exe", ` 14 | "net47-developer-pack.exe", ` 15 | "net462-developer-pack.exe" 16 | 17 | if ($GetLegacyFramework){ 18 | $dotnetSdkAndLinks += $legacyFrameworkSdkAndLinks 19 | } 20 | 21 | $dotnetSdkAndLinks | ForEach-Object { 22 | if (-not (Test-Path -Path ($FolderWithExes + $_) -PathType Leaf)) { 23 | $FolderWithExes = "$PSScriptRoot\..\..\..\Exes\" 24 | & $PSScriptRoot\..\..\Scripts\DownloadSoftware\DotNetSdk.Get.ps1 $FolderWithExes $GetLegacyFramework | Write-Output 25 | } 26 | 27 | "Installing .NET SDK: " + $_ | Write-Output 28 | & ($FolderWithExes + $_) /install /quiet /norestart | Out-Null 29 | } 30 | 31 | exit -------------------------------------------------------------------------------- /Scripts/InstallSoftware/Firefox.Install.ps1: -------------------------------------------------------------------------------- 1 | $FolderWithExes = (Get-Item $PSScriptRoot).Parent.Parent.FullName + "\CachedExes\" 2 | $fileToExecute = "firefox.exe" 3 | 4 | if (-not (Test-Path -Path ($FolderWithExes + $fileToExecute) -PathType Leaf)) { 5 | $FolderWithExes = (Get-Item $PSScriptRoot).Parent.Parent.Parent.FullName + "\Exes\" 6 | & $PSScriptRoot\..\..\Scripts\DownloadSoftware\Firefox.Get.ps1 $FolderWithExes | Write-Output 7 | } 8 | 9 | "Installing Firefox: $fileToExecute" | Write-Output 10 | & ($FolderWithExes + $fileToExecute) | Out-Null 11 | Start-Sleep -Seconds 4 12 | taskkill /im firefox.exe /f | Out-Null -------------------------------------------------------------------------------- /Scripts/InstallSoftware/PowerShell.Install.ps1: -------------------------------------------------------------------------------- 1 | $FolderWithExes = (Get-Item $PSScriptRoot).Parent.Parent.FullName + "\CachedExes\" 2 | $fileToExecute = "powershell-7.3.2.msi" 3 | 4 | if (-not (Test-Path -Path ($FolderWithExes + $fileToExecute) -PathType Leaf)) { 5 | $FolderWithExes = (Get-Item $PSScriptRoot).Parent.Parent.Parent.FullName + "\Exes\" 6 | & $PSScriptRoot\..\..\Scripts\DownloadSoftware\PowerShell.Get.ps1 $FolderWithExes | Write-Output 7 | } 8 | 9 | "Installing PowerShell: $fileToExecute" | Write-Output 10 | msiexec /i ($FolderWithExes + $fileToExecute) /quiet /qn /norestart | Out-Null 11 | -------------------------------------------------------------------------------- /Scripts/InstallSoftware/VSCode.Install.ps1: -------------------------------------------------------------------------------- 1 | $FolderWithExes = (Get-Item $PSScriptRoot).Parent.Parent.FullName + "\CachedExes\" 2 | $fileToExecute = "vscode.exe" 3 | 4 | if (-not (Test-Path -Path ($FolderWithExes + $fileToExecute) -PathType Leaf)) { 5 | $FolderWithExes = (Get-Item $PSScriptRoot).Parent.Parent.Parent.FullName + "\Exes\" 6 | & $PSScriptRoot\..\..\Scripts\DownloadSoftware\VSCode.Get.ps1 $FolderWithExes | Write-Output 7 | } 8 | 9 | "Installing Visual Studio Code: $fileToExecute" | Write-Output 10 | & $FolderWithExes$fileToExecute /verysilent /suppressmsgboxes | Out-Null 11 | -------------------------------------------------------------------------------- /UpdateCachedExes.ps1: -------------------------------------------------------------------------------- 1 | New-Item -ItemType Directory -Force -Path $PSScriptRoot\CachedExes\ | Out-Null 2 | 3 | Get-ChildItem -Path $PSScriptRoot\CachedExes\ -Include *.* -File -Recurse | ForEach-Object { $_.Delete()} 4 | 5 | & pwsh.exe -File $PSScriptRoot\Scripts\DownloadSoftware\CppRedists.Get.ps1 | Write-Output 6 | & pwsh.exe -File $PSScriptRoot\Scripts\DownloadSoftware\PowerShell.Get.ps1 | Write-Output 7 | & pwsh.exe -File $PSScriptRoot\Scripts\DownloadSoftware\DotNetSdk.Get.ps1 -GetLegacyFramework:True | Write-Output 8 | & pwsh.exe -File $PSScriptRoot\Scripts\DownloadSoftware\Firefox.Get.ps1 | Write-Output 9 | & pwsh.exe -File $PSScriptRoot\Scripts\DownloadSoftware\VSCode.Get.ps1 | Write-Output 10 | 11 | "Done." | Write-Output 12 | Start-Sleep -Seconds 5 --------------------------------------------------------------------------------