Skip to content

Instantly share code, notes, and snippets.

@wjrogers
Last active July 19, 2022 13:29
Show Gist options
  • Save wjrogers/1016065 to your computer and use it in GitHub Desktop.
Save wjrogers/1016065 to your computer and use it in GitHub Desktop.
Automated cygwin installation, with thanks to http://old.nabble.com/Re%3A-Customizable-cygwin-setup.exe-p25828300.html
@ECHO OFF
REM -- Automates cygwin installation
SETLOCAL
REM -- Change to the directory of the executing batch file
CD %~dp0
REM -- Configure our paths
SET SITE=http://mirrors.kernel.org/sourceware/cygwin/
SET LOCALDIR=%LOCALAPPDATA%/cygwin
SET ROOTDIR=C:/cygwin
REM -- These are the packages we will install (in addition to the default packages)
SET PACKAGES=mintty,wget,ctags,diffutils,git,git-completion,git-svn,mercurial
SET PACKAGES=%PACKAGES%,gcc-core,make,automake,autoconf,readline,libncursesw-devel,libiconv,zlib-devel,gettext
SET PACKAGES=%PACKAGES%,lua,python,ruby
SET PACKAGES=%PACKAGES%,vim
REM -- Do it!
ECHO *** INSTALLING PACKAGES
setup -q -D -L -d -g -o -s %SITE% -l "%LOCALDIR%" -R "%ROOTDIR%" -C Base -P %PACKAGES%
REM -- Show what we did
ECHO.
ECHO.
ECHO cygwin installation updated
ECHO - %PACKAGES%
ECHO.
ENDLOCAL
PAUSE
EXIT /B 0
@f3rdy
Copy link

f3rdy commented Mar 31, 2015

Is there any way to automatically install and run sshd?

@fpl9000
Copy link

fpl9000 commented Apr 4, 2015

After installing Cygwin, run these two commands:

ssh-host-config
net start sshd

The first command above requires human interaction to answer questions, so it's not 100% "automatic".

@Clicketyclick
Copy link

Nice and clean script. I'll suggest modifying the call for setup to:
setup-x86_64.exe --no-admin -q -D -L -d -g -o -s "%SITE%" -l "%LOCALDIR%" -R "%ROOTDIR%" -C Base -P %PACKAGES%
Windows 10 run mostly on 64 bit - and with --no-admin you avoid limitations on user rights

@mrdotkg
Copy link

mrdotkg commented Jun 20, 2018

how would one add a fish shell to it? by replacing mintty with fish?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment