Skip to content

Instantly share code, notes, and snippets.

@thephilip
Last active January 16, 2020 20:01
Show Gist options
  • Save thephilip/116025ffadbf3a40b462c4ee8b0ba043 to your computer and use it in GitHub Desktop.
Save thephilip/116025ffadbf3a40b462c4ee8b0ba043 to your computer and use it in GitHub Desktop.
:: development environment build script
:: by: Philip Smith
@echo off
color 0b
title Developer Environment Configurator
echo.
cls
:: require administrator privileges
echo Checking permissions...
goto :CHECKPERMS
:MOTD
echo ******************************************************
echo * Lazy Philip Script - install all the things *
echo ******************************************************
echo.
echo This script will install a bunch of shit initially
echo (Chocolatey Package Manager, Visual C++ Runtimes,
echo your mom, RSAT, git, curl, winscp and openssh).
echo Review the guts of the script to make sure you are
echo okay with this before proceeding. You will be asked
echo which option applications you would like to install
echo after confirming this message.
echo.
echo Press Ctrl+c to flake out.
pause
echo.
echo.
echo.
echo You may optionally skip prerequisite installation here. Use this
echo if you have already run this script and want to install or re-
echo install the optional applications.
set /p skip=Skip prerequisite installation (y/n)?
:: optional installer questionaire
set /p bitvise=Install Bitvise SSH/SCP GUI (y/n)?
set /p github=Install Github GUI (y/n)?
set /p hyper=Install Hyper.io Terminal Replacement (y/n)?
set /p vbox=Install VirtualBox (y/n)?
set /p docker=Install Docker Desktop (y/n)?
set /p aws=Install AWS CLI tools (y/n)?
set /p wireshark=Install Wireshark (y/n)?
set /p cpuz=Install CPU-Z (y/n)?
set /p perf=Install PerfView (y/n)?
set /p nxlog=Install NXLog CE (y/n)?
set /p flux=Install f.lux (y/n)?
set /p vlc=Install VLC Media Player (y/n)?
set /p foxit=Install Foxit PDF reader (y/n)?
set /p cutepdf=Install CutePDF Writer (y/n)?
set /p chrome=Install Google Chrome Browser (y/n)?
set /p firefox=Install Firefox Browser (y/n)?
set /p heidi=Install HeidiSQL (y/n)?
set /p nodejs=Install Node.js language (y/n)?
set /p elixir=Install Elixir language (y/n)?
set /p npp=Install Notepad++ (y/n)?
set /p atom=Install Atom IDE (y/n)?
set /p vscode=Install Visual Studio Code (Insiders Edition) IDE (y/n)?
set /p gimp=Install GIMP (y/n)?
set /p inkscape=Install Inkscape (y/n)?
echo.
:: enable features
set /p tclient=Enable the Telnet Client (y/n)?
if %skip% == y goto :SKIP
if %skip% == Y goto :SKIP
:: install prerequisits
echo Installing package manager...
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
echo Installing libraries and tools...
choco install -y --force vcredist-all
choco install -y --force RSAT
choco install -y --force sysinternals
choco install -y --force git
choco install -y --force curl
choco install -y --force wget
choco install -y --force winscp
choco install -y --force openssh
choco install -y --force 7zip.install
choco install -y --force neovim
:SKIP
:: update package management
echo Checking for updates...
choco upgrade chocolatey
:: optional applications
if %github% == y choco install -y --force GitHub
if %github% == Y choco install -y --force GitHub
if %bitvise% == y choco install -y --force bitvise-ssh-client
if %bitvise% == Y choco install -y --force bitvise-ssh-client
if %hyper% == y choco install -y --force hyper
if %hyper% == Y choco install -y --force hyper
if %vbox% == y choco install -y --force virtualbox
if %vbox% == Y choco install -y --force virtualbox
if %docker% == y choco install -y --force docker-desktop
if %docker% == Y choco install -y --force docker-desktop
if %aws% == y choco install -y --force awscli
if %aws% == Y choco install -y --force awscli
if %wireshark% == y choco install -y --force wireshark
if %wireshark% == Y choco install -y --force wireshark
if %cpuz% == y choco install -y --force cpu-z
if %cpuz% == Y choco install -y --force cpu-z
if %perf% == y choco install -y --force perfview
if %perf% == Y choco install -y --force perfview
if %nxlog% == y choco install -y --force nxlog
if %nxlog% == Y choco install -y --force nxlog
if %flux% == y choco install -y --force f.lux
if %flux% == Y choco install -y --force f.lux
if %vlc% == y choco install -y --force vlc
if %vlc% == Y choco install -y --force vlc
if %foxit% == y choco install -y --force foxitreader
if %foxit% == Y choco install -y --force foxitreader
if %cutepdf% == y choco install -y --force cutepdf
if %cutepdf% == Y choco install -y --force cutepdf
if %chrome% == y choco install -y --force googlechrome
if %chrome% == Y choco install -y --force googlechrome
if %firefox% == y choco install -y --force firefox
if %firefox% == Y choco install -y --force firefox
if %heidi% == y choco install -y --force heidisql
if %heidi% == Y choco install -y --force heidisql
if %nodejs% == y (
choco install -y --force nvm.portable
nvm install latest
nvm use latest
nvm ls
)
if %nodejs% == Y (
choco install -y --force nvm.portable
nvm install latest
nvm use latest
nvm ls
)
if %elixir% == y (
echo Installing erlang and elixir languages...
choco install -y --force elixir
echo Installing elixir atom IDE plugins...
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "apm i atom-elixir language-elixir linter-elixir-credo phoenix-elixir-snippets"
)
if %elixir% == Y (
echo Installing erlang and elixir languages...
choco install -y --force elixir
echo Installing elixir atom IDE plugins...
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "apm i atom-elixir language-elixir linter-elixir-credo phoenix-elixir-snippets"
)
if %npp% == y choco install -y --force notepadplusplus.install
if %npp% == Y choco install -y --force notepadplusplus.install
if %atom% == y (
choco install -y --force atom
echo Installing Atom IDE themes and useful plugins...
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "apm i atom-quokka autoclose-html emmet-jsx-css-modules file-icons git-plus"
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "apm i git-time-machine highlight-selected indent-guide-improved"
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "apm i language-javascript-jsx language-powershell"
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "apm i react split-diff teletype seti-syntax vertex-ui"
)
if %atom% == Y (
choco install -y --force atom
echo Installing Atom IDE themes and useful plugins...
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "apm i atom-quokka autoclose-html emmet-jsx-css-modules file-icons git-plus"
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "apm i git-time-machine highlight-selected indent-guide-improved"
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "apm i language-javascript-jsx language-powershell"
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "apm i react split-diff teletype seti-syntax vertex-ui"
)
if %vscode% == y choco install -y --force vscode-insiders
if %vscode% == Y choco install -y --force vscode-insiders
if %gimp% == y choco install -y --force gimp
if %gimp% == Y choco install -y --force gimp
if %inkscape% == y choco install -y --force inkscape
if %inkscape% == Y choco install -y --force inkscape
if %tclient% == y pkgmgr /iu:"TelnetClient"
if %tclient% == Y pkgmgr /iu:"TelnetClient"
goto :COMPLETE
:CHECKPERMS
net session >nul 2>&1
if %errorLevel% == 0 (
echo Permission check failure...
goto :MOTD
) else (
cls
color 47
goto :PERMFAIL
)
:ERROR
title Developer Environment Configurator
echo An error has occurred. Script will now exit.
pause
goto :END
:PERMFAIL
title Developer Environment Configurator - Permissions Error
echo This script must be run as an administrator!
pause
goto :END
:COMPLETE
title Developer Environment Configurator
cls
echo Exiting...
mshta "javascript:var sh=new ActiveXObject('WScript.Shell'); sh.Popup('Installation complete!', 0, 'Developer Environment Configurator', 64 );close()"
ping -n 1 127.0.0.1 >nul 2>&1
:END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment