-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinit-windows.bat
executable file
·23 lines (17 loc) · 1.12 KB
/
init-windows.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
:: 2>/dev/null || echo '
::::::::::::::::::::::::::: Windows
cd c:\vagrant
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
echo "Installing Visual Studio. This takes a while..."
powershell -command "& { iwr http://download.microsoft.com/download/D/2/3/D23F4D0F-BA2D-4600-8725-6CCECEA05196/vs_community_ENU.exe -OutFile c:\tmp\vs.exe }"
c:\tmp\vs.exe /InstallSelectableItems /Passive
echo "Installing NuGet"
powershell -command "& { iwr https://dist.nuget.org/win-x86-commandline/v3.4.4/NuGet.exe -OutFile c:\tmp\nuget.exe }"
c:\tmp\nuget.exe restore
exit /b %ERRORLEVEL%
' >/dev/null
########################### Others
#! /bin/sh
set -eu
nix-shell -I channel:nixos-18.09 -p bash netcat vagrant curl --run "(vagrant up windows --no-provision && nc -z -w1 127.0.0.1 55985) || (echo Execute contents of init-WinRM.bat as Administrator, install Guest Additions, reboot, 'vagrant reload windows'. Then re-execute ./init-windows.bat && false)"
nix-shell -I channel:nixos-18.09 -p vagrant --run "vagrant provision windows --provision-with init"