Skip to content

Instantly share code, notes, and snippets.

@srz-zumix
Last active November 21, 2017 08:20
Show Gist options
  • Save srz-zumix/bfabcc905b96bc10cdefa40920a29a64 to your computer and use it in GitHub Desktop.
Save srz-zumix/bfabcc905b96bc10cdefa40920a29a64 to your computer and use it in GitHub Desktop.
Windows setup scripts
rem パッケージリスト : https://chocolatey.org/packages
rem 管理者権限があるかどうかチェック
whoami /PRIV | find "SeLoadDriverPrivilege" >NUL
if not errorlevel 1 goto start
rem ない場合は powershell 経由で自分自身を実行
powershell.exe -Command Start-Process "%~0" -Verb Runas
goto :EOF
:start
rem ここからバッチ本来の処理
rem chocolatey のインストール
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
rem ブラウザ/メーラー/入力
cinst -y googlechrome
cinst -y firefox
cinst -y thunderbird
rem cinst -y mozbackup
cinst -y googlejapaneseinput
rem エディタ
rem cinst -y sakuraeditor -version 2.2.0.1
rem プログラミング
cinst -y python3-x86_32 -ia "'/quiet InstallAllUsers=1 TargetDir=C:\Python3'"
rem cinst -y -o python3
cinst -y python2-x86_32 -ia "'/qn /norestart ALLUSERS=1 TARGETDIR=C:\Python27'"
cinst -y cppcheck
cinst -y doxygen.install
rem cinst -y javaruntime
cinst -y groovy
cinst -y golang
rem アセンブリ結合
cinst -y ilmerge
rem SCM
cinst -y -o git
cinst -y gitkraken
cinst -y sourcetree
cinst -y winmerge-jp
rem Util
cinst -y 7zip
rem cinst -y lhaplus
cinst -y teraterm
cinst -y crystaldiskinfo
cinst -y crystaldiskmark
rem cinst -y adobereader
cinst -y pandoc
cinst -y putty
rem 画像
cinst -y gimp
cinst -y graphviz
rem 共有
cinst -y slack
cinst -y skype
cinst -y dropbox
cinst -y googledrive
cinst -y tightvnc
pause
set PACKAGES=make,git,wget,chere,automake,zip,unzip,curl,openssh,dos2unix,asciidoc
set PACKAGES=%PACKAGES%,gcc,gcc-g++,clang,gdb
set PACKAGES=%PACKAGES%,python,python-setuptools,ruby,ruby-devel,perl
set SITE=http://ftp.iij.ad.jp/pub/cygwin/
if "%~1" == "x64" (
call :x64
) else (
call :x86
)
goto install
:x86
set SETUP=setup-x86
set ROOT=C:\cygwin
set LOCALPACKAGE=%~dp0\x86
goto :EOF
:x64
set SETUP=setup-x86_64
set ROOT=C:\cygwin64
set LOCALPACKAGE=%~dp0\x86_64
goto :EOF
:install
rem %SETUP% download
@powershell -NoProfile -ExecutionPolicy Bypass -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.cygwin.com/%SETUP%.exe', '%SETUP%.exe')"
%SETUP%.exe ^
--root %ROOT% ^
--site %SITE% ^
--local-package-dir %LOCALPACKAGE% ^
--packages %PACKAGES% ^
--quiet-mode
if errorlevel 1 pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment