Skip to content

Instantly share code, notes, and snippets.

@gitawego
Created April 26, 2017 08:28
Show Gist options
  • Select an option

  • Save gitawego/1d055fbc5fdcae876c1da83779b10d3a to your computer and use it in GitHub Desktop.

Select an option

Save gitawego/1d055fbc5fdcae876c1da83779b10d3a to your computer and use it in GitHub Desktop.
install cygwin without admin
@ECHO OFF
REM -- Automates cygwin installation
REM -- Based on: https://github.com/rtwolf/auto-cygwin-install
REM -- Based on: https://gist.github.com/wjrogers/1016065
SETLOCAL
REM -- Change to the directory of the executing batch file
CD %~dp0
REM -- Configure our paths
SET SITE=http://cygwin.mirrors.pair.com/
SET LOCALDIR=%userprofile%/Downloads
SET ROOTDIR=%localappdata%/cygwin
REM -- These are the packages we will install (in addition to the default packages)
SET PACKAGES=wget,ctags,diffutils,git,git-completion,curl,rsync,vim,openssl
REM -- These are necessary for apt-cyg install, do not change. Any duplicates will be ignored.
SET PACKAGES=%PACKAGES%,tar,gawk,bzip
ECHO setup shellopts
setx SHELLOPTS "braceexpand:emacs:hashall:histexpand:history:igncr:interactive-comments:monitor"
REM -- Do it!
ECHO *** INSTALLING DEFAULT PACKAGES
setup-x86_64 --no-admin --quiet-mode --no-desktop --download --local-install --no-verify -s %SITE% -l "%LOCALDIR%" -R "%ROOTDIR%"
ECHO.
ECHO.
ECHO *** INSTALLING CUSTOM PACKAGES
setup-x86_64 --no-admin -q -d -D -L -X -s %SITE% -l "%LOCALDIR%" -R "%ROOTDIR%" -P %PACKAGES%
REM -- Show what we did
ECHO.
ECHO.
ECHO cygwin installation updated
ECHO - %PACKAGES%
ECHO.
ECHO apt-cyg installing.
set PATH=%ROOTDIR%/bin;%PATH%
cp apt-cyg %ROOTDIR%/bin/
%ROOTDIR%/bin/bash.exe -c 'chmod +x /bin/apt-cyg'
ECHO apt-cyg installed if it says somin like "A /bin" and "A /bin/apt-cyg" and "Exported revision 18" or some other number.
ENDLOCAL
PAUSE
EXIT /B 0
@gitawego
Copy link
Author

setup-x86_64.exe must be at the same folder of the bat file

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