From 4ba283fbb4999fe9449cb6a744842aa96dca1b30 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Sun, 3 Mar 2019 20:30:42 +0200 Subject: [PATCH 01/52] Tiny installer: remove optional addons Addons and links to install them manually if required: - Parallel SSH: https://github.com/zhubanRuban/cygwin-extras#pssh-parallelssh - Parallel SCP: https://github.com/zhubanRuban/cygwin-extras#pscp-parallelscp - Custom bashrc functions: https://github.com/zhubanRuban/cygwin-extras#custom-bashrc - bash-funk: https://github.com/vegardit/bash-funk --- ConCygSys-installer.cmd | 90 +---------------------------------------- 1 file changed, 2 insertions(+), 88 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index 524ea67..6e3d58c 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=180629 +set CONCYGSYS_VERSION=190303b ::####################### begin SCRIPT SETTINGS #######################:: @@ -35,22 +35,9 @@ set INSTALL_ACL=no :: install apt-cyg command line package manager: https://github.com/transcode-open/apt-cyg set INSTALL_APT_CYG=yes -:: install bash-funk adaptive Bash prompt: https://github.com/vegardit/bash-funk -set INSTALL_BASH_FUNK=yes - -:: install parallel ssh tool: https://github.com/zhubanRuban/cygwin-extras#pssh-parallelssh -set INSTALL_PSSH=yes - -:: install parallel scp tool: https://github.com/zhubanRuban/cygwin-extras#pscp-parallelscp -set INSTALL_PSCP=yes - :: install SSH agent tweak https://github.com/zhubanRuban/cygwin-extras#ssh-agent-tweak set INSTALL_SSH_AGENT_TWEAK=yes -:: install custom bashrc rules for better experience https://github.com/zhubanRuban/cygwin-extras#custom-bashrc -:: if set to 'yes', will disable bash-funk adaptive Bash prompt (see INSTALL_BASH_FUNK) to prevent conflicts -set INSTALL_BASHRC_CUSTOMS=yes - :: install WSLbridge to allowing to access WSL via Mintty https://github.com/rprichard/wslbridge set INSTALL_WSLBRIDGE=yes @@ -216,18 +203,6 @@ if "%INSTALL_WSLBRIDGE%" == "yes" ( if "%INSTALL_APT_CYG%" == "yes" ( set CYGWIN_PACKAGES=wget,%CYGWIN_PACKAGES% ) -if "%INSTALL_BASHRC_CUSTOMS%" == "yes" ( - set INSTALL_BASH_FUNK=no -) -if "%INSTALL_BASH_FUNK%" == "yes" ( - set CYGWIN_PACKAGES=git,git-svn,subversion,%CYGWIN_PACKAGES% -) -if "%INSTALL_PSSH%" == "yes" ( - set CYGWIN_PACKAGES=wget,%CYGWIN_PACKAGES% -) -if "%INSTALL_PSCP%" == "yes" ( - set CYGWIN_PACKAGES=wget,%CYGWIN_PACKAGES% -) if "%INSTALL_SSH_AGENT_TWEAK%" == "yes" ( set CYGWIN_PACKAGES=openssh,%CYGWIN_PACKAGES% ) @@ -311,11 +286,7 @@ echo Generating one-file settings and updater file [%Concygsys_settings%]... echo set CYGWIN_PACKAGES= echo set INSTALL_ACL=%INSTALL_ACL% echo set INSTALL_APT_CYG=%INSTALL_APT_CYG% - echo set INSTALL_BASH_FUNK=%INSTALL_BASH_FUNK% - echo set INSTALL_PSSH=%INSTALL_PSSH% - echo set INSTALL_PSCP=%INSTALL_PSCP% echo set INSTALL_SSH_AGENT_TWEAK=%INSTALL_SSH_AGENT_TWEAK% - echo set INSTALL_BASHRC_CUSTOMS=%INSTALL_BASHRC_CUSTOMS% echo set INSTALL_CONEMU=%INSTALL_CONEMU% echo set PROXY_HOST=%PROXY_HOST% echo set PROXY_PORT=%PROXY_PORT% @@ -364,7 +335,7 @@ echo Generating one-file settings and updater file [%Concygsys_settings%]... echo echo. echo ^) ^>"%%DOWNLOADER%%" ^|^| goto :fail echo set INSTALLER=ConCygSys-installer.cmd - echo cscript //Nologo "%%DOWNLOADER%%" https://raw.githubusercontent.com/zhubanRuban/ConCygSys/master/%%INSTALLER%% "%%INSTALLER%%" ^|^| goto :fail + echo cscript //Nologo "%%DOWNLOADER%%" https://raw.githubusercontent.com/zhubanRuban/ConCygSys/beta/%%INSTALLER%% "%%INSTALLER%%" ^|^| goto :fail echo start "" "%%INSTALLER%%" ^|^| goto :fail echo exit 0 echo :fail @@ -527,63 +498,6 @@ echo Creating script to install required and additional software [%Post_install% ) else ( echo rm -f /usr/local/bin/apt-cyg ) - if "%INSTALL_PSSH%" == "yes" ( - echo echo - echo echo "Installing/updating parallel ssh tool..." - echo wget -nv --show-progress -O /usr/local/bin/pssh https://raw.githubusercontent.com/zhubanRuban/cygwin-extras/master/pssh - echo chmod +x /usr/local/bin/pssh - ) else ( - echo rm -f /usr/local/bin/pssh - ) - if "%INSTALL_PSCP%" == "yes" ( - echo echo - echo echo "Installing/updating parallel scp tool..." - echo wget -nv --show-progress -O /usr/local/bin/pscp https://raw.githubusercontent.com/zhubanRuban/cygwin-extras/master/pscp - echo chmod +x /usr/local/bin/pscp - ) else ( - echo rm -f /usr/local/bin/pscp - ) - if "%INSTALL_BASH_FUNK%" == "yes" ( - echo if [ ! -e "/opt/bash-funk/bash-funk.sh" ]; then - echo echo - echo echo Installing [bash-funk]... - echo if hash git ^&^>/dev/null; then - echo git clone https://github.com/vegardit/bash-funk --branch master --single-branch /opt/bash-funk - echo elif hash svn ^&^>/dev/null; then - echo svn checkout https://github.com/vegardit/bash-funk/trunk /opt/bash-funk - echo else - echo mkdir /opt/bash-funk ^&^& \ - echo cd /opt/bash-funk ^&^& \ - echo wget -qO- --show-progress https://github.com/vegardit/bash-funk/tarball/master ^| tar -xzv --strip-components 1 - echo fi - echo fi - echo echo Adding bash-funk to [$bashrc_f]... - echo if grep -q '/opt/bash-funk/bash-funk.sh' "$bashrc_f"; then - echo sed -i '/bash-funk.sh/c\if [ -f "/opt/bash-funk/bash-funk.sh" ]; then source "/opt/bash-funk/bash-funk.sh"; fi' "$bashrc_f" - echo else - echo echo 'if [ -f "/opt/bash-funk/bash-funk.sh" ]; then source "/opt/bash-funk/bash-funk.sh"; fi' ^>^> "$bashrc_f" - echo fi - ) else ( - echo sed -i '/bash-funk.sh/d' "$bashrc_f" - echo rm -rf /opt/bash-funk - ) - if "%INSTALL_BASHRC_CUSTOMS%" == "yes" ( - echo echo - echo echo Adding customizations to [$bashrc_f] and [${HOME}/.inputrc]... - echo wget -nv --show-progress -O /opt/bashrc_custom https://raw.githubusercontent.com/zhubanRuban/cygwin-extras/master/bashrc_custom - echo if grep -q '/opt/bashrc_custom' "$bashrc_f"; then - echo sed -i '/bashrc_custom/c\if [ -f "/opt/bashrc_custom" ]; then source "/opt/bashrc_custom"; fi' "$bashrc_f" - echo else - echo echo 'if [ -f "/opt/bashrc_custom" ]; then source "/opt/bashrc_custom"; fi' ^>^> "$bashrc_f" - echo fi - echo cat /etc/skel/.inputrc ^> "${HOME}/.inputrc" - echo wget -nv --show-progress https://raw.githubusercontent.com/zhubanRuban/cygwin-extras/master/inputrc_custom -O- ^>^> "${HOME}/.inputrc" - ) else ( - echo rm -f /opt/bashrc_custom - echo sed -i '/bashrc_custom/d' "$bashrc_f" - echo cat /etc/skel/.inputrc ^> "${HOME}/.inputrc" - ) - set ssh_agent_config=%INSTALL_ROOT%ssh_agent_config if "%INSTALL_SSH_AGENT_TWEAK%" == "yes" ( echo echo echo echo Adding SSH agent tweak to [$bashrc_f]... From 826af187548aa96bfc0109df3448853e4734478f Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Sat, 9 Mar 2019 15:01:33 +0200 Subject: [PATCH 02/52] ssh-pageant added https://github.com/cuviper/ssh-pageant --- ConCygSys-installer.cmd | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index 6e3d58c..f7aabdb 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -35,7 +35,7 @@ set INSTALL_ACL=no :: install apt-cyg command line package manager: https://github.com/transcode-open/apt-cyg set INSTALL_APT_CYG=yes -:: install SSH agent tweak https://github.com/zhubanRuban/cygwin-extras#ssh-agent-tweak +:: install SSH agent tweak https://github.com/cuviper/ssh-pageant set INSTALL_SSH_AGENT_TWEAK=yes :: install WSLbridge to allowing to access WSL via Mintty https://github.com/rprichard/wslbridge @@ -204,7 +204,7 @@ if "%INSTALL_APT_CYG%" == "yes" ( set CYGWIN_PACKAGES=wget,%CYGWIN_PACKAGES% ) if "%INSTALL_SSH_AGENT_TWEAK%" == "yes" ( - set CYGWIN_PACKAGES=openssh,%CYGWIN_PACKAGES% + set CYGWIN_PACKAGES=openssh,ssh-pageant,%CYGWIN_PACKAGES% ) :: all Cygwin installer commandline options: https://www.cygwin.com/faq/faq.html#faq.setup.cli @@ -500,16 +500,10 @@ echo Creating script to install required and additional software [%Post_install% ) if "%INSTALL_SSH_AGENT_TWEAK%" == "yes" ( echo echo - echo echo Adding SSH agent tweak to [$bashrc_f]... - echo wget -nv --show-progress -O /opt/ssh-agent-tweak https://raw.githubusercontent.com/zhubanRuban/cygwin-extras/master/ssh-agent-tweak - echo if grep -q '/opt/ssh-agent-tweak' "$bashrc_f"; then - echo sed -i '/ssh-agent-tweak/c\if [ -f "/opt/ssh-agent-tweak" ]; then source "/opt/ssh-agent-tweak"; fi' "$bashrc_f" - echo else - echo echo 'if [ -f "/opt/ssh-agent-tweak" ]; then source "/opt/ssh-agent-tweak"; fi' ^>^> "$bashrc_f" - echo fi + echo echo Adding SSH agent tweak... + echo eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-$USERNAME"^) >> /etc/profile.d/sshtweak.sh || goto :fail ) else ( - echo rm -f /opt/ssh-agent-tweak - echo sed -i '/ssh-agent-tweak/d' "$bashrc_f" + echo rm -f /etc/profile.d/sshtweak.sh ) ) >"%Post_install%" || goto :fail From 19dd2545a21b5a37f4396ced7cb9ef6d1649f590 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Sat, 9 Mar 2019 15:13:31 +0200 Subject: [PATCH 03/52] https for CYGWIN_SETUP download link --- ConCygSys-installer.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index f7aabdb..39f31ae 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190303b +set CONCYGSYS_VERSION=190309b ::####################### begin SCRIPT SETTINGS #######################:: @@ -182,7 +182,7 @@ del "%CYGWIN_ROOT%\%CYGWIN_SETUP%" >NUL 2>&1 :: downloading Cygwin installer echo. -cscript //Nologo "%DOWNLOADER%" http://cygwin.org/%CYGWIN_SETUP% "%CYGWIN_ROOT%\%CYGWIN_SETUP%" || goto :fail +cscript //Nologo "%DOWNLOADER%" https://cygwin.org/%CYGWIN_SETUP% "%CYGWIN_ROOT%\%CYGWIN_SETUP%" || goto :fail del "%DOWNLOADER%" >NUL 2>&1 :: Cygwin command line options: https://cygwin.com/faq/faq.html#faq.setup.cli From eae4b661c3aedc0f5babf205ffc8f00c5a4cfea5 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Sat, 9 Mar 2019 15:20:31 +0200 Subject: [PATCH 04/52] overwrite ssh-pageant file --- ConCygSys-installer.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index 39f31ae..0649079 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190309b +set CONCYGSYS_VERSION=190309b2 ::####################### begin SCRIPT SETTINGS #######################:: @@ -501,7 +501,7 @@ echo Creating script to install required and additional software [%Post_install% if "%INSTALL_SSH_AGENT_TWEAK%" == "yes" ( echo echo echo echo Adding SSH agent tweak... - echo eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-$USERNAME"^) >> /etc/profile.d/sshtweak.sh || goto :fail + echo eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-$USERNAME"^) ^> /etc/profile.d/sshtweak.sh || goto :fail ) else ( echo rm -f /etc/profile.d/sshtweak.sh ) From 49a2507a5130c4c65942e841a23d4231dbbfcc51 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Sun, 10 Mar 2019 15:25:09 +0200 Subject: [PATCH 05/52] Improved OS bitness autodetection https://blogs.msdn.microsoft.com/david.wang/2006/03/27/howto-detect-process-bitness/ --- ConCygSys-installer.cmd | 65 +++++++++++++---------------------------- 1 file changed, 21 insertions(+), 44 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index 0649079..08c5fd2 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190309b2 +set CONCYGSYS_VERSION=190310b ::####################### begin SCRIPT SETTINGS #######################:: @@ -15,8 +15,8 @@ set CYGWIN_USERNAME= :: home folder name e.g. /home/HOME_FOLDER, leave empty to use default one - concygsys set HOME_FOLDER= -:: override processor architecture: setup-x86.exe for 32bit or setup-x86_64.exe for 64bit system, leave empty for autodetect -set CYGWIN_SETUP= +:: override OS architecture: "32" bit or "64" bit system, leave empty for autodetect +set CYGWIN_ARCH= :: change the URL to the closest mirror: https://cygwin.com/mirrors.html set CYGWIN_MIRROR=http://ftp.inf.tu-dresden.de/software/windows/cygwin32 @@ -163,25 +163,23 @@ if "%PROXY_HOST%" == "" ( echo. echo Choosing correct version of Cygwin installer... -if "%CYGWIN_SETUP%" == "" ( -echo CYGWIN_SETUP setting is empty, autodetecting... - if "%PROCESSOR_ARCHITEW6432%" == "AMD64" ( - set CYGWIN_SETUP=setup-x86_64.exe - ) else ( - if "%PROCESSOR_ARCHITECTURE%" == "x86" ( - set CYGWIN_SETUP=setup-x86.exe +if "%CYGWIN_ARCH%" == "" ( + echo CYGWIN_ARCH setting is empty, autodetecting... + if "%PROCESSOR_ARCHITECTURE%" == "x86" ( + if defined PROCESSOR_ARCHITEW6432 ( + set CYGWIN_ARCH=64 & CYGWIN_SETUP=setup-x86_64.exe ) else ( - set CYGWIN_SETUP=setup-x86_64.exe + set CYGWIN_ARCH=32 & CYGWIN_SETUP=setup-x86.exe ) + ) else ( + set CYGWIN_ARCH=64 & CYGWIN_SETUP=setup-x86_64.exe ) ) echo Chosen installer: %CYGWIN_SETUP% -:: Removing existing setup.exe -del "%CYGWIN_ROOT%\%CYGWIN_SETUP%" >NUL 2>&1 - :: downloading Cygwin installer echo. +del "%CYGWIN_ROOT%\%CYGWIN_SETUP%" >NUL 2>&1 cscript //Nologo "%DOWNLOADER%" https://cygwin.org/%CYGWIN_SETUP% "%CYGWIN_ROOT%\%CYGWIN_SETUP%" || goto :fail del "%DOWNLOADER%" >NUL 2>&1 @@ -280,7 +278,7 @@ echo Generating one-file settings and updater file [%Concygsys_settings%]... echo. echo :installoptions echo :: %CONCYGSYS_LINK%#customization - echo set CYGWIN_SETUP=%CYGWIN_SETUP% + echo set CYGWIN_ARCH=%CYGWIN_ARCH% echo set CYGWIN_MIRROR=%CYGWIN_MIRROR% echo :: fill only if new packages should be installed during next update echo set CYGWIN_PACKAGES= @@ -375,15 +373,11 @@ if "%INSTALL_CONEMU%" == "yes" ( echo :: to be in win home dir if running cmd from conemu echo %%HOMEDRIVE%% echo cd %%HOMEPATH%% - echo if "%%PROCESSOR_ARCHITEW6432%%" == "AMD64" ( - echo start "" "%%~dp0conemu\ConEmu64.exe" %CONEMU_OPTIONS% - echo ^) else ( - echo if "%%PROCESSOR_ARCHITECTURE%%" == "x86" ( - echo start "" "%%~dp0conemu\ConEmu.exe" %CONEMU_OPTIONS% - echo ^) else ( - echo start "" "%%~dp0conemu\ConEmu64.exe" %CONEMU_OPTIONS% - echo ^) - echo ^) + if "%CYGWIN_ARCH%" == "64" ( + echo start "" "%%~dp0conemu\ConEmu64.exe" %CONEMU_OPTIONS% + ^) else ( + echo start "" "%%~dp0conemu\ConEmu.exe" %CONEMU_OPTIONS% + ^) echo exit 0 ) >"%Launch_conemu%" || goto :fail ) else ( @@ -476,12 +470,7 @@ echo Creating script to install required and additional software [%Post_install% ) if "%INSTALL_WSLBRIDGE%" == "yes" ( echo echo - if "%CYGWIN_SETUP%" == "setup-x86_64.exe" ( - echo wslbridge_url="https://github.com$(wget https://github.com/rprichard/wslbridge/releases/latest -O - 2>/dev/null | egrep '/.*/releases/download/.*/.*cygwin64.tar.gz' -o)" - ) - if "%CYGWIN_SETUP%" == "setup-x86.exe" ( - echo wslbridge_url="https://github.com$(wget https://github.com/rprichard/wslbridge/releases/latest -O - 2>/dev/null | egrep '/.*/releases/download/.*/.*cygwin32.tar.gz' -o)" - ) + echo wslbridge_url="https://github.com$(wget https://github.com/rprichard/wslbridge/releases/latest -O - 2>/dev/null | egrep '/.*/releases/download/.*/.*cygwin${CYGWIN_ARCH}.tar.gz' -o)" echo echo "Installing WSLbridge from $wslbridge_url" ^&^& \ echo wget -nv --show-progress -O "${CYGWIN_ROOT}.tar.gz" "$wslbridge_url" ^&^& \ echo echo "Extracting WSLbridge from archive..." ^&^& \ @@ -573,14 +562,7 @@ if "%INSTALL_CONEMU%" == "yes" ( echo ^ echo ^ echo ^ - rem Removed path to icon to get more space for tabs - rem Terminal changed to cygwin instead of xterm-256color to prevent issues in screen session over SSH - if "%CYGWIN_SETUP%" == "setup-x86_64.exe" ( - echo ^ - ) - if "%CYGWIN_SETUP%" == "setup-x86.exe" ( - echo ^ - ) + echo ^ echo ^ echo ^ echo ^ @@ -607,12 +589,7 @@ if "%INSTALL_CONEMU%" == "yes" ( echo ^ echo ^ echo ^ - if "%CYGWIN_SETUP%" == "setup-x86_64.exe" ( - echo ^ - ) - if "%CYGWIN_SETUP%" == "setup-x86.exe" ( - echo ^ - ) + echo ^ echo ^ echo ^ echo ^ From b44d8e46c79a1705f57751b07604bb9feb85732c Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Sun, 10 Mar 2019 15:49:39 +0200 Subject: [PATCH 06/52] forgot about set --- ConCygSys-installer.cmd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index 08c5fd2..e696ad0 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190310b +set CONCYGSYS_VERSION=190310b2 ::####################### begin SCRIPT SETTINGS #######################:: @@ -167,12 +167,12 @@ if "%CYGWIN_ARCH%" == "" ( echo CYGWIN_ARCH setting is empty, autodetecting... if "%PROCESSOR_ARCHITECTURE%" == "x86" ( if defined PROCESSOR_ARCHITEW6432 ( - set CYGWIN_ARCH=64 & CYGWIN_SETUP=setup-x86_64.exe + set CYGWIN_ARCH=64 & set CYGWIN_SETUP=setup-x86_64.exe ) else ( - set CYGWIN_ARCH=32 & CYGWIN_SETUP=setup-x86.exe + set CYGWIN_ARCH=32 & set CYGWIN_SETUP=setup-x86.exe ) ) else ( - set CYGWIN_ARCH=64 & CYGWIN_SETUP=setup-x86_64.exe + set CYGWIN_ARCH=64 & set CYGWIN_SETUP=setup-x86_64.exe ) ) echo Chosen installer: %CYGWIN_SETUP% From e5831bab2bbe9e607ac04f1e2330eff760ce3227 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Fri, 29 Mar 2019 21:50:10 +0200 Subject: [PATCH 07/52] fixed cygwin installer detection --- ConCygSys-installer.cmd | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index e696ad0..1b093db 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190310b2 +set CONCYGSYS_VERSION=190329 ::####################### begin SCRIPT SETTINGS #######################:: @@ -162,19 +162,24 @@ if "%PROXY_HOST%" == "" ( ) >"%DOWNLOADER%" || goto :fail echo. -echo Choosing correct version of Cygwin installer... if "%CYGWIN_ARCH%" == "" ( echo CYGWIN_ARCH setting is empty, autodetecting... if "%PROCESSOR_ARCHITECTURE%" == "x86" ( if defined PROCESSOR_ARCHITEW6432 ( - set CYGWIN_ARCH=64 & set CYGWIN_SETUP=setup-x86_64.exe + set CYGWIN_ARCH=64 ) else ( - set CYGWIN_ARCH=32 & set CYGWIN_SETUP=setup-x86.exe + set CYGWIN_ARCH=32 ) ) else ( - set CYGWIN_ARCH=64 & set CYGWIN_SETUP=setup-x86_64.exe + set CYGWIN_ARCH=64 ) ) +echo Choosing correct version of Cygwin installer... +if "%CYGWIN_ARCH%" == "64" ( + set CYGWIN_SETUP=setup-x86_64.exe +) else ( + set CYGWIN_SETUP=setup-x86.exe +) echo Chosen installer: %CYGWIN_SETUP% :: downloading Cygwin installer From 7862ac824342cb9be4e32e76b8051fffcaf92c3e Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Fri, 29 Mar 2019 22:59:35 +0200 Subject: [PATCH 08/52] Update ConCygSys-installer.cmd --- ConCygSys-installer.cmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index 1b093db..e7ff64e 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190329 +set CONCYGSYS_VERSION=190329b2 ::####################### begin SCRIPT SETTINGS #######################:: @@ -380,9 +380,9 @@ if "%INSTALL_CONEMU%" == "yes" ( echo cd %%HOMEPATH%% if "%CYGWIN_ARCH%" == "64" ( echo start "" "%%~dp0conemu\ConEmu64.exe" %CONEMU_OPTIONS% - ^) else ( + ) else ( echo start "" "%%~dp0conemu\ConEmu.exe" %CONEMU_OPTIONS% - ^) + ) echo exit 0 ) >"%Launch_conemu%" || goto :fail ) else ( From fd46203675547e71ef7ce49b901a79f4af7bf75e Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Wed, 28 Aug 2019 13:12:28 +0300 Subject: [PATCH 09/52] custom username and home folder processing - process simplified - now it is possible to use Windows path and path variables for custom home folder --- ConCygSys-installer.cmd | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index e7ff64e..3074b5a 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190329b2 +set CONCYGSYS_VERSION=190828b ::####################### begin SCRIPT SETTINGS #######################:: @@ -12,7 +12,11 @@ set CONCYGSYS_VERSION=190329b2 :: choose a user name under Cygwin, leave empty to use your Windows username set CYGWIN_USERNAME= -:: home folder name e.g. /home/HOME_FOLDER, leave empty to use default one - concygsys +:: custom home folder path (!) without quotes ' ", leave empty to use default one - /home/concygsys +:: examples: +:: C:\cygwinhome +:: C:\Users\yourusername\Documents\cygwinhome +:: %USERPROFILE%\Documents\cygwinhome set HOME_FOLDER= :: override OS architecture: "32" bit or "64" bit system, leave empty for autodetect @@ -244,10 +248,13 @@ echo Creating init script to keep the installation portable [%Portable_init%]... echo. echo PATH=/usr/local/bin:/usr/bin echo. - echo # Setting custom Cygwin username - echo ( - echo mkpasswd -c^|awk -F: -v OFS=: "{\$1=\"$USERNAME\"; \$6=\"$HOME\"; print}" - echo ^) ^>/etc/passwd + echo if [ ! -z "$CYGWIN_USERNAME" ]; then + echo ( + echo mkpasswd -c^|awk -F: -v OFS=: "{\$1=\"$CYGWIN_USERNAME\"; \$6=\"$(cygpath -u "$HOME"^)\"; print}" + echo ^) ^>/etc/passwd + echo else + echo rm -f /etc/passwd + echo fi echo. echo ( if not "%INSTALL_ACL%" == "yes" ( @@ -300,13 +307,11 @@ echo Generating one-file settings and updater file [%Concygsys_settings%]... echo call "%%~dp0%Concygsys_settings_name%" cygwinsettings echo set ALLUSERSPROFILE=%%CYGWIN_ROOT%%\ProgramData echo set ProgramData=%%ALLUSERSPROFILE%% - echo if not "%%CYGWIN_USERNAME%%" == "" ( - echo set USERNAME=%%CYGWIN_USERNAME%% - echo ^) - echo if "%%HOME_FOLDER%%" == "" ( - echo set HOME_FOLDER=concygsys + echo if not "%%HOME_FOLDER%%" == "" ( + echo set HOME=%%HOME_FOLDER%% + echo ^) else ( + echo set HOME=/home/concygsys echo ^) - echo set HOME=/home/%%HOME_FOLDER%% echo rd /s /q "%%CYGWIN_ROOT%%\pkg-cache" 2^>NUL echo type NUL ^>"%%CYGWIN_ROOT%%\etc\fstab" echo "%%CYGWIN_ROOT%%\bin\bash" "%%CYGWIN_ROOT%%\%Portable_init_name%" From 84f3ef0a9ee011a8eec5191978a3283b273a2e93 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Wed, 28 Aug 2019 13:43:17 +0300 Subject: [PATCH 10/52] fstab options simplified missing options are auto-filled by cygwin --- ConCygSys-installer.cmd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index 3074b5a..167a7d0 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190828b +set CONCYGSYS_VERSION=190828b2 ::####################### begin SCRIPT SETTINGS #######################:: @@ -258,11 +258,11 @@ echo Creating init script to keep the installation portable [%Portable_init%]... echo. echo ( if not "%INSTALL_ACL%" == "yes" ( - echo echo $(cygpath -m "$CYGWIN_ROOT"^|sed 's/\ /\\040/g'^)/bin /usr/bin none binary,auto,noacl 0 0 - echo echo $(cygpath -m "$CYGWIN_ROOT"^|sed 's/\ /\\040/g'^)/lib /usr/lib none binary,auto,noacl 0 0 - echo echo $(cygpath -m "$CYGWIN_ROOT"^|sed 's/\ /\\040/g'^) / none override,binary,auto,noacl 0 0 + echo echo $(cygpath -m "$CYGWIN_ROOT"^|sed 's/\ /\\040/g'^)/bin /usr/bin none noacl 0 0 + echo echo $(cygpath -m "$CYGWIN_ROOT"^|sed 's/\ /\\040/g'^)/lib /usr/lib none noacl 0 0 + echo echo $(cygpath -m "$CYGWIN_ROOT"^|sed 's/\ /\\040/g'^) / none override,noacl 0 0 ) - echo echo none /mnt cygdrive binary,noacl,posix=0,user 0 0 + echo echo none /mnt cygdrive noacl,user 0 0 echo ^) ^>/etc/fstab echo. echo # adjust Cygwin packages cache path From fc5f512e654e9d83951c1dbdc527ad5bb41907a9 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Wed, 28 Aug 2019 15:48:48 +0300 Subject: [PATCH 11/52] do not delete stock cygwin launcher but place a warning file --- ConCygSys-installer.cmd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index 167a7d0..0aca13e 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190828b2 +set CONCYGSYS_VERSION=190828b3 ::####################### begin SCRIPT SETTINGS #######################:: @@ -230,7 +230,6 @@ echo Running Cygwin setup... --packages dos2unix,wget,%CYGWIN_PACKAGES% || goto :fail :: deleting standard Cygwin launcher -del "%CYGWIN_ROOT%\Cygwin.bat" >NUL 2>&1 echo %CONCYGSYS_INFO% >"%CYGWIN_ROOT%\DO-NOT-LAUNCH-CYGWIN-FROM-HERE" if not "%UPDATECYGWINONLY%" == "" goto :aftercygwinupdate From 399005c8f3dc5e8145a7855b82f2e6d259e70b05 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Wed, 28 Aug 2019 21:53:19 +0300 Subject: [PATCH 12/52] cygwin installer options reorganized + minor code changes --- ConCygSys-installer.cmd | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index 0aca13e..d8e183f 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190828b3 +set CONCYGSYS_VERSION=190828b4 ::####################### begin SCRIPT SETTINGS #######################:: @@ -23,6 +23,7 @@ set HOME_FOLDER= set CYGWIN_ARCH= :: change the URL to the closest mirror: https://cygwin.com/mirrors.html +:: do not leave empty set CYGWIN_MIRROR=http://ftp.inf.tu-dresden.de/software/windows/cygwin32 :: select the packages to be installed automatically: https://cygwin.com/packages/package_list.html @@ -48,7 +49,7 @@ set INSTALL_WSLBRIDGE=yes :: install multitab terminal https://conemu.github.io/ set INSTALL_CONEMU=yes :: https://conemu.github.io/en/ConEmuArgs.html -set CONEMU_OPTIONS=-Title ConCygSys +set CONEMU_OPTIONS= :: set proxy if required (unfortunately Cygwin setup.exe does not have commandline options to specify proxy user credentials) set PROXY_HOST= @@ -56,7 +57,8 @@ set PROXY_PORT=8080 :: set Mintty options used in ConEmu task: https://cdn.rawgit.com/mintty/mintty/master/docs/mintty.1.html#CONFIGURATION :: the main goal is to set options (they will overwrite whatyou configured in main Mintty window) to make Mintty working properly with ConEmu -set MINTTY_OPTIONS=-o FontHeight=10 ^ +set MINTTY_OPTIONS= ^ +-o FontHeight=10 ^ -o BoldAsFont=yes ^ -o AllowBlinking=yes ^ -o CopyOnSelect=yes ^ @@ -217,17 +219,20 @@ if "%INSTALL_SSH_AGENT_TWEAK%" == "yes" ( :: all Cygwin installer commandline options: https://www.cygwin.com/faq/faq.html#faq.setup.cli echo. echo Running Cygwin setup... -"%CYGWIN_ROOT%\%CYGWIN_SETUP%" --no-admin ^ ---site %CYGWIN_MIRROR% %CYGWIN_PROXY% ^ ---root "%CYGWIN_ROOT%" ^ +"%CYGWIN_ROOT%\%CYGWIN_SETUP%" ^ +--allow-unsupported-windows ^ +--delete-orphans ^ --local-package-dir "%CYGWIN_ROOT%\pkg-cache" ^ ---no-shortcuts ^ +--no-admin ^ --no-desktop ^ ---delete-orphans ^ ---upgrade-also ^ --no-replaceonreboot ^ +--no-shortcuts ^ +--no-startmenu ^ +--packages dos2unix,wget,%CYGWIN_PACKAGES% ^ --quiet-mode ^ ---packages dos2unix,wget,%CYGWIN_PACKAGES% || goto :fail +--root "%CYGWIN_ROOT%" ^ +--site %CYGWIN_MIRROR% %CYGWIN_PROXY% ^ +--upgrade-also || goto :fail :: deleting standard Cygwin launcher echo %CONCYGSYS_INFO% >"%CYGWIN_ROOT%\DO-NOT-LAUNCH-CYGWIN-FROM-HERE" From 573179f70b9fb81cfd1eae3faca98641015e6ecb Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Wed, 28 Aug 2019 22:46:40 +0300 Subject: [PATCH 13/52] up-to-date stock cygwin launcher commands + minor launcher improvements --- ConCygSys-installer.cmd | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index d8e183f..e1f27b7 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190828b4 +set CONCYGSYS_VERSION=190828b5 ::####################### begin SCRIPT SETTINGS #######################:: @@ -234,7 +234,7 @@ echo Running Cygwin setup... --site %CYGWIN_MIRROR% %CYGWIN_PROXY% ^ --upgrade-also || goto :fail -:: deleting standard Cygwin launcher +:: warning for standard Cygwin launcher echo %CONCYGSYS_INFO% >"%CYGWIN_ROOT%\DO-NOT-LAUNCH-CYGWIN-FROM-HERE" if not "%UPDATECYGWINONLY%" == "" goto :aftercygwinupdate @@ -307,10 +307,11 @@ echo Generating one-file settings and updater file [%Concygsys_settings%]... echo exit /b 0 echo. echo :launcherheader + echo setlocal enableextensions + echo set TERM= echo set CYGWIN_ROOT=%%~dp0cygwin + echo cd /d "%%CYGWIN_ROOT%%\bin" echo call "%%~dp0%Concygsys_settings_name%" cygwinsettings - echo set ALLUSERSPROFILE=%%CYGWIN_ROOT%%\ProgramData - echo set ProgramData=%%ALLUSERSPROFILE%% echo if not "%%HOME_FOLDER%%" == "" ( echo set HOME=%%HOME_FOLDER%% echo ^) else ( @@ -373,7 +374,7 @@ echo Generating cmd launcher [%Launch_cmd%]... echo if "%%1" == "" ( echo "%%CYGWIN_ROOT%%\bin\bash.exe" --login -i echo ^) else ( - echo "%%CYGWIN_ROOT%%\bin\bash.exe" --login -c %%* + echo "%%CYGWIN_ROOT%%\bin\bash.exe" --login -c "%%*" echo ^) ) >"%Launch_cmd%" || goto :fail @@ -384,9 +385,6 @@ if "%INSTALL_CONEMU%" == "yes" ( echo @echo off echo :: %CONCYGSYS_INFO% echo call "%%~dp0%Concygsys_settings_name%" launcherheader - echo :: to be in win home dir if running cmd from conemu - echo %%HOMEDRIVE%% - echo cd %%HOMEPATH%% if "%CYGWIN_ARCH%" == "64" ( echo start "" "%%~dp0conemu\ConEmu64.exe" %CONEMU_OPTIONS% ) else ( @@ -405,7 +403,7 @@ echo Generating Mintty launcher [%Launch_mintty%]... echo @echo off echo :: %CONCYGSYS_INFO% echo call "%%~dp0%Concygsys_settings_name%" launcherheader - echo start "" "%%CYGWIN_ROOT%%\bin\mintty.exe" --Title ConCygSys - + echo start "" "%%CYGWIN_ROOT%%\bin\mintty.exe" - echo exit 0 ) >"%Launch_mintty%" || goto :fail @@ -415,7 +413,7 @@ if "%INSTALL_WSLBRIDGE%" == "yes" ( ( echo @echo off echo :: %CONCYGSYS_INFO% - echo start "" "%%~dp0cygwin\bin\mintty.exe" --Title ConCygSysWSL --WSL= -~ + echo start "" "%%~dp0cygwin\bin\mintty.exe" --WSL= -~ echo exit 0 ) >"%Launch_wsltty%" || goto :fail ) else ( From 1112523963156334d134a2a44ab3f1287bef7a4a Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Thu, 29 Aug 2019 12:11:50 +0300 Subject: [PATCH 14/52] package cleanup - wget is not required by other parts of script - curl is included in cygwin base - minor changes in portable-init script --- ConCygSys-installer.cmd | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index e1f27b7..12add92 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190828b5 +set CONCYGSYS_VERSION=190829b ::####################### begin SCRIPT SETTINGS #######################:: @@ -27,7 +27,7 @@ set CYGWIN_ARCH= set CYGWIN_MIRROR=http://ftp.inf.tu-dresden.de/software/windows/cygwin32 :: select the packages to be installed automatically: https://cygwin.com/packages/package_list.html -set CYGWIN_PACKAGES=bind-utils,curl,inetutils,openssh,openssl,vim,whois +set CYGWIN_PACKAGES=bind-utils,inetutils,openssh,vim,whois :: Cygwin uses ACLs to implement real Unix permissions which are not supported by Windows: https://cygwin.com/cygwin-ug-net/using-filemodes.html :: However, if you move installation to different directory or PC, ACLs will be broken and will have troubles running Cygwin binaries @@ -228,7 +228,7 @@ echo Running Cygwin setup... --no-replaceonreboot ^ --no-shortcuts ^ --no-startmenu ^ ---packages dos2unix,wget,%CYGWIN_PACKAGES% ^ +--packages dos2unix,%CYGWIN_PACKAGES% ^ --quiet-mode ^ --root "%CYGWIN_ROOT%" ^ --site %CYGWIN_MIRROR% %CYGWIN_PROXY% ^ @@ -443,7 +443,6 @@ echo Creating script to install required and additional software [%Post_install% echo export http_proxy=http://%PROXY_HOST%:%PROXY_PORT% echo export https_proxy=$http_proxy echo fi - echo echo echo echo Adding proxy settings for host [%COMPUTERNAME%] to [$bashrc_f]... echo ( echo echo if [ \"\${HOSTNAME^^}\" == \"%COMPUTERNAME%\" ]\; then @@ -467,23 +466,21 @@ echo Creating script to install required and additional software [%Post_install% echo conemu_dir=$(cygpath -w "$CYGWIN_ROOT/../conemu"^) if "%INSTALL_CONEMU%" == "yes" ( echo if [ ! -e "$conemu_dir" ]; then - echo echo - echo conemu_url="https://github.com$(wget https://github.com/Maximus5/ConEmu/releases/latest -O - 2>/dev/null | egrep '/.*/releases/download/.*/.*7z' -o)" ^&^& \ - echo echo "Installing ConEmu from $conemu_url" ^&^& \ + echo conemu_url="https://github.com$(wget https://github.com/Maximus5/ConEmu/releases/latest -O - 2>/dev/null | egrep '/.*/releases/download/.*/.*7z' -o)" + echo echo "Installing ConEmu from $conemu_url" echo wget -nv --show-progress -O "${conemu_dir}.7z" "$conemu_url" ^&^& \ echo mkdir -p "$conemu_dir" ^&^& \ echo echo "Extracting ConEmu from archive..." ^&^& \ echo bsdtar -xf "${conemu_dir}.7z" -C "$conemu_dir" ^&^& \ echo rm -f "${conemu_dir}.7z" echo fi - echo echo %CONCYGSYS_INFO% ^> "$CYGWIN_ROOT/../conemu/DO-NOT-LAUNCH-CONEMU-FROM-HERE" + echo echo %CONCYGSYS_INFO% ^> "$conemu_dir/DO-NOT-LAUNCH-CONEMU-FROM-HERE" ) else ( echo rm -rf "$conemu_dir" ) if "%INSTALL_WSLBRIDGE%" == "yes" ( - echo echo echo wslbridge_url="https://github.com$(wget https://github.com/rprichard/wslbridge/releases/latest -O - 2>/dev/null | egrep '/.*/releases/download/.*/.*cygwin${CYGWIN_ARCH}.tar.gz' -o)" - echo echo "Installing WSLbridge from $wslbridge_url" ^&^& \ + echo echo "Installing WSLbridge from $wslbridge_url" echo wget -nv --show-progress -O "${CYGWIN_ROOT}.tar.gz" "$wslbridge_url" ^&^& \ echo echo "Extracting WSLbridge from archive..." ^&^& \ echo bsdtar -xf "${CYGWIN_ROOT}.tar.gz" --strip-components=1 -C "${CYGWIN_ROOT}/bin/" '*/wslbridge*' ^&^& \ @@ -492,7 +489,6 @@ echo Creating script to install required and additional software [%Post_install% echo rm -f "${CYGWIN_ROOT}/bin/wslbridge"* ) if "%INSTALL_APT_CYG%" == "yes" ( - echo echo echo echo "Installing/updating apt-cyg..." echo wget -nv --show-progress -O /usr/local/bin/apt-cyg https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg echo chmod +x /usr/local/bin/apt-cyg @@ -500,7 +496,6 @@ echo Creating script to install required and additional software [%Post_install% echo rm -f /usr/local/bin/apt-cyg ) if "%INSTALL_SSH_AGENT_TWEAK%" == "yes" ( - echo echo echo echo Adding SSH agent tweak... echo eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-$USERNAME"^) ^> /etc/profile.d/sshtweak.sh || goto :fail ) else ( From cf309ab135704ca2a82a8a1994b4d89779a832f8 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Thu, 29 Aug 2019 12:58:30 +0300 Subject: [PATCH 15/52] proxy settings revised - additional descriptions added - added fixes for from ssh agent tweak update --- ConCygSys-installer.cmd | 64 +++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index 12add92..8650e9a 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190829b +set CONCYGSYS_VERSION=190829b2 ::####################### begin SCRIPT SETTINGS #######################:: @@ -51,9 +51,10 @@ set INSTALL_CONEMU=yes :: https://conemu.github.io/en/ConEmuArgs.html set CONEMU_OPTIONS= -:: set proxy if required (unfortunately Cygwin setup.exe does not have commandline options to specify proxy user credentials) +:: set proxy if required, in the following formats: +:: proxy:port +:: username:password@proxy:port set PROXY_HOST= -set PROXY_PORT=8080 :: set Mintty options used in ConEmu task: https://cdn.rawgit.com/mintty/mintty/master/docs/mintty.1.html#CONFIGURATION :: the main goal is to set options (they will overwrite whatyou configured in main Mintty window) to make Mintty working properly with ConEmu @@ -93,7 +94,7 @@ if not exist "%CYGWIN_ROOT%" ( set UPDATEMODE=yes wmic process get ExecutablePath 2>NUL | find /I "%CYGWIN_ROOT%">NUL :: rem is used below instead of :: for commenting as loops produce "system cannot find disk" warning when using :: in miltiple lines - rem for those wondering why I didn't use if "%ERRORLEVEL%"=="0" + rem why I didn't use if "%ERRORLEVEL%"=="0" rem https://social.technet.microsoft.com/Forums/en-US/e72cb532-3da0-4c7f-a61e-9ffbf8050b55/batch-errorlevel-always-reports-back-level-0?forum=ITCG if not ErrorLevel 1 ( echo. @@ -104,6 +105,7 @@ if not exist "%CYGWIN_ROOT%" ( if exist "%Concygsys_settings%" ( call "%Concygsys_settings%" cygwinsettings call "%Concygsys_settings%" installoptions + set PROXY_HOST=%PROXY_HOST%:%PROXY_PORT% ) else ( set UPDATEFROMOLD=yes ) @@ -143,7 +145,7 @@ echo Creating script that can download files [%DOWNLOADER%]... if "%PROXY_HOST%" == "" ( set DOWNLOADER_PROXY=. ) else ( - set DOWNLOADER_PROXY= req.SetProxy 2, "%PROXY_HOST%:%PROXY_PORT%", "" + set DOWNLOADER_PROXY= req.SetProxy 2, "%PROXY_HOST%", "" ) ( echo url = Wscript.Arguments(0^) @@ -198,7 +200,7 @@ del "%DOWNLOADER%" >NUL 2>&1 if "%PROXY_HOST%" == "" ( set CYGWIN_PROXY= ) else ( - set CYGWIN_PROXY=--proxy "%PROXY_HOST%:%PROXY_PORT%" + set CYGWIN_PROXY=--proxy "%PROXY_HOST%" ) @@ -249,9 +251,9 @@ echo Creating init script to keep the installation portable [%Portable_init%]... ( echo #!/usr/bin/env bash echo # %CONCYGSYS_INFO% - echo. + echo # setting path variable as it is not defined at this point echo PATH=/usr/local/bin:/usr/bin - echo. + echo # setting custom cygwin username in passwd file, if not empty echo if [ ! -z "$CYGWIN_USERNAME" ]; then echo ( echo mkpasswd -c^|awk -F: -v OFS=: "{\$1=\"$CYGWIN_USERNAME\"; \$6=\"$(cygpath -u "$HOME"^)\"; print}" @@ -259,7 +261,7 @@ echo Creating init script to keep the installation portable [%Portable_init%]... echo else echo rm -f /etc/passwd echo fi - echo. + echo # generating custom fstab in case ACL is set to no echo ( if not "%INSTALL_ACL%" == "yes" ( echo echo $(cygpath -m "$CYGWIN_ROOT"^|sed 's/\ /\\040/g'^)/bin /usr/bin none noacl 0 0 @@ -268,7 +270,6 @@ echo Creating init script to keep the installation portable [%Portable_init%]... ) echo echo none /mnt cygdrive noacl,user 0 0 echo ^) ^>/etc/fstab - echo. echo # adjust Cygwin packages cache path echo pkg_cache_dir=$(cygpath -w "$CYGWIN_ROOT/pkg-cache"^) echo sed -i '/^^last-cache/!b;n;c\\t'"${pkg_cache_dir//\\/\\\\}"'' /etc/setup/setup.rc @@ -303,7 +304,6 @@ echo Generating one-file settings and updater file [%Concygsys_settings%]... echo set INSTALL_SSH_AGENT_TWEAK=%INSTALL_SSH_AGENT_TWEAK% echo set INSTALL_CONEMU=%INSTALL_CONEMU% echo set PROXY_HOST=%PROXY_HOST% - echo set PROXY_PORT=%PROXY_PORT% echo exit /b 0 echo. echo :launcherheader @@ -439,29 +439,22 @@ echo Creating script to install required and additional software [%Post_install% echo cat /etc/skel/.bashrc ^> "$bashrc_f" ) if not "%PROXY_HOST%" == "" ( - echo if [ "${HOSTNAME^^}" == "%COMPUTERNAME%" ]; then - echo export http_proxy=http://%PROXY_HOST%:%PROXY_PORT% - echo export https_proxy=$http_proxy - echo fi - echo echo Adding proxy settings for host [%COMPUTERNAME%] to [$bashrc_f]... - echo ( - echo echo if [ \"\${HOSTNAME^^}\" == \"%COMPUTERNAME%\" ]\; then - echo echo export http_proxy=http://%PROXY_HOST%:%PROXY_PORT% - echo echo export https_proxy=\$http_proxy - echo echo export no_proxy="::1,127.0.0.1,localhost,169.254.169.254,%COMPUTERNAME%,*.%USERDNSDOMAIN%" - echo echo export HTTP_PROXY=\$http_proxy - echo echo export HTTPS_PROXY=\$http_proxy - echo echo export NO_PROXY=\$no_proxy - echo echo fi - echo ^) ^> /opt/bash_proxy - echo if grep -q '/opt/bash_proxy' "$bashrc_f"; then - echo sed -i '/bash_proxy/c\if [ -f "/opt/bash_proxy" ]; then source "/opt/bash_proxy"; fi' "$bashrc_f" - echo else - echo echo 'if [ -f "/opt/bash_proxy" ]; then source "/opt/bash_proxy"; fi' ^>^> "$bashrc_f" - echo fi - ) else ( + echo export http_proxy="http://%PROXY_HOST%" + echo export https_proxy="https://%PROXY_HOST%" + echo export ftp_proxy="ftp://%PROXY_HOST%" + echo export no_proxy="127.0.0.1,localhost,$HOSTNAME,$COMPUTERNAME" + echo # removing old proxy implementation echo rm -f /opt/bash_proxy echo sed -i '/bash_proxy/d' "$bashrc_f" + echo echo Adding proxy settings... + echo ( + echo echo export http_proxy=\"http://%PROXY_HOST%\" + echo echo export https_proxy=\"https://%PROXY_HOST%\" + echo echo export ftp_proxy=\"ftp://%PROXY_HOST%\" + echo echo export no_proxy=\"127.0.0.1,localhost,\$HOSTNAME,\$COMPUTERNAME\" + echo ^) ^> /etc/profile.d/proxytweak.sh + ) else ( + echo rm -f /etc/profile.d/proxytweak.sh ) echo conemu_dir=$(cygpath -w "$CYGWIN_ROOT/../conemu"^) if "%INSTALL_CONEMU%" == "yes" ( @@ -496,10 +489,13 @@ echo Creating script to install required and additional software [%Post_install% echo rm -f /usr/local/bin/apt-cyg ) if "%INSTALL_SSH_AGENT_TWEAK%" == "yes" ( + echo # removing old ssh agent tweak implementation + echo rm -f /opt/ssh-agent-tweak + echo sed -i '/ssh-agent-tweak/d' "$bashrc_f" echo echo Adding SSH agent tweak... - echo eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-$USERNAME"^) ^> /etc/profile.d/sshtweak.sh || goto :fail + echo eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-$USERNAME"^) ^> /etc/profile.d/sshagenttweak.sh || goto :fail ) else ( - echo rm -f /etc/profile.d/sshtweak.sh + echo rm -f /etc/profile.d/sshagenttweak.sh ) ) >"%Post_install%" || goto :fail From ae79ee8885dcfac04db701548f7f7e2db3747013 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Thu, 29 Aug 2019 15:42:11 +0300 Subject: [PATCH 16/52] inputrc and update process - inputrc tweak via bind for profile.d - minor fix for proxy --- ConCygSys-installer.cmd | 53 +++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index 8650e9a..fbe19f1 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190829b2 +set CONCYGSYS_VERSION=190829b3 ::####################### begin SCRIPT SETTINGS #######################:: @@ -86,6 +86,7 @@ set Concygsys_settings=%INSTALL_ROOT%%Concygsys_settings_name% :: to use 'set' in full in 'if' loop below: https://ss64.com/nt/delayedexpansion.html setlocal EnableDelayedExpansion +:retryupdate if not exist "%CYGWIN_ROOT%" ( echo Creating Cygwin folder [%CYGWIN_ROOT%]... md "%CYGWIN_ROOT%" @@ -98,38 +99,34 @@ if not exist "%CYGWIN_ROOT%" ( rem https://social.technet.microsoft.com/Forums/en-US/e72cb532-3da0-4c7f-a61e-9ffbf8050b55/batch-errorlevel-always-reports-back-level-0?forum=ITCG if not ErrorLevel 1 ( echo. - echo ^^!^^!^^! Active Cygwin processes detected, please close them and re-run update ^^!^^!^^! + echo ^^!^^!^^! Active Cygwin processes detected, please close them and hit [ ENTER ] ^^!^^!^^! wmic process get ExecutablePath | find /I "%CYGWIN_ROOT%" - goto :fail + pause + goto :retryupdate ) else ( if exist "%Concygsys_settings%" ( call "%Concygsys_settings%" cygwinsettings call "%Concygsys_settings%" installoptions - set PROXY_HOST=%PROXY_HOST%:%PROXY_PORT% - ) else ( - set UPDATEFROMOLD=yes + if not "!PROXY_PORT!" == "" ( + set PROXY_HOST=%PROXY_HOST%:%PROXY_PORT% + ) ) echo. - set /p UPDATECYGWINONLY= [ 1 and ENTER] - update Cygwin only [ ENTER ] - update everything + set /p UPDATECYGWINONLY= [ 1 then ENTER] - update Cygwin only [ ENTER ] - update everything if not "!UPDATECYGWINONLY!" == "" goto :updatecygwinonly echo. echo ^^!^^!^^! Before you proceed with update... ^^!^^!^^! - if "!UPDATEFROMOLD!" == "yes" ( - echo It seems that you are upgrading from one of the oldest ConCygSys releases - echo Please BACKUP your personal records in .bashrc - echo Hit ENTER when done - echo. - pause - ) else ( - echo To customize update process: - echo - close this window - echo - modify :installoptions section of [%Concygsys_settings%] file accordingly - echo - re-run update - echo. - echo If you are good with existing setup, just hit ENTER - echo. - pause - ) + echo. + echo Please backup your cygwin home directory just in case + echo. + echo To customize update process: + echo - close this window + echo - modify :installoptions section of [%Concygsys_settings%] file + echo - re-run update + echo. + echo If you are good with existing setup, just hit [ ENTER ] to start update + echo. + pause ) ) :: not needed anymore and to prevent issues in bash script generation down below (they conatin ! which should have been escaped by ^^) @@ -433,11 +430,11 @@ echo Creating script to install required and additional software [%Post_install% echo #!/usr/bin/env bash echo PATH=/usr/local/bin:/usr/bin echo bashrc_f=${HOME}/.bashrc - echo mkdir -p /opt - :: delete messy bashrc if updating from earliest ConCygSys versions - if "%UPDATEFROMOLD%" == "yes" ( - echo cat /etc/skel/.bashrc ^> "$bashrc_f" - ) + echo # https://github.com/zhubanRuban/cygwin-extras/blob/master/inputrc_custom_bind + echo ( + echo echo bind \'\"\\e[1\;5C\": forward-word\' \# ctrl + right + echo echo bind \'\"\\e[1\;5D\": backward-word\' \# ctrl + left + echo ^) ^> /etc/profile.d/inputrctweak.sh if not "%PROXY_HOST%" == "" ( echo export http_proxy="http://%PROXY_HOST%" echo export https_proxy="https://%PROXY_HOST%" From 800a1f711c573bdd855dadc725b5720b98c696e5 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Thu, 29 Aug 2019 18:52:49 +0300 Subject: [PATCH 17/52] broken links, badges, fixes - fixes for broken links and previews - added badges - minor changes in description --- README.md | 91 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 49 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 76ad1b1..a1d349c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ -# ConCygSys +# ConCygSys + +[![GitHub release (latest by date)](https://img.shields.io/github/v/release/zhubanRuban/ConCygSys?style=flat-square)](../../releases) +![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/zhubanRuban/ConCygSys?style=flat-square) +[![GitHub All Releases](https://img.shields.io/github/downloads/zhubanRuban/ConCygSys/total?style=flat-square)]((../../releases)) +![HitCount](http://hits.dwyl.io/zhubanRuban/ConCygSys.svg) +[![GitHub](https://img.shields.io/github/license/zhubanRuban/ConCygSys?style=flat-square)](LICENSE) - [Description](#description) - [Features](#features) @@ -7,24 +13,23 @@ - [Update](#update) - [Customization](#customization) - [FAQ](#faq) -- [License](#license) ## Description -**ConCygSys** is a tool that installs portable [Cygwin](https://www.cygwin.com/) Unix-like environment and connects to portable [ConEmu](https://conemu.github.io/) console emulator. All required software in one folder. Now also with [WSLtty](https://github.com/mintty/wsltty) support! +**ConCygSys** is a lightweight tool that installs portable [Cygwin](https://www.cygwin.com/) Unix-like environment and connects to portable [ConEmu](https://conemu.github.io/) console emulator, with self-update. All required software in one folder. Now also with [WSLtty](https://github.com/mintty/wsltty) support! -This is an independent fork of amazing [cygwin-portable-installer](https://github.com/vegardit/cygwin-portable-installer) project. At first minimally modified for sysadmin purposes, later on filled with improvements and new features. +> This is an independent fork of amazing [cygwin-portable-installer](https://github.com/vegardit/cygwin-portable-installer) project. At first minimally modified for sysadmin purposes, later on filled with improvements and new features. ## Features -- Downloads and installs the latest [Cygwin](https://www.cygwin.com/) and makes it **fully portable**, so you can: +- Downloads and installs the latest Cygwin and makes it **fully portable**, so you can: - move it to a different directory at any time - - duplicate it by copying its folder + - replicate it by copying its folder - rename the folder - run from USB or network drive - use it in folders with spaces -- Downloads and installs the latest portable [ConEmu](https://conemu.github.io/) -- Only pure base with a couple of config files to make the installtion portable, no hacks with [Cygwin](https://www.cygwin.com/)/[ConEmu](https://conemu.github.io/) code +- Downloads and installs the latest portable ConEmu +- Only pure base with a couple of config files to make the installtion portable, no hacks with Cygwin/ConEmu code - The installer is flexible, you can customize the installation process per your requirements - Being portable, the script can also **upgrade** itself and its components - Windows 7+ supported @@ -33,7 +38,7 @@ This is an independent fork of amazing [cygwin-portable-installer](https://githu > Disable antivirus software on your PC during installation. [Why it is recommended](https://cygwin.com/faq/faq.html#faq.using.bloda) -- Download the [latest ConCygSys release](https://github.com/zhubanRuban/ConCygSys/releases), extract the archive and go to the extracted folder +- Download the [latest ConCygSys release](../../releases), extract the archive and go to the extracted folder > **Optional:** Edit **`ConCygSys-installer`** to [customize](#customization) the installation per your requirements @@ -41,22 +46,26 @@ This is an independent fork of amazing [cygwin-portable-installer](https://githu > If Windows complains with a **Windows protected your PC** popup, you may need to click **Run anyway** to proceed with the installation. -- Once the installation is finished, you can run [Cygwin](https://www.cygwin.com/) via one of the following launchers: - - **`CygWin-Cmd`** to run [Cygwin](https://www.cygwin.com/) in standard Windows console - - **`CygWin-ConEmu`** to run [Cygwin](https://www.cygwin.com/) via [ConEmu](https://conemu.github.io/) - multitab quake-style console **(RECOMMENDED)** - - **`CygWin-MinTTY`** to run [Cygwin](https://www.cygwin.com/) via [Mintty](https://mintty.github.io/) terminal emulator - fully xterm-compatible, but without multitab and quake-style support - - **`CygWin-WSLtty`** to run [WSL](https://docs.microsoft.com/en-us/windows/wsl/about) via [Mintty](https://mintty.github.io/) terminal emulator +- Once the installation is finished, you can run Cygwin via one of the following launchers: + + **`CygWin-Cmd`** to run Cygwin in standard Windows console + + **`CygWin-ConEmu`** to run Cygwin in ConEmu terminal **(RECOMMENDED)** + + **`CygWin-MinTTY`** to run Cygwin in [Mintty](https://mintty.github.io/) terminal emulator + + **`CygWin-WSLtty`** to run WSL in Mintty terminal emulator > You can try the launchers one-by-one to find the most suitable option ## Usage -Default behaviour of [Cygwin](https://www.cygwin.com/) console: +Default behaviour of Cygwin console: - **Select by Left Click and release** - copy - **Right click** - paste -Shortcuts if using [Cygwin](https://www.cygwin.com/) via [ConEmu](https://conemu.github.io/) console: +Shortcuts if using Cygwin via ConEmu console: - **Ctrl+\`** - open/hide console (quake style) - **Double click on Tab** - rename a tab @@ -65,78 +74,76 @@ Shortcuts if using [Cygwin](https://www.cygwin.com/) via [ConEmu](https://conemu ## Update -> ConCygSys consists of: -> - **[CygWin](https://www.cygwin.com/):** Unix-like environment itself -> - **[ConEmu](https://conemu.github.io/):** multitab console you open this Unix-like environment from -> - **ConCygSys core:** configuration files and settings keeping the installation portable - Use **`update`** launcher in the root of your ConCygSys directory to update the installation. -You will be able either to update **[Cygwin](https://www.cygwin.com/) only** or to perform a **full update**: [Cygwin](https://www.cygwin.com/) + ConCygSys core. [ConEmu](https://conemu.github.io/) is already set to check its updates on startup and can update itself independently. +You will be able either to update **Cygwin only** or to perform a **full update**: Cygwin + ConCygSys core. ConEmu is already set to check its updates on startup and can update itself independently. -> If you cannot find **`update`** launcher, this means that you are updating one of the earliest stable/beta releases, therefore you need to perfrom the update manually: -> - Download **`ConCygSys-installer.cmd`** from [this link](https://raw.githubusercontent.com/zhubanRuban/ConCygSys/master/ConCygSys-installer.cmd) *(right click > save link as)* to existing ConCygSys directory +> Additional update notes. ConCygSys consists of: +> - **CygWin:** Unix-like environment itself +> - **ConEmu:** multitab console you open this Unix-like environment from +> - **ConCygSys core:** configuration files and settings keeping the installation portable +> +> If you cannot find **`update`** launcher: +> - Download [**`ConCygSys-installer.cmd`**](../../raw/master/ConCygSys-installer.cmd) *(right click > save link as)* to existing ConCygSys directory > - Launch **`ConCygSys-installer`** ## Customization -Open **`ConCygSys-installer`** with text editor on your PC before installation to get a control over the installation process. Available options will be in **SCRIPT SETTINGS** section. All settings are accompanied with description. [Preview](https://github.com/zhubanRuban/ConCygSys/blob/8a60a599a4ad8bff3d28bd0e9370370621a2668d/ConCygSys-installer.cmd#L9-L76) +Open **`ConCygSys-installer`** with text editor on your PC before installation to get a control over the installation process. Available options will be in **SCRIPT SETTINGS** section. All settings are accompanied with description. [Preview](ConCygSys-installer.cmd#L9-L70) If you have existing ConCygSys installation and would like to add/remove some components during next update, edit **:installoptions** section of **`update`** launcher. ## FAQ -- **What is the path to Windows drives when I'm in [Cygwin](https://www.cygwin.com/) console?** +- **What is the path to Windows drives when I'm in Cygwin console?** `/mnt/DRIVE` -BTW, different Windows files are symlinked in [Cygwin](https://www.cygwin.com/) environment. For instance, `/etc/hosts` file in [Cygwin](https://www.cygwin.com/) is linked to `%WINDIR%\System32\drivers\etc\hosts`. If you go to `/proc/registry` folder, you will see Windows registry structure. Many Windows programs can be executed from [Cygwin](https://www.cygwin.com/) as well, for instance: +BTW, different Windows files are symlinked in Cygwin environment. For instance, `/etc/hosts` file in Cygwin is linked to `%WINDIR%\System32\drivers\etc\hosts`. If you go to `/proc/registry` folder, you will see Windows registry structure. Many Windows programs can be executed from Cygwin as well, for instance: `ipconfig /flushdns` - to flush your local DNS cache -- **How to change default task for new tab in [ConEmu](https://conemu.github.io/)?** +- **How to change default task for new tab in ConEmu?** ConEmu settings>> Startup>> Tasks>> choose a desired task>> tick "Default task for new console">> Save settings -- **Can I change [Cygwin](https://www.cygwin.com/) username after installation?** +- **How to change Cygwin username or home folder after installation?** -No problem, just edit `CYGWIN_USERNAME=` line in **:cygwinsettings** section of **`update`** launcher in your ConCygSys directory. Restart [Cygwin](https://www.cygwin.com/). +Edit `CYGWIN_USERNAME=` or `HOME_FOLDER=` line in **:cygwinsettings** section of **`update`** launcher in your ConCygSys directory. Restart Cygwin. - **Сan I install a package from command line?** If you've chosen to install `apt-cyg` *(enabled by default in installer)*, you can istall packages from command line, for instance: -```bash +``` apt-cyg install nano ``` [More info about apt-cyg usage](https://github.com/transcode-open/apt-cyg) | [Available packages](https://cygwin.com/packages/package_list.html) -- **I cannot find a desired package in [Cygwin](https://www.cygwin.com/) repository, what should I do?** +- **I cannot find a desired package in Cygwin repository, what should I do?** -This can happen. Fortunately, the packages can still be built from source. `install cygwin` search query will give you the right answer in most cases. +This can happen. Fortunately, the packages can still be built from source. Below are some examples for the reference: -[MTR](https://github.com/traviscross/mtr) +[MTR](https://github.com/traviscross/mtr) | [ipmitool](https://stackoverflow.com/questions/12907005/ipmitool-for-windows) -[ipmitool](https://stackoverflow.com/questions/12907005/ipmitool-for-windows) +Pre-built packages: + +[MTR](https://github.com/zhubanRuban/mtr-mobaxterm-plugin-cygwin) | [ipmitool](https://github.com/zhubanRuban/ipmitool-mobaxterm-plugin-cygwin) - **Can I try beta version?** -No problem. There is [beta tree](https://github.com/zhubanRuban/ConCygSys/tree/beta) -> - Download **`ConCygSys-installer.cmd`** from [this link](https://github.com/zhubanRuban/ConCygSys/raw/beta/ConCygSys-installer.cmd) *(right click > save link as)* to existing ConCygSys directory +No problem. There is [beta tree](../../tree/beta) +> - Download **`ConCygSys-installer.cmd`** from [this link](../../raw/beta/ConCygSys-installer.cmd) *(right click > save link as)* to existing ConCygSys directory > - Launch **`ConCygSys-installer`** - **Where can I report an issue or get a support?** -[Here](https://github.com/zhubanRuban/ConCygSys/issues) +[Here](../../issues) - **How to check ConCygSys version?** The version can be found at the beginning of: - README.txt file - any launcher file - -## License - -All files are released under the [Apache License 2.0](https://github.com/zhubanRuban/ConCygSys/blob/master/LICENSE). From 0051e356c3ef463f35cf8426507814ed4e59ad90 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Thu, 29 Aug 2019 22:39:43 +0300 Subject: [PATCH 18/52] Update README.md - changed beta tree info and added issues and contribution badges - changed repo url --- README.md | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index a1d349c..2ed207a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ # ConCygSys -[![GitHub release (latest by date)](https://img.shields.io/github/v/release/zhubanRuban/ConCygSys?style=flat-square)](../../releases) -![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/zhubanRuban/ConCygSys?style=flat-square) -[![GitHub All Releases](https://img.shields.io/github/downloads/zhubanRuban/ConCygSys/total?style=flat-square)]((../../releases)) -![HitCount](http://hits.dwyl.io/zhubanRuban/ConCygSys.svg) -[![GitHub](https://img.shields.io/github/license/zhubanRuban/ConCygSys?style=flat-square)](LICENSE) +[![GitHub release (latest by date)](https://img.shields.io/github/v/release/zhubanRuban/ConCygSys-cygwin-portable?style=flat-square)](../../releases) +![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/zhubanRuban/ConCygSys-cygwin-portable?style=flat-square) +![HitCount](http://hits.dwyl.io/zhubanRuban/ConCygSys-cygwin-portable.svg) +[![GitHub](https://img.shields.io/github/license/zhubanRuban/ConCygSys-cygwin-portable?style=flat-square)](LICENSE) - [Description](#description) - [Features](#features) @@ -36,7 +35,7 @@ ## Installation -> Disable antivirus software on your PC during installation. [Why it is recommended](https://cygwin.com/faq/faq.html#faq.using.bloda) +> **Optional:** Disable antivirus software on your PC during installation. [Why it is recommended](https://cygwin.com/faq/faq.html#faq.using.bloda) - Download the [latest ConCygSys release](../../releases), extract the archive and go to the extracted folder @@ -93,9 +92,11 @@ Open **`ConCygSys-installer`** with text editor on your PC before installation t If you have existing ConCygSys installation and would like to add/remove some components during next update, edit **:installoptions** section of **`update`** launcher. +Also take a look at [cygwin extras collection](https://github.com/zhubanRuban/cygwin-extras). + ## FAQ -- **What is the path to Windows drives when I'm in Cygwin console?** +### What is the path to Windows drives when I'm in Cygwin console? `/mnt/DRIVE` @@ -103,15 +104,15 @@ BTW, different Windows files are symlinked in Cygwin environment. For instance, `ipconfig /flushdns` - to flush your local DNS cache -- **How to change default task for new tab in ConEmu?** +### How to change default task for new tab in ConEmu? -ConEmu settings>> Startup>> Tasks>> choose a desired task>> tick "Default task for new console">> Save settings +`ConEmu settings>> Startup>> Tasks>> choose a desired task>> tick "Default task for new console">> Save settings` -- **How to change Cygwin username or home folder after installation?** +### How to change Cygwin username or home folder after installation? Edit `CYGWIN_USERNAME=` or `HOME_FOLDER=` line in **:cygwinsettings** section of **`update`** launcher in your ConCygSys directory. Restart Cygwin. -- **Сan I install a package from command line?** +### Сan I install a package from command line? If you've chosen to install `apt-cyg` *(enabled by default in installer)*, you can istall packages from command line, for instance: @@ -121,7 +122,7 @@ apt-cyg install nano [More info about apt-cyg usage](https://github.com/transcode-open/apt-cyg) | [Available packages](https://cygwin.com/packages/package_list.html) -- **I cannot find a desired package in Cygwin repository, what should I do?** +### I cannot find a desired package in Cygwin repository, what should I do? This can happen. Fortunately, the packages can still be built from source. Below are some examples for the reference: @@ -132,18 +133,12 @@ Pre-built packages: [MTR](https://github.com/zhubanRuban/mtr-mobaxterm-plugin-cygwin) | [ipmitool](https://github.com/zhubanRuban/ipmitool-mobaxterm-plugin-cygwin) -- **Can I try beta version?** - -No problem. There is [beta tree](../../tree/beta) -> - Download **`ConCygSys-installer.cmd`** from [this link](../../raw/beta/ConCygSys-installer.cmd) *(right click > save link as)* to existing ConCygSys directory -> - Launch **`ConCygSys-installer`** - -- **Where can I report an issue or get a support?** - -[Here](../../issues) - -- **How to check ConCygSys version?** +### How to check ConCygSys version? The version can be found at the beginning of: - README.txt file - any launcher file + +### Where can I report an issue or get a support? + +[![GitHub issues](https://img.shields.io/github/issues-raw/zhubanRuban/ConCygSys-cygwin-portable?style=flat-square) ![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/zhubanRuban/ConCygSys-cygwin-portable?style=flat-square) ![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](../../issues) From 18f2e69e7fa8ca30383c4086803208586605dad0 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Thu, 29 Aug 2019 22:48:53 +0300 Subject: [PATCH 19/52] new repo name --- ConCygSys-installer.cmd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index fbe19f1..d0b3228 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -1,9 +1,9 @@ @echo off -:: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys +:: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys-cygwin-portable :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190829b3 +set CONCYGSYS_VERSION=190829b4 ::####################### begin SCRIPT SETTINGS #######################:: @@ -71,7 +71,7 @@ set MINTTY_OPTIONS= ^ echo. -set CONCYGSYS_LINK=https://github.com/zhubanRuban/ConCygSys +set CONCYGSYS_LINK=https://github.com/zhubanRuban/ConCygSys-cygwin-portable set CONCYGSYS_INFO=ConCygSys v.%CONCYGSYS_VERSION% %CONCYGSYS_LINK% echo [ %CONCYGSYS_INFO% ] echo. @@ -345,7 +345,7 @@ echo Generating one-file settings and updater file [%Concygsys_settings%]... echo echo. echo ^) ^>"%%DOWNLOADER%%" ^|^| goto :fail echo set INSTALLER=ConCygSys-installer.cmd - echo cscript //Nologo "%%DOWNLOADER%%" https://raw.githubusercontent.com/zhubanRuban/ConCygSys/beta/%%INSTALLER%% "%%INSTALLER%%" ^|^| goto :fail + echo cscript //Nologo "%%DOWNLOADER%%" https://raw.githubusercontent.com/zhubanRuban/ConCygSys-cygwin-portable/beta/%%INSTALLER%% "%%INSTALLER%%" ^|^| goto :fail echo start "" "%%INSTALLER%%" ^|^| goto :fail echo exit 0 echo :fail From 48cd156e51b2e6022b6a99419f6ae4b052afb542 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Thu, 29 Aug 2019 23:59:57 +0300 Subject: [PATCH 20/52] wmic, downloader, proxy - fix for "wmic is not recognized as an internal or external command, operable program or batch file." - phantom typo in downloader script - exclusion for proxy port if proxy host is not set --- ConCygSys-installer.cmd | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index d0b3228..b168cbc 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys-cygwin-portable :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190829b4 +set CONCYGSYS_VERSION=190829b5 ::####################### begin SCRIPT SETTINGS #######################:: @@ -93,14 +93,14 @@ if not exist "%CYGWIN_ROOT%" ( ) else ( echo Existing Cygwin folder detected [%CYGWIN_ROOT%], entering update mode... set UPDATEMODE=yes - wmic process get ExecutablePath 2>NUL | find /I "%CYGWIN_ROOT%">NUL + %SystemRoot%\System32\wbem\WMIC.exe process get ExecutablePath 2>NUL | find /I "%CYGWIN_ROOT%">NUL :: rem is used below instead of :: for commenting as loops produce "system cannot find disk" warning when using :: in miltiple lines rem why I didn't use if "%ERRORLEVEL%"=="0" rem https://social.technet.microsoft.com/Forums/en-US/e72cb532-3da0-4c7f-a61e-9ffbf8050b55/batch-errorlevel-always-reports-back-level-0?forum=ITCG if not ErrorLevel 1 ( echo. echo ^^!^^!^^! Active Cygwin processes detected, please close them and hit [ ENTER ] ^^!^^!^^! - wmic process get ExecutablePath | find /I "%CYGWIN_ROOT%" + %SystemRoot%\System32\wbem\WMIC.exe process get ExecutablePath | find /I "%CYGWIN_ROOT%" pause goto :retryupdate ) else ( @@ -108,7 +108,9 @@ if not exist "%CYGWIN_ROOT%" ( call "%Concygsys_settings%" cygwinsettings call "%Concygsys_settings%" installoptions if not "!PROXY_PORT!" == "" ( - set PROXY_HOST=%PROXY_HOST%:%PROXY_PORT% + if not "!PROXY_HOST!" == "" ( + set PROXY_HOST=%PROXY_HOST%:%PROXY_PORT% + ) ) ) echo. @@ -149,7 +151,6 @@ if "%PROXY_HOST%" == "" ( echo target = Wscript.Arguments(1^) echo WScript.Echo "Downloading '" ^& url ^& "' to '" ^& target ^& "'..." echo Set req = CreateObject("WinHttp.WinHttpRequest.5.1"^) - echo%DOWNLOADER_PROXY% echo req.Open "GET", url, False echo req.Send echo If req.Status ^<^> 200 Then From e8d3f00bd2634a7ee36fb8ae14562af25688fc30 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Fri, 30 Aug 2019 03:29:43 +0300 Subject: [PATCH 21/52] ssh-pageant, spaces, wslbridge, home and user vars - ssh-pageant wasn't executed due to missing escaping in generation script - added spaces between some installation steps - fix for phantom cygwin.tar.gz file in concygsys directory, wslbridge url was not parsed properly - fix for home folder and username not being set properly --- ConCygSys-installer.cmd | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index b168cbc..2d02152 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys-cygwin-portable :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190829b5 +set CONCYGSYS_VERSION=190830b ::####################### begin SCRIPT SETTINGS #######################:: @@ -100,6 +100,7 @@ if not exist "%CYGWIN_ROOT%" ( if not ErrorLevel 1 ( echo. echo ^^!^^!^^! Active Cygwin processes detected, please close them and hit [ ENTER ] ^^!^^!^^! + echo ============================================================================= %SystemRoot%\System32\wbem\WMIC.exe process get ExecutablePath | find /I "%CYGWIN_ROOT%" pause goto :retryupdate @@ -118,6 +119,7 @@ if not exist "%CYGWIN_ROOT%" ( if not "!UPDATECYGWINONLY!" == "" goto :updatecygwinonly echo. echo ^^!^^!^^! Before you proceed with update... ^^!^^!^^! + echo ========================================= echo. echo Please backup your cygwin home directory just in case echo. @@ -127,6 +129,7 @@ if not exist "%CYGWIN_ROOT%" ( echo - re-run update echo. echo If you are good with existing setup, just hit [ ENTER ] to start update + echo ======================================================================= echo. pause ) @@ -252,10 +255,8 @@ echo Creating init script to keep the installation portable [%Portable_init%]... echo # setting path variable as it is not defined at this point echo PATH=/usr/local/bin:/usr/bin echo # setting custom cygwin username in passwd file, if not empty - echo if [ ! -z "$CYGWIN_USERNAME" ]; then - echo ( - echo mkpasswd -c^|awk -F: -v OFS=: "{\$1=\"$CYGWIN_USERNAME\"; \$6=\"$(cygpath -u "$HOME"^)\"; print}" - echo ^) ^>/etc/passwd + echo if [ ! -z "$CYGWIN_USERNAME" -o ! -z "$HOME_FOLDER" ]; then + echo mkpasswd -c^|awk -F: -v OFS=: "{\$1=\"$USER\"; \$6=\"$(cygpath -u "$HOME"^)\"; print}" ^>/etc/passwd echo else echo rm -f /etc/passwd echo fi @@ -310,11 +311,8 @@ echo Generating one-file settings and updater file [%Concygsys_settings%]... echo set CYGWIN_ROOT=%%~dp0cygwin echo cd /d "%%CYGWIN_ROOT%%\bin" echo call "%%~dp0%Concygsys_settings_name%" cygwinsettings - echo if not "%%HOME_FOLDER%%" == "" ( - echo set HOME=%%HOME_FOLDER%% - echo ^) else ( - echo set HOME=/home/concygsys - echo ^) + echo if "%%CYGWIN_USERNAME%%" == "" (set USER=%%USERNAME%%^) else (set USER=%%CYGWIN_USERNAME%%^) + echo if "%%HOME_FOLDER%%" == "" (set HOME=/home/concygsys^) else (set HOME=%%HOME_FOLDER%%^) echo rd /s /q "%%CYGWIN_ROOT%%\pkg-cache" 2^>NUL echo type NUL ^>"%%CYGWIN_ROOT%%\etc\fstab" echo "%%CYGWIN_ROOT%%\bin\bash" "%%CYGWIN_ROOT%%\%Portable_init_name%" @@ -444,7 +442,7 @@ echo Creating script to install required and additional software [%Post_install% echo # removing old proxy implementation echo rm -f /opt/bash_proxy echo sed -i '/bash_proxy/d' "$bashrc_f" - echo echo Adding proxy settings... + echo echo; echo Adding proxy settings... echo ( echo echo export http_proxy=\"http://%PROXY_HOST%\" echo echo export https_proxy=\"https://%PROXY_HOST%\" @@ -458,7 +456,7 @@ echo Creating script to install required and additional software [%Post_install% if "%INSTALL_CONEMU%" == "yes" ( echo if [ ! -e "$conemu_dir" ]; then echo conemu_url="https://github.com$(wget https://github.com/Maximus5/ConEmu/releases/latest -O - 2>/dev/null | egrep '/.*/releases/download/.*/.*7z' -o)" - echo echo "Installing ConEmu from $conemu_url" + echo echo; echo "Installing ConEmu from $conemu_url" echo wget -nv --show-progress -O "${conemu_dir}.7z" "$conemu_url" ^&^& \ echo mkdir -p "$conemu_dir" ^&^& \ echo echo "Extracting ConEmu from archive..." ^&^& \ @@ -470,8 +468,8 @@ echo Creating script to install required and additional software [%Post_install% echo rm -rf "$conemu_dir" ) if "%INSTALL_WSLBRIDGE%" == "yes" ( - echo wslbridge_url="https://github.com$(wget https://github.com/rprichard/wslbridge/releases/latest -O - 2>/dev/null | egrep '/.*/releases/download/.*/.*cygwin${CYGWIN_ARCH}.tar.gz' -o)" - echo echo "Installing WSLbridge from $wslbridge_url" + echo wslbridge_url="https://github.com$(wget https://github.com/rprichard/wslbridge/releases/latest -O - 2>/dev/null | egrep '/.*/releases/download/.*/.*cygwin%CYGWIN_ARCH%.tar.gz' -o)" + echo echo; echo "Installing WSLbridge from $wslbridge_url" echo wget -nv --show-progress -O "${CYGWIN_ROOT}.tar.gz" "$wslbridge_url" ^&^& \ echo echo "Extracting WSLbridge from archive..." ^&^& \ echo bsdtar -xf "${CYGWIN_ROOT}.tar.gz" --strip-components=1 -C "${CYGWIN_ROOT}/bin/" '*/wslbridge*' ^&^& \ @@ -480,7 +478,7 @@ echo Creating script to install required and additional software [%Post_install% echo rm -f "${CYGWIN_ROOT}/bin/wslbridge"* ) if "%INSTALL_APT_CYG%" == "yes" ( - echo echo "Installing/updating apt-cyg..." + echo echo; echo "Installing/updating apt-cyg..." echo wget -nv --show-progress -O /usr/local/bin/apt-cyg https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg echo chmod +x /usr/local/bin/apt-cyg ) else ( @@ -490,8 +488,8 @@ echo Creating script to install required and additional software [%Post_install% echo # removing old ssh agent tweak implementation echo rm -f /opt/ssh-agent-tweak echo sed -i '/ssh-agent-tweak/d' "$bashrc_f" - echo echo Adding SSH agent tweak... - echo eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-$USERNAME"^) ^> /etc/profile.d/sshagenttweak.sh || goto :fail + echo echo; echo Adding SSH agent tweak... + echo echo eval \$\(/usr/bin/ssh-pageant -r -a \"/tmp/.ssh-pageant-\$USERNAME\"\^) ^> /etc/profile.d/sshagenttweak.sh || goto :fail ) else ( echo rm -f /etc/profile.d/sshagenttweak.sh ) @@ -631,9 +629,9 @@ del "%INSTALL_ROOT%README.md" >NUL 2>&1 echo. if "%UPDATEMODE%" == "yes" ( - echo [ Update SUCCEEDED! ] + echo ====================== [ Update SUCCEEDED! ] ===================== ) else ( - echo [ Installation SUCCEEDED! ] + echo =================== [ Installation SUCCEEDED! ] ================== ) echo. echo Use launchers in [%INSTALL_ROOT%] to run Cygwin Portable. @@ -647,10 +645,10 @@ exit 0 :fail echo. if "%UPDATEMODE%" == "yes" ( - echo [ Update FAILED! ] + echo ======================= [ Update FAILED! ] ======================= echo Try uploading installer manually from %CONCYGSYS_LINK% ) else ( - echo [ Installation FAILED! ] + echo ==================== [ Installation FAILED! ] ==================== ) echo. pause From fe0c5dde51d694ca008a194413af644d45413467 Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Fri, 30 Aug 2019 17:54:22 +0300 Subject: [PATCH 22/52] mkpasswd (home), PATH, env (bash), settings, cd --- ConCygSys-installer.cmd | 55 +++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index 2d02152..9dea162 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,30 +3,34 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys-cygwin-portable :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190830b +set CONCYGSYS_VERSION=190830b2 ::####################### begin SCRIPT SETTINGS #######################:: :: You can customize the following variables to your needs before running the batch file -:: choose a user name under Cygwin, leave empty to use your Windows username +:: Custom Cygwin username +:: Leave empty to use your Windows username set CYGWIN_USERNAME= -:: custom home folder path (!) without quotes ' ", leave empty to use default one - /home/concygsys -:: examples: +:: Custom home folder path (!) without quotes ' " +:: Leave empty to use default one - /home/concygsys +:: Examples: +:: /home/cygwinhome :: C:\cygwinhome :: C:\Users\yourusername\Documents\cygwinhome :: %USERPROFILE%\Documents\cygwinhome set HOME_FOLDER= -:: override OS architecture: "32" bit or "64" bit system, leave empty for autodetect +:: Override OS architecture, if required: "32" bit or "64" bit system +:: Leave empty for autodetect set CYGWIN_ARCH= -:: change the URL to the closest mirror: https://cygwin.com/mirrors.html -:: do not leave empty +:: Change the URL to the closest mirror: https://cygwin.com/mirrors.html +:: Do not leave empty set CYGWIN_MIRROR=http://ftp.inf.tu-dresden.de/software/windows/cygwin32 -:: select the packages to be installed automatically: https://cygwin.com/packages/package_list.html +:: Select the packages to be installed automatically: https://cygwin.com/packages/package_list.html set CYGWIN_PACKAGES=bind-utils,inetutils,openssh,vim,whois :: Cygwin uses ACLs to implement real Unix permissions which are not supported by Windows: https://cygwin.com/cygwin-ug-net/using-filemodes.html @@ -37,27 +41,30 @@ set CYGWIN_PACKAGES=bind-utils,inetutils,openssh,vim,whois :: Maximal: "-rw-r--r--" or "644". Files with exe extension or beginning with shebang will automatically have 755 permissions set INSTALL_ACL=no -:: install apt-cyg command line package manager: https://github.com/transcode-open/apt-cyg +:: Install apt-cyg command line package manager: https://github.com/transcode-open/apt-cyg +:: Why not using https://github.com/kou1okada/apt-cyg? +:: Cause 1: https://github.com/kou1okada/apt-cyg#requirements +:: Cause 2: https://github.com/kou1okada/apt-cyg/issues/24 set INSTALL_APT_CYG=yes -:: install SSH agent tweak https://github.com/cuviper/ssh-pageant +:: Install SSH agent tweak https://github.com/cuviper/ssh-pageant set INSTALL_SSH_AGENT_TWEAK=yes -:: install WSLbridge to allowing to access WSL via Mintty https://github.com/rprichard/wslbridge +:: Install WSLbridge to allowing to access WSL via Mintty https://github.com/rprichard/wslbridge set INSTALL_WSLBRIDGE=yes -:: install multitab terminal https://conemu.github.io/ +:: Install ConEmu quake-style terminal https://conemu.github.io/ set INSTALL_CONEMU=yes :: https://conemu.github.io/en/ConEmuArgs.html set CONEMU_OPTIONS= -:: set proxy if required, in the following formats: +:: Set proxy, if required, in the following formats: :: proxy:port :: username:password@proxy:port set PROXY_HOST= -:: set Mintty options used in ConEmu task: https://cdn.rawgit.com/mintty/mintty/master/docs/mintty.1.html#CONFIGURATION -:: the main goal is to set options (they will overwrite whatyou configured in main Mintty window) to make Mintty working properly with ConEmu +:: Set Mintty options used in ConEmu task: https://cdn.rawgit.com/mintty/mintty/master/docs/mintty.1.html#CONFIGURATION +:: The main goal is to set options (they will overwrite whatyou configured in main Mintty window) to make Mintty working properly with ConEmu set MINTTY_OPTIONS= ^ -o FontHeight=10 ^ -o BoldAsFont=yes ^ @@ -250,16 +257,12 @@ set Portable_init_name=portable-init.sh set Portable_init=%CYGWIN_ROOT%\%Portable_init_name% echo Creating init script to keep the installation portable [%Portable_init%]... ( - echo #!/usr/bin/env bash + echo #!/bin/bash echo # %CONCYGSYS_INFO% echo # setting path variable as it is not defined at this point - echo PATH=/usr/local/bin:/usr/bin + echo PATH=/usr/local/bin:/usr/bin:/bin echo # setting custom cygwin username in passwd file, if not empty - echo if [ ! -z "$CYGWIN_USERNAME" -o ! -z "$HOME_FOLDER" ]; then - echo mkpasswd -c^|awk -F: -v OFS=: "{\$1=\"$USER\"; \$6=\"$(cygpath -u "$HOME"^)\"; print}" ^>/etc/passwd - echo else - echo rm -f /etc/passwd - echo fi + echo mkpasswd -c^|awk -F: -v OFS=: "{\$1=\"$USER\"; \$6=\"$(cygpath -u "$HOME"^)\"; print}" ^>/etc/passwd echo # generating custom fstab in case ACL is set to no echo ( if not "%INSTALL_ACL%" == "yes" ( @@ -306,16 +309,14 @@ echo Generating one-file settings and updater file [%Concygsys_settings%]... echo exit /b 0 echo. echo :launcherheader - echo setlocal enableextensions - echo set TERM= echo set CYGWIN_ROOT=%%~dp0cygwin - echo cd /d "%%CYGWIN_ROOT%%\bin" echo call "%%~dp0%Concygsys_settings_name%" cygwinsettings echo if "%%CYGWIN_USERNAME%%" == "" (set USER=%%USERNAME%%^) else (set USER=%%CYGWIN_USERNAME%%^) echo if "%%HOME_FOLDER%%" == "" (set HOME=/home/concygsys^) else (set HOME=%%HOME_FOLDER%%^) echo rd /s /q "%%CYGWIN_ROOT%%\pkg-cache" 2^>NUL echo type NUL ^>"%%CYGWIN_ROOT%%\etc\fstab" echo "%%CYGWIN_ROOT%%\bin\bash" "%%CYGWIN_ROOT%%\%Portable_init_name%" + echo cd /d "%%CYGWIN_ROOT%%\bin" echo exit /b 0 echo. echo :update @@ -426,8 +427,8 @@ set Post_install=%CYGWIN_ROOT%\post-install.sh echo. echo Creating script to install required and additional software [%Post_install%]... ( - echo #!/usr/bin/env bash - echo PATH=/usr/local/bin:/usr/bin + echo #!/bin/bash + echo PATH=/usr/local/bin:/usr/bin:/bin echo bashrc_f=${HOME}/.bashrc echo # https://github.com/zhubanRuban/cygwin-extras/blob/master/inputrc_custom_bind echo ( From ae943787d32d1551257e4499ba0ac074a051409d Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Sun, 1 Sep 2019 21:17:01 +0300 Subject: [PATCH 23/52] username, mirror, downloader, taskkill, postinstall, launcher interim update, incomplete - username change disabled - taskkill added to terminate process prior to update - less lines for downloader code - postinstall moved from standalone sh script to cmd requests via bash - launcher revision --- ConCygSys-installer.cmd | 377 ++++++++++++++++------------------------ 1 file changed, 153 insertions(+), 224 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index 9dea162..ffcde20 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,15 +3,10 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys-cygwin-portable :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190830b2 +set CONCYGSYS_VERSION=190901b1 -::####################### begin SCRIPT SETTINGS #######################:: -:: You can customize the following variables to your needs before running the batch file - -:: Custom Cygwin username -:: Leave empty to use your Windows username -set CYGWIN_USERNAME= +::======================= begin SCRIPT SETTINGS ======================= :: Custom home folder path (!) without quotes ' " :: Leave empty to use default one - /home/concygsys @@ -26,9 +21,8 @@ set HOME_FOLDER= :: Leave empty for autodetect set CYGWIN_ARCH= -:: Change the URL to the closest mirror: https://cygwin.com/mirrors.html -:: Do not leave empty -set CYGWIN_MIRROR=http://ftp.inf.tu-dresden.de/software/windows/cygwin32 +:: You can choose the closest mirror: https://cygwin.com/mirrors.html +set CYGWIN_MIRROR= :: Select the packages to be installed automatically: https://cygwin.com/packages/package_list.html set CYGWIN_PACKAGES=bind-utils,inetutils,openssh,vim,whois @@ -74,22 +68,23 @@ set MINTTY_OPTIONS= ^ -o ScrollbackLines=5000 ^ -o Transparency=off ^ -o ConfirmExit=no -::####################### end SCRIPT SETTINGS #######################:: + +::======================= end SCRIPT SETTINGS ======================= echo. set CONCYGSYS_LINK=https://github.com/zhubanRuban/ConCygSys-cygwin-portable set CONCYGSYS_INFO=ConCygSys v.%CONCYGSYS_VERSION% %CONCYGSYS_LINK% -echo [ %CONCYGSYS_INFO% ] +echo %CONCYGSYS_INFO% echo. :: %~dp0 means current directory with backslash at the end set INSTALL_ROOT=%~dp0 - set CYGWIN_ROOT=%INSTALL_ROOT%cygwin set Concygsys_settings_name=update.cmd set Concygsys_settings=%INSTALL_ROOT%%Concygsys_settings_name% + :: to use 'set' in full in 'if' loop below: https://ss64.com/nt/delayedexpansion.html setlocal EnableDelayedExpansion @@ -101,28 +96,27 @@ if not exist "%CYGWIN_ROOT%" ( echo Existing Cygwin folder detected [%CYGWIN_ROOT%], entering update mode... set UPDATEMODE=yes %SystemRoot%\System32\wbem\WMIC.exe process get ExecutablePath 2>NUL | find /I "%CYGWIN_ROOT%">NUL - :: rem is used below instead of :: for commenting as loops produce "system cannot find disk" warning when using :: in miltiple lines - rem why I didn't use if "%ERRORLEVEL%"=="0" - rem https://social.technet.microsoft.com/Forums/en-US/e72cb532-3da0-4c7f-a61e-9ffbf8050b55/batch-errorlevel-always-reports-back-level-0?forum=ITCG + :: multiple :: in if loop causing "system cannot find disk" warning, using rem further + rem why not using "%ERRORLEVEL%"=="0": https://social.technet.microsoft.com/Forums/en-US/e72cb532-3da0-4c7f-a61e-9ffbf8050b55/batch-errorlevel-always-reports-back-level-0?forum=ITCG if not ErrorLevel 1 ( echo. - echo ^^!^^!^^! Active Cygwin processes detected, please close them and hit [ ENTER ] ^^!^^!^^! - echo ============================================================================= + echo ^^!^^!^^! Active Cygwin processes detected ^^!^^!^^! + echo ========================================== %SystemRoot%\System32\wbem\WMIC.exe process get ExecutablePath | find /I "%CYGWIN_ROOT%" + echo. + echo Would you like me to terminate them? (Close this window to terminate them manually and re-run update) pause + for /f "usebackq tokens=2" %i in (`%SystemRoot%\System32\wbem\WMIC.exe process get ProcessId^, ExecutablePath ^| find /I "%CYGWIN_ROOT%"`) do taskkill /f /pid %i goto :retryupdate ) else ( if exist "%Concygsys_settings%" ( call "%Concygsys_settings%" cygwinsettings call "%Concygsys_settings%" installoptions - if not "!PROXY_PORT!" == "" ( - if not "!PROXY_HOST!" == "" ( - set PROXY_HOST=%PROXY_HOST%:%PROXY_PORT% - ) - ) + if not "!PROXY_PORT!" == "" (if not "!PROXY_HOST!" == "" (set PROXY_HOST=!PROXY_HOST!:!PROXY_PORT!)) + if not "!HOME_FOLDER!" == "" (set CYGWIN_HOME=!HOME_FOLDER!) ) echo. - set /p UPDATECYGWINONLY= [ 1 then ENTER] - update Cygwin only [ ENTER ] - update everything + set /p UPDATECYGWINONLY= [1] then [Enter] : update Cygwin only [Enter] : update everything if not "!UPDATECYGWINONLY!" == "" goto :updatecygwinonly echo. echo ^^!^^!^^! Before you proceed with update... ^^!^^!^^! @@ -135,98 +129,70 @@ if not exist "%CYGWIN_ROOT%" ( echo - modify :installoptions section of [%Concygsys_settings%] file echo - re-run update echo. - echo If you are good with existing setup, just hit [ ENTER ] to start update + echo If you are good with existing setup, just hit [Enter] to start update echo ======================================================================= echo. pause ) ) -:: not needed anymore and to prevent issues in bash script generation down below (they conatin ! which should have been escaped by ^^) setlocal DisableDelayedExpansion + :updatecygwinonly -:: There is no true-commandline download tool in Windows -:: creating VB script that can download files... -:: not using PowerShell which may be blocked by group policies -set DOWNLOADER=%INSTALL_ROOT%downloader.vbs +:: Creating VB script that can download files, not using PowerShell which may be blocked by group policies +set DOWNLOADER=%INSTALL_ROOT%ConCygSys-downloader.vbs +set GENDOWNLOADER=%INSTALL_ROOT%ConCygSys-downloader-generator.vbs echo. echo Creating script that can download files [%DOWNLOADER%]... -if "%PROXY_HOST%" == "" ( - set DOWNLOADER_PROXY=. -) else ( - set DOWNLOADER_PROXY= req.SetProxy 2, "%PROXY_HOST%", "" -) +if "%PROXY_HOST%" == "" (set DOWNLOADER_PROXY=.) else (set DOWNLOADER_PROXY= req.SetProxy 2, "%PROXY_HOST%", "") ( - echo url = Wscript.Arguments(0^) - echo target = Wscript.Arguments(1^) - echo WScript.Echo "Downloading '" ^& url ^& "' to '" ^& target ^& "'..." - echo Set req = CreateObject("WinHttp.WinHttpRequest.5.1"^) - echo req.Open "GET", url, False - echo req.Send - echo If req.Status ^<^> 200 Then - echo WScript.Echo "FAILED to download: HTTP Status " ^& req.Status - echo WScript.Quit 1 - echo End If - echo Set buff = CreateObject("ADODB.Stream"^) - echo buff.Open - echo buff.Type = 1 - echo buff.Write req.ResponseBody - echo buff.Position = 0 - echo buff.SaveToFile target - echo buff.Close - echo. -) >"%DOWNLOADER%" || goto :fail + echo echo url = Wscript.Arguments(0^) + echo echo target = Wscript.Arguments(1^) + echo echo WScript.Echo "Downloading '" ^& url ^& "' to '" ^& target ^& "'..." + echo echo Set req = CreateObject("WinHttp.WinHttpRequest.5.1"^) + echo echo%DOWNLOADER_PROXY% + echo echo req.Open "GET", url, False + echo echo req.Send + echo echo If req.Status ^<^> 200 Then + echo echo WScript.Echo "FAILED to download: HTTP Status " ^& req.Status + echo echo WScript.Quit 1 + echo echo End If + echo echo Set buff = CreateObject("ADODB.Stream"^) + echo echo buff.Open + echo echo buff.Type = 1 + echo echo buff.Write req.ResponseBody + echo echo buff.Position = 0 + echo echo buff.SaveToFile target + echo echo buff.Close + echo echo. +) > "%GENDOWNLOADER%" || goto :fail +call "%GENDOWNLOADER%" > "%DOWNLOADER%" echo. if "%CYGWIN_ARCH%" == "" ( echo CYGWIN_ARCH setting is empty, autodetecting... if "%PROCESSOR_ARCHITECTURE%" == "x86" ( - if defined PROCESSOR_ARCHITEW6432 ( - set CYGWIN_ARCH=64 - ) else ( - set CYGWIN_ARCH=32 - ) - ) else ( - set CYGWIN_ARCH=64 - ) + if defined PROCESSOR_ARCHITEW6432 (set CYGWIN_ARCH=64) else (set CYGWIN_ARCH=32) + ) else (set CYGWIN_ARCH=64) ) echo Choosing correct version of Cygwin installer... -if "%CYGWIN_ARCH%" == "64" ( - set CYGWIN_SETUP=setup-x86_64.exe -) else ( - set CYGWIN_SETUP=setup-x86.exe -) +if "%CYGWIN_ARCH%" == "64" (set CYGWIN_SETUP=setup-x86_64.exe) else (set CYGWIN_SETUP=setup-x86.exe) echo Chosen installer: %CYGWIN_SETUP% - -:: downloading Cygwin installer -echo. -del "%CYGWIN_ROOT%\%CYGWIN_SETUP%" >NUL 2>&1 +del "%CYGWIN_ROOT%\setup-*.exe" >NUL 2>&1 cscript //Nologo "%DOWNLOADER%" https://cygwin.org/%CYGWIN_SETUP% "%CYGWIN_ROOT%\%CYGWIN_SETUP%" || goto :fail -del "%DOWNLOADER%" >NUL 2>&1 - -:: Cygwin command line options: https://cygwin.com/faq/faq.html#faq.setup.cli -if "%PROXY_HOST%" == "" ( - set CYGWIN_PROXY= -) else ( - set CYGWIN_PROXY=--proxy "%PROXY_HOST%" -) +:: https://cygwin.com/faq/faq.html#faq.setup.cli +if "%CYGWIN_MIRROR%" == "" (set CYGWIN_MIRROR=http://ftp.inf.tu-dresden.de/software/windows/cygwin32) +if "%PROXY_HOST%" == "" (set CYGWIN_PROXY=) else (set CYGWIN_PROXY=--proxy "%PROXY_HOST%") :: adding required packages for special software -if "%INSTALL_CONEMU%" == "yes" ( - set CYGWIN_PACKAGES=bsdtar,wget,%CYGWIN_PACKAGES% -) -if "%INSTALL_WSLBRIDGE%" == "yes" ( - set CYGWIN_PACKAGES=bsdtar,wget,%CYGWIN_PACKAGES% -) -if "%INSTALL_APT_CYG%" == "yes" ( - set CYGWIN_PACKAGES=wget,%CYGWIN_PACKAGES% -) -if "%INSTALL_SSH_AGENT_TWEAK%" == "yes" ( - set CYGWIN_PACKAGES=openssh,ssh-pageant,%CYGWIN_PACKAGES% -) +if "%INSTALL_CONEMU%" == "yes" (set CYGWIN_PACKAGES=bsdtar,wget,%CYGWIN_PACKAGES%) +if "%INSTALL_WSLBRIDGE%" == "yes" (set CYGWIN_PACKAGES=bsdtar,wget,%CYGWIN_PACKAGES%) +if "%INSTALL_APT_CYG%" == "yes" (set CYGWIN_PACKAGES=wget,%CYGWIN_PACKAGES%) +if "%INSTALL_SSH_AGENT_TWEAK%" == "yes" (set CYGWIN_PACKAGES=openssh,ssh-pageant,%CYGWIN_PACKAGES%) +if "%CYGWIN_MIRROR%" == "" (set CYGWIN_MIRROR=http://ftp.inf.tu-dresden.de/software/windows/cygwin32) -:: all Cygwin installer commandline options: https://www.cygwin.com/faq/faq.html#faq.setup.cli +:: https://www.cygwin.com/faq/faq.html#faq.setup.cli echo. echo Running Cygwin setup... "%CYGWIN_ROOT%\%CYGWIN_SETUP%" ^ @@ -245,10 +211,11 @@ echo Running Cygwin setup... --upgrade-also || goto :fail :: warning for standard Cygwin launcher -echo %CONCYGSYS_INFO% >"%CYGWIN_ROOT%\DO-NOT-LAUNCH-CYGWIN-FROM-HERE" +echo %CONCYGSYS_INFO% > "%CYGWIN_ROOT%\DO-NOT-LAUNCH-CYGWIN-FROM-HERE" if not "%UPDATECYGWINONLY%" == "" goto :aftercygwinupdate - +set BASH="%CYGWIN_ROOT%\bin\bash" --noprofile --norc -c +set DOS2UNIX="%CYGWIN_ROOT%\bin\dos2unix" echo. echo Creating portable settings files... @@ -275,9 +242,9 @@ echo Creating init script to keep the installation portable [%Portable_init%]... echo # adjust Cygwin packages cache path echo pkg_cache_dir=$(cygpath -w "$CYGWIN_ROOT/pkg-cache"^) echo sed -i '/^^last-cache/!b;n;c\\t'"${pkg_cache_dir//\\/\\\\}"'' /etc/setup/setup.rc -) >"%Portable_init%" || goto :fail +) > "%Portable_init%" || goto :fail -"%CYGWIN_ROOT%\bin\dos2unix" "%Portable_init%" || goto :fail +%DOS2UNIX% "%Portable_init%" || goto :fail echo Generating one-file settings and updater file [%Concygsys_settings%]... ( @@ -314,7 +281,7 @@ echo Generating one-file settings and updater file [%Concygsys_settings%]... echo if "%%CYGWIN_USERNAME%%" == "" (set USER=%%USERNAME%%^) else (set USER=%%CYGWIN_USERNAME%%^) echo if "%%HOME_FOLDER%%" == "" (set HOME=/home/concygsys^) else (set HOME=%%HOME_FOLDER%%^) echo rd /s /q "%%CYGWIN_ROOT%%\pkg-cache" 2^>NUL - echo type NUL ^>"%%CYGWIN_ROOT%%\etc\fstab" + echo type NUL ^> "%%CYGWIN_ROOT%%\etc\fstab" echo "%%CYGWIN_ROOT%%\bin\bash" "%%CYGWIN_ROOT%%\%Portable_init_name%" echo cd /d "%%CYGWIN_ROOT%%\bin" echo exit /b 0 @@ -325,25 +292,8 @@ echo Generating one-file settings and updater file [%Concygsys_settings%]... echo set DOWNLOADER=%%INSTALL_ROOT%%downloader.vbs echo echo Creating a script that can download files [%%DOWNLOADER%%]... echo ( - echo echo url = Wscript.Arguments(0^^^) - echo echo target = Wscript.Arguments(1^^^) - echo echo WScript.Echo "Downloading '" ^^^& url ^^^& "' to '" ^^^& target ^^^& "'..." - echo echo Set req = CreateObject("WinHttp.WinHttpRequest.5.1"^^^) - echo echo req.Open "GET", url, False - echo echo req.Send - echo echo If req.Status ^^^<^^^> 200 Then - echo echo WScript.Echo "FAILED to download: HTTP Status " ^^^& req.Status - echo echo WScript.Quit 1 - echo echo End If - echo echo Set buff = CreateObject("ADODB.Stream"^^^) - echo echo buff.Open - echo echo buff.Type = 1 - echo echo buff.Write req.ResponseBody - echo echo buff.Position = 0 - echo echo buff.SaveToFile target - echo echo buff.Close - echo echo. - echo ^) ^>"%%DOWNLOADER%%" ^|^| goto :fail + call "%GENDOWNLOADER%" + echo ^) ^> "%%DOWNLOADER%%" ^|^| goto :fail echo set INSTALLER=ConCygSys-installer.cmd echo cscript //Nologo "%%DOWNLOADER%%" https://raw.githubusercontent.com/zhubanRuban/ConCygSys-cygwin-portable/beta/%%INSTALLER%% "%%INSTALLER%%" ^|^| goto :fail echo start "" "%%INSTALLER%%" ^|^| goto :fail @@ -356,15 +306,14 @@ echo Generating one-file settings and updater file [%Concygsys_settings%]... echo echo. echo pause echo exit 1 -) >"%Concygsys_settings%" || goto :fail +) > "%Concygsys_settings%" || goto :fail echo. -echo Generating main launchers... - -set Launch_cmd=%INSTALL_ROOT%Cygwin-Cmd.cmd -echo Generating cmd launcher [%Launch_cmd%]... +echo Generating launcher... +::================================================ ( + echo @echo off echo :: %CONCYGSYS_INFO% echo call "%%~dp0%Concygsys_settings_name%" launcherheader @@ -373,7 +322,7 @@ echo Generating cmd launcher [%Launch_cmd%]... echo ^) else ( echo "%%CYGWIN_ROOT%%\bin\bash.exe" --login -c "%%*" echo ^) -) >"%Launch_cmd%" || goto :fail +) > "%Launch_cmd%" || goto :fail set Launch_conemu=%INSTALL_ROOT%Cygwin-ConEmu.cmd if "%INSTALL_CONEMU%" == "yes" ( @@ -388,7 +337,7 @@ if "%INSTALL_CONEMU%" == "yes" ( echo start "" "%%~dp0conemu\ConEmu.exe" %CONEMU_OPTIONS% ) echo exit 0 - ) >"%Launch_conemu%" || goto :fail + ) > "%Launch_conemu%" || goto :fail ) else ( echo Removing ConEmu launcher [%Launch_conemu%]... del "%Launch_conemu%" >NUL 2>&1 @@ -402,109 +351,92 @@ echo Generating Mintty launcher [%Launch_mintty%]... echo call "%%~dp0%Concygsys_settings_name%" launcherheader echo start "" "%%CYGWIN_ROOT%%\bin\mintty.exe" - echo exit 0 -) >"%Launch_mintty%" || goto :fail +) > "%Launch_mintty%" || goto :fail set Launch_wsltty=%INSTALL_ROOT%Cygwin-WSLtty.cmd if "%INSTALL_WSLBRIDGE%" == "yes" ( - echo Generating WSLtty launcher [%Launch_wsltty%]... ( echo @echo off echo :: %CONCYGSYS_INFO% echo start "" "%%~dp0cygwin\bin\mintty.exe" --WSL= -~ echo exit 0 - ) >"%Launch_wsltty%" || goto :fail + ) > "%Launch_wsltty%" || goto :fail ) else ( echo Removing WSLtty launcher [%Launch_wsltty%]... del "%Launch_wsltty%" >NUL 2>&1 ) -echo. -echo Launching bash once to initialize user home dir... -call "%Launch_cmd%" whoami || goto :fail + echo. + echo :update + echo echo [ %CONCYGSYS_INFO% ] + echo set INSTALL_ROOT=%%~dp0 + echo set DOWNLOADER=%%INSTALL_ROOT%%downloader.vbs + echo echo Creating a script that can download files [%%DOWNLOADER%%]... + echo ( + call "%GENDOWNLOADER%" + echo ^) ^> "%%DOWNLOADER%%" ^|^| goto :fail + echo set INSTALLER=ConCygSys-installer.cmd + echo cscript //Nologo "%%DOWNLOADER%%" https://raw.githubusercontent.com/zhubanRuban/ConCygSys-cygwin-portable/beta/%%INSTALLER%% "%%INSTALLER%%" ^|^| goto :fail + echo start "" "%%INSTALLER%%" ^|^| goto :fail + echo exit 0 + echo :fail + echo del "%%DOWNLOADER%%" ^>NUL 2^>^&1 + echo echo. + echo echo !!! Update FAILED !!! + echo echo Try uploading installer manually from %CONCYGSYS_LINK% + echo echo. + echo pause + echo exit 1 +) > "%INSTALL_ROOT%\Cygwin.cmd" || goto :fail +::================================================ -set Post_install=%CYGWIN_ROOT%\post-install.sh echo. -echo Creating script to install required and additional software [%Post_install%]... -( - echo #!/bin/bash - echo PATH=/usr/local/bin:/usr/bin:/bin - echo bashrc_f=${HOME}/.bashrc - echo # https://github.com/zhubanRuban/cygwin-extras/blob/master/inputrc_custom_bind - echo ( - echo echo bind \'\"\\e[1\;5C\": forward-word\' \# ctrl + right - echo echo bind \'\"\\e[1\;5D\": backward-word\' \# ctrl + left - echo ^) ^> /etc/profile.d/inputrctweak.sh - if not "%PROXY_HOST%" == "" ( - echo export http_proxy="http://%PROXY_HOST%" - echo export https_proxy="https://%PROXY_HOST%" - echo export ftp_proxy="ftp://%PROXY_HOST%" - echo export no_proxy="127.0.0.1,localhost,$HOSTNAME,$COMPUTERNAME" - echo # removing old proxy implementation - echo rm -f /opt/bash_proxy - echo sed -i '/bash_proxy/d' "$bashrc_f" - echo echo; echo Adding proxy settings... - echo ( - echo echo export http_proxy=\"http://%PROXY_HOST%\" - echo echo export https_proxy=\"https://%PROXY_HOST%\" - echo echo export ftp_proxy=\"ftp://%PROXY_HOST%\" - echo echo export no_proxy=\"127.0.0.1,localhost,\$HOSTNAME,\$COMPUTERNAME\" - echo ^) ^> /etc/profile.d/proxytweak.sh - ) else ( - echo rm -f /etc/profile.d/proxytweak.sh - ) - echo conemu_dir=$(cygpath -w "$CYGWIN_ROOT/../conemu"^) - if "%INSTALL_CONEMU%" == "yes" ( - echo if [ ! -e "$conemu_dir" ]; then - echo conemu_url="https://github.com$(wget https://github.com/Maximus5/ConEmu/releases/latest -O - 2>/dev/null | egrep '/.*/releases/download/.*/.*7z' -o)" - echo echo; echo "Installing ConEmu from $conemu_url" - echo wget -nv --show-progress -O "${conemu_dir}.7z" "$conemu_url" ^&^& \ - echo mkdir -p "$conemu_dir" ^&^& \ - echo echo "Extracting ConEmu from archive..." ^&^& \ - echo bsdtar -xf "${conemu_dir}.7z" -C "$conemu_dir" ^&^& \ - echo rm -f "${conemu_dir}.7z" - echo fi - echo echo %CONCYGSYS_INFO% ^> "$conemu_dir/DO-NOT-LAUNCH-CONEMU-FROM-HERE" - ) else ( - echo rm -rf "$conemu_dir" - ) - if "%INSTALL_WSLBRIDGE%" == "yes" ( - echo wslbridge_url="https://github.com$(wget https://github.com/rprichard/wslbridge/releases/latest -O - 2>/dev/null | egrep '/.*/releases/download/.*/.*cygwin%CYGWIN_ARCH%.tar.gz' -o)" - echo echo; echo "Installing WSLbridge from $wslbridge_url" - echo wget -nv --show-progress -O "${CYGWIN_ROOT}.tar.gz" "$wslbridge_url" ^&^& \ - echo echo "Extracting WSLbridge from archive..." ^&^& \ - echo bsdtar -xf "${CYGWIN_ROOT}.tar.gz" --strip-components=1 -C "${CYGWIN_ROOT}/bin/" '*/wslbridge*' ^&^& \ - echo rm -f "${CYGWIN_ROOT}.tar.gz" - ) else ( - echo rm -f "${CYGWIN_ROOT}/bin/wslbridge"* - ) - if "%INSTALL_APT_CYG%" == "yes" ( - echo echo; echo "Installing/updating apt-cyg..." - echo wget -nv --show-progress -O /usr/local/bin/apt-cyg https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg - echo chmod +x /usr/local/bin/apt-cyg - ) else ( - echo rm -f /usr/local/bin/apt-cyg - ) - if "%INSTALL_SSH_AGENT_TWEAK%" == "yes" ( - echo # removing old ssh agent tweak implementation - echo rm -f /opt/ssh-agent-tweak - echo sed -i '/ssh-agent-tweak/d' "$bashrc_f" - echo echo; echo Adding SSH agent tweak... - echo echo eval \$\(/usr/bin/ssh-pageant -r -a \"/tmp/.ssh-pageant-\$USERNAME\"\^) ^> /etc/profile.d/sshagenttweak.sh || goto :fail - ) else ( - echo rm -f /etc/profile.d/sshagenttweak.sh - ) -) >"%Post_install%" || goto :fail - -"%CYGWIN_ROOT%\bin\dos2unix" "%Post_install%" || goto :fail +echo Adding .inputrc tweak (https://github.com/zhubanRuban/cygwin-extras/blob/master/inputrc_custom_bind) ... +cscript //Nologo "%DOWNLOADER%" https://github.com/zhubanRuban/cygwin-extras/raw/master/inputrc_custom_bind "%CYGWIN_ROOT%\etc\profile.d\inputrctweak.sh" +%DOS2UNIX% "%CYGWIN_ROOT%\etc\profile.d\inputrctweak.sh" || goto :fail +:: removing old proxy implementation +del "%CYGWIN_ROOT%\opt\bash_proxy" >NUL 2>&1 +%BASH% "/bin/sed -i '/bash_proxy/d' ~/.bashrc" -echo Launching post-install script... -"%CYGWIN_ROOT%\bin\bash" "%Post_install%" || goto :fail -del "%Post_install%" >NUL 2>&1 +if "%INSTALL_WSLBRIDGE%" == "yes" ( + echo. + echo Installing WSLbridge... + %BASH% "/bin/wget -qO "%CYGWIN_ROOT%\wslbridge.tar.gz" https://github.com$(/bin/wget -qO- https://github.com/rprichard/wslbridge/releases/latest|/bin/grep '/.*/releases/download/.*/.*cygwin%CYGWIN_ARCH%.tar.gz' -o)" || goto :fail + %BASH% "/bin/bsdtar -xf "%CYGWIN_ROOT%\wslbridge.tar.gz" --strip-components=1 -C "%CYGWIN_ROOT%\bin\" '*/wslbridge*'" || goto :fail + del "%CYGWIN_ROOT%\wslbridge.tar.gz" >NUL 2>&1 +) else ( + del "%CYGWIN_ROOT%\bin\wslbridge*" >NUL 2>&1 +) +if "%INSTALL_APT_CYG%" == "yes" ( + echo. + echo Installing apt-cyg... + %BASH% "/bin/wget -qO /bin/apt-cyg https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg; chmod +x /bin/apt-cyg" +) else ( + del "%CYGWIN_ROOT%\bin\apt-cyg" >NUL 2>&1 +) +if "%INSTALL_SSH_AGENT_TWEAK%" == "yes" ( + echo. + echo Adding SSH agent tweak... + echo eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-$USERNAME"^) ^> "%CYGWIN_ROOT%\etc\profile.d\sshagenttweak.sh" || goto :fail + %DOS2UNIX% "%CYGWIN_ROOT%\etc\profile.d\sshagenttweak.sh" +) else ( + del "%CYGWIN_ROOT%\etc\profile.d\sshagenttweak.sh" >NUL 2>&1 +) +del "%CYGWIN_ROOT%\opt\ssh-agent-tweak" >NUL 2>&1 +%BASH% "/bin/sed -i '/ssh-agent-tweak/d' ~/.bashrc" -set Conemu_config=%INSTALL_ROOT%conemu\ConEmu.xml if "%INSTALL_CONEMU%" == "yes" ( +if not exist "%CYGWIN_ROOT%\conemu\" ( + echo. + echo Installing ConEmu... + %BASH% "/bin/wget -qO "%CYGWIN_ROOT%\conemu.7z" https://github.com$(/bin/wget -qO- https://github.com/Maximus5/ConEmu/releases/latest|/bin/grep '/.*/releases/download/.*/.*7z' -o)" || goto :fail + %BASH% "/bin/bsdtar -xf "%CYGWIN_ROOT%\conemu.7z" -C "%CYGWIN_ROOT%\conemu"" || goto :fail + echo %CONCYGSYS_INFO% > "%CYGWIN_ROOT%\conemu\DO-NOT-LAUNCH-CONEMU-FROM-HERE" + del "%CYGWIN_ROOT%\conemu.7z" >NUL 2>&1 +) +if not exist "%INSTALL_ROOT%conemu\ConEmu.xml" ( echo. echo Replacing ConEmu config... ( @@ -606,50 +538,47 @@ if "%INSTALL_CONEMU%" == "yes" ( echo ^ echo ^ echo ^ - )> "%Conemu_config%" || goto :fail + ) > "%INSTALL_ROOT%conemu\ConEmu.xml" || goto :fail +) +) else ( + rd /s /q "%CYGWIN_ROOT%\conemu" >NUL 2>&1 ) - +:========================================================== echo. echo Cleaning up... -:: deleting obsolete files used by previous concygsys versions +:: deleting files left by previous concygsys versions and temp files rd /s /q "%INSTALL_ROOT%data" >NUL 2>&1 -del "%CYGWIN_ROOT%\updater.cmd" >NUL 2>&1 -del "%CYGWIN_ROOT%\cygwin-settings.cmd" >NUL 2>&1 -del "%CYGWIN_ROOT%\cygwin-install-options.cmd" >NUL 2>&1 -:: delting readme and licence files -del "%INSTALL_ROOT%LICENSE" >NUL 2>&1 -del "%INSTALL_ROOT%README.md" >NUL 2>&1 +del "%CYGWIN_ROOT%\updater.cmd" "%CYGWIN_ROOT%\cygwin-*.cmd" "%CYGWIN_ROOT%\portable-init.sh" "%CYGWIN_ROOT%\post-install.sh" >NUL 2>&1 +del "%INSTALL_ROOT%LICENSE" "%INSTALL_ROOT%README.md" >NUL 2>&1 ( echo %CONCYGSYS_INFO% echo Project page and Documentation: echo %CONCYGSYS_LINK% -)> "%INSTALL_ROOT%README.txt" || goto :fail +) > "%INSTALL_ROOT%README.txt" || goto :fail :aftercygwinupdate echo. if "%UPDATEMODE%" == "yes" ( - echo ====================== [ Update SUCCEEDED! ] ===================== + echo ======================== Update SUCCEEDED ======================== ) else ( - echo =================== [ Installation SUCCEEDED! ] ================== + echo ===================== Installation SUCCEEDED ===================== + echo Cleaning up... + del "%INSTALL_ROOT%ConCygSys*" >NUL 2>&1 ) echo. -echo Use launchers in [%INSTALL_ROOT%] to run Cygwin Portable. -echo. pause -:: deleting installer and old launchers -del "%INSTALL_ROOT%ConCygSys*" >NUL 2>&1 exit 0 :fail echo. if "%UPDATEMODE%" == "yes" ( - echo ======================= [ Update FAILED! ] ======================= + echo ========================= Update FAILED ========================== echo Try uploading installer manually from %CONCYGSYS_LINK% ) else ( - echo ==================== [ Installation FAILED! ] ==================== + echo ====================== Installation FAILED ======================= ) echo. pause From 2f3e56bb1a4f9176987023142ceaab2de78960ff Mon Sep 17 00:00:00 2001 From: zhubanRuban <30699069+zhubanRuban@users.noreply.github.com> Date: Wed, 4 Sep 2019 17:50:17 +0300 Subject: [PATCH 24/52] launcher, fstab, portable-init - unified launcher for cygwin and for wsl - launcher header moved from update to launcher - portable-init tasks moved to launcher - new options for tasks --- ConCygSys-installer.cmd | 224 ++++++++++++++++------------------------ 1 file changed, 91 insertions(+), 133 deletions(-) diff --git a/ConCygSys-installer.cmd b/ConCygSys-installer.cmd index ffcde20..de5acd0 100644 --- a/ConCygSys-installer.cmd +++ b/ConCygSys-installer.cmd @@ -3,7 +3,7 @@ :: ConCygSys: Cygwin and ConEmu portable installer https://github.com/zhubanRuban/ConCygSys-cygwin-portable :: This is the independent fork of https://github.com/vegardit/cygwin-portable-installer project -set CONCYGSYS_VERSION=190901b1 +set CONCYGSYS_VERSION=190904b1 ::======================= begin SCRIPT SETTINGS ======================= @@ -15,7 +15,9 @@ set CONCYGSYS_VERSION=190901b1 :: C:\cygwinhome :: C:\Users\yourusername\Documents\cygwinhome :: %USERPROFILE%\Documents\cygwinhome -set HOME_FOLDER= +set CYGWIN_HOME= + +set LAUNCHER_CYGWIN= :: Override OS architecture, if required: "32" bit or "64" bit system :: Leave empty for autodetect @@ -46,15 +48,24 @@ set INSTALL_SSH_AGENT_TWEAK=yes :: Install WSLbridge to allowing to access WSL via Mintty https://github.com/rprichard/wslbridge set INSTALL_WSLBRIDGE=yes +set LAUNCHER_WSLBRIDGE= :: Install ConEmu quake-style terminal https://conemu.github.io/ set INSTALL_CONEMU=yes :: https://conemu.github.io/en/ConEmuArgs.html set CONEMU_OPTIONS= +set CONEMUTASK_DEFAULT= + +set CONEMUTASK_CYGWIN_MINTTY= +set CONEMUTASK_CYGWIN_CONNECTOR= +set CONEMUTASK_CYGWIN_CMD= +set CONEMUTASK_WSL_MINTTY= +set CONEMUTASK_WSL_CONNECTOR= +set CONEMUTASK_WSL_CMD= :: Set proxy, if required, in the following formats: :: proxy:port -:: username:password@proxy:port +:: applies to installation process and to setting of installed cygwin instance set PROXY_HOST= :: Set Mintty options used in ConEmu task: https://cdn.rawgit.com/mintty/mintty/master/docs/mintty.1.html#CONFIGURATION @@ -217,179 +228,123 @@ if not "%UPDATECYGWINONLY%" == "" goto :aftercygwinupdate set BASH="%CYGWIN_ROOT%\bin\bash" --noprofile --norc -c set DOS2UNIX="%CYGWIN_ROOT%\bin\dos2unix" -echo. -echo Creating portable settings files... +:========================================================== -set Portable_init_name=portable-init.sh -set Portable_init=%CYGWIN_ROOT%\%Portable_init_name% -echo Creating init script to keep the installation portable [%Portable_init%]... +echo. +echo Generating the launchers... +del "%INSTALL_ROOT%*-*.cmd" >NUL 2>&1 +echo Generating Cygwin launcher... ( - echo #!/bin/bash - echo # %CONCYGSYS_INFO% - echo # setting path variable as it is not defined at this point - echo PATH=/usr/local/bin:/usr/bin:/bin - echo # setting custom cygwin username in passwd file, if not empty - echo mkpasswd -c^|awk -F: -v OFS=: "{\$1=\"$USER\"; \$6=\"$(cygpath -u "$HOME"^)\"; print}" ^>/etc/passwd - echo # generating custom fstab in case ACL is set to no - echo ( + echo @echo off + echo :: %CONCYGSYS_INFO% + echo set CYGWIN_ROOT=%%~dp0cygwin + echo "%%CYGWIN_ROOT%%\bin\sed" -i '/^last-cache/!b;n;c\\\t%TEMP:\=\\\%' /etc/setup/setup.rc + echo rd /s /q "%%CYGWIN_ROOT%%\*pkg-cache" 2^>NUL if not "%INSTALL_ACL%" == "yes" ( - echo echo $(cygpath -m "$CYGWIN_ROOT"^|sed 's/\ /\\040/g'^)/bin /usr/bin none noacl 0 0 - echo echo $(cygpath -m "$CYGWIN_ROOT"^|sed 's/\ /\\040/g'^)/lib /usr/lib none noacl 0 0 - echo echo $(cygpath -m "$CYGWIN_ROOT"^|sed 's/\ /\\040/g'^) / none override,noacl 0 0 - ) - echo echo none /mnt cygdrive noacl,user 0 0 - echo ^) ^>/etc/fstab - echo # adjust Cygwin packages cache path - echo pkg_cache_dir=$(cygpath -w "$CYGWIN_ROOT/pkg-cache"^) - echo sed -i '/^^last-cache/!b;n;c\\t'"${pkg_cache_dir//\\/\\\\}"'' /etc/setup/setup.rc -) > "%Portable_init%" || goto :fail + echo set FSTAB=%%CYGWIN_ROOT:\=/%% ^& set=%%FSTAB: =\040%% + echo ( + echo echo %%FSTAB%%/bin /usr/bin none noacl 0 0 + echo echo %%FSTAB%%/lib /usr/lib none noacl 0 0 + echo echo %%FSTAB%% / none override,noacl 0 0 + echo echo none /cygdrive cygdrive noacl,user 0 0 + echo ^) ^> "%%CYGWIN_ROOT%%\etc\fstab" ^& "%%CYGWIN_ROOT%%\bin\dos2unix" "%%CYGWIN_ROOT%%\etc\fstab" + ^) else ( + del "%CYGWIN_ROOT%\etc\fstab" >NUL 2>&1 + ^) + echo call "%%~dp0%Concygsys_settings_name%" cygwinsettings + echo if "%%CYGWIN_HOME%%" == "" (set HOME=/home/concygsys^) else (set HOME=%%CYGWIN_HOME%%^) + echo :conemu + if "%INSTALL_CONEMU%" == "yes" ( + if "%CYGWIN_ARCH%" == "64" ( + echo start "" "%%~dp0conemu\ConEmu64.exe" %CONEMU_OPTIONS% + ^) else ( + echo start "" "%%~dp0conemu\ConEmu.exe" %CONEMU_OPTIONS% + ^) + echo exit + ^) + echo :mintty + echo start "" "%%CYGWIN_ROOT%%\bin\mintty.exe" - + echo exit + echo :cmd + echo start "" "%%CYGWIN_ROOT%%\bin\bash.exe" --login -i + echo exit +) >"%INSTALL_ROOT%Cygwin-Launcher.cmd" || goto :fail + +if "%INSTALL_WSLBRIDGE%" == "yes" ( + echo Generating WSL launcher... + ( + echo @echo off + echo :: %CONCYGSYS_INFO% + echo :conemu + if "%INSTALL_CONEMU%" == "yes" ( + if "%CYGWIN_ARCH%" == "64" ( + echo start "" "%%~dp0conemu\ConEmu64.exe" %CONEMU_OPTIONS% + ^) else ( + echo start "" "%%~dp0conemu\ConEmu.exe" %CONEMU_OPTIONS% + ^) + echo exit + ^) + echo :mintty + echo start "" "%%~dp0cygwin\bin\mintty.exe" --WSL= -~ + echo exit + echo :cmd + echo start "" "%%~dp0cygwin\bin\mintty.exe" --WSL= -~ + echo exit + ) >"%INSTALL_ROOT%WSL-Launcher.cmd" || goto :fail -%DOS2UNIX% "%Portable_init%" || goto :fail +:========================================================== -echo Generating one-file settings and updater file [%Concygsys_settings%]... +echo Generating one-file settings and updater file... ( echo @echo off echo :: %CONCYGSYS_INFO% echo. echo if "%%1" == "cygwinsettings" goto :cygwinsettings echo if "%%1" == "installoptions" goto :installoptions - echo if "%%1" == "launcherheader" goto :launcherheader echo goto :update echo. - echo :cygwinsettings echo :: %CONCYGSYS_LINK%#customization + echo. + echo :cygwinsettings + echo :: these settings will be applied after you restart cygwin echo set CYGWIN_USERNAME=%CYGWIN_USERNAME% - echo set HOME_FOLDER=%HOME_FOLDER% - echo exit /b 0 + echo set CYGWIN_HOME=%CYGWIN_HOME% + echo exit /b echo. echo :installoptions - echo :: %CONCYGSYS_LINK%#customization + echo :: these settings will be applied after you run %Concygsys_settings_name% echo set CYGWIN_ARCH=%CYGWIN_ARCH% echo set CYGWIN_MIRROR=%CYGWIN_MIRROR% - echo :: fill only if new packages should be installed during next update echo set CYGWIN_PACKAGES= echo set INSTALL_ACL=%INSTALL_ACL% echo set INSTALL_APT_CYG=%INSTALL_APT_CYG% echo set INSTALL_SSH_AGENT_TWEAK=%INSTALL_SSH_AGENT_TWEAK% echo set INSTALL_CONEMU=%INSTALL_CONEMU% echo set PROXY_HOST=%PROXY_HOST% - echo exit /b 0 - echo. - echo :launcherheader - echo set CYGWIN_ROOT=%%~dp0cygwin - echo call "%%~dp0%Concygsys_settings_name%" cygwinsettings - echo if "%%CYGWIN_USERNAME%%" == "" (set USER=%%USERNAME%%^) else (set USER=%%CYGWIN_USERNAME%%^) - echo if "%%HOME_FOLDER%%" == "" (set HOME=/home/concygsys^) else (set HOME=%%HOME_FOLDER%%^) - echo rd /s /q "%%CYGWIN_ROOT%%\pkg-cache" 2^>NUL - echo type NUL ^> "%%CYGWIN_ROOT%%\etc\fstab" - echo "%%CYGWIN_ROOT%%\bin\bash" "%%CYGWIN_ROOT%%\%Portable_init_name%" - echo cd /d "%%CYGWIN_ROOT%%\bin" - echo exit /b 0 + echo exit /b echo. echo :update echo echo [ %CONCYGSYS_INFO% ] echo set INSTALL_ROOT=%%~dp0 echo set DOWNLOADER=%%INSTALL_ROOT%%downloader.vbs - echo echo Creating a script that can download files [%%DOWNLOADER%%]... + echo echo Creating a script that can download files... echo ( call "%GENDOWNLOADER%" echo ^) ^> "%%DOWNLOADER%%" ^|^| goto :fail echo set INSTALLER=ConCygSys-installer.cmd echo cscript //Nologo "%%DOWNLOADER%%" https://raw.githubusercontent.com/zhubanRuban/ConCygSys-cygwin-portable/beta/%%INSTALLER%% "%%INSTALLER%%" ^|^| goto :fail echo start "" "%%INSTALLER%%" ^|^| goto :fail + echo del "%%INSTALL_ROOT%%ConCygSys*" >NUL 2>&1 echo exit 0 echo :fail - echo del "%%DOWNLOADER%%" ^>NUL 2^>^&1 echo echo. - echo echo !!! Update FAILED !!! - echo echo Try uploading installer manually from %CONCYGSYS_LINK% + echo echo FAIL. Try uploading installer manually from %CONCYGSYS_LINK% echo echo. echo pause echo exit 1 ) > "%Concygsys_settings%" || goto :fail - -echo. -echo Generating launcher... -::================================================ -( - - echo @echo off - echo :: %CONCYGSYS_INFO% - echo call "%%~dp0%Concygsys_settings_name%" launcherheader - echo if "%%1" == "" ( - echo "%%CYGWIN_ROOT%%\bin\bash.exe" --login -i - echo ^) else ( - echo "%%CYGWIN_ROOT%%\bin\bash.exe" --login -c "%%*" - echo ^) -) > "%Launch_cmd%" || goto :fail - -set Launch_conemu=%INSTALL_ROOT%Cygwin-ConEmu.cmd -if "%INSTALL_CONEMU%" == "yes" ( - echo Generating ConEmu launcher [%Launch_conemu%]... - ( - echo @echo off - echo :: %CONCYGSYS_INFO% - echo call "%%~dp0%Concygsys_settings_name%" launcherheader - if "%CYGWIN_ARCH%" == "64" ( - echo start "" "%%~dp0conemu\ConEmu64.exe" %CONEMU_OPTIONS% - ) else ( - echo start "" "%%~dp0conemu\ConEmu.exe" %CONEMU_OPTIONS% - ) - echo exit 0 - ) > "%Launch_conemu%" || goto :fail -) else ( - echo Removing ConEmu launcher [%Launch_conemu%]... - del "%Launch_conemu%" >NUL 2>&1 -) - -set Launch_mintty=%INSTALL_ROOT%Cygwin-Mintty.cmd -echo Generating Mintty launcher [%Launch_mintty%]... -( - echo @echo off - echo :: %CONCYGSYS_INFO% - echo call "%%~dp0%Concygsys_settings_name%" launcherheader - echo start "" "%%CYGWIN_ROOT%%\bin\mintty.exe" - - echo exit 0 -) > "%Launch_mintty%" || goto :fail - -set Launch_wsltty=%INSTALL_ROOT%Cygwin-WSLtty.cmd -if "%INSTALL_WSLBRIDGE%" == "yes" ( - ( - echo @echo off - echo :: %CONCYGSYS_INFO% - echo start "" "%%~dp0cygwin\bin\mintty.exe" --WSL= -~ - echo exit 0 - ) > "%Launch_wsltty%" || goto :fail -) else ( - echo Removing WSLtty launcher [%Launch_wsltty%]... - del "%Launch_wsltty%" >NUL 2>&1 -) - - echo. - echo :update - echo echo [ %CONCYGSYS_INFO% ] - echo set INSTALL_ROOT=%%~dp0 - echo set DOWNLOADER=%%INSTALL_ROOT%%downloader.vbs - echo echo Creating a script that can download files [%%DOWNLOADER%%]... - echo ( - call "%GENDOWNLOADER%" - echo ^) ^> "%%DOWNLOADER%%" ^|^| goto :fail - echo set INSTALLER=ConCygSys-installer.cmd - echo cscript //Nologo "%%DOWNLOADER%%" https://raw.githubusercontent.com/zhubanRuban/ConCygSys-cygwin-portable/beta/%%INSTALLER%% "%%INSTALLER%%" ^|^| goto :fail - echo start "" "%%INSTALLER%%" ^|^| goto :fail - echo exit 0 - echo :fail - echo del "%%DOWNLOADER%%" ^>NUL 2^>^&1 - echo echo. - echo echo !!! Update FAILED !!! - echo echo Try uploading installer manually from %CONCYGSYS_LINK% - echo echo. - echo pause - echo exit 1 -) > "%INSTALL_ROOT%\Cygwin.cmd" || goto :fail -::================================================ - +:========================================================== echo. echo Adding .inputrc tweak (https://github.com/zhubanRuban/cygwin-extras/blob/master/inputrc_custom_bind) ... @@ -426,19 +381,21 @@ if "%INSTALL_SSH_AGENT_TWEAK%" == "yes" ( del "%CYGWIN_ROOT%\opt\ssh-agent-tweak" >NUL 2>&1 %BASH% "/bin/sed -i '/ssh-agent-tweak/d' ~/.bashrc" +:========================================================== if "%INSTALL_CONEMU%" == "yes" ( if not exist "%CYGWIN_ROOT%\conemu\" ( echo. echo Installing ConEmu... %BASH% "/bin/wget -qO "%CYGWIN_ROOT%\conemu.7z" https://github.com$(/bin/wget -qO- https://github.com/Maximus5/ConEmu/releases/latest|/bin/grep '/.*/releases/download/.*/.*7z' -o)" || goto :fail + md "%CYGWIN_ROOT%\conemu" %BASH% "/bin/bsdtar -xf "%CYGWIN_ROOT%\conemu.7z" -C "%CYGWIN_ROOT%\conemu"" || goto :fail echo %CONCYGSYS_INFO% > "%CYGWIN_ROOT%\conemu\DO-NOT-LAUNCH-CONEMU-FROM-HERE" del "%CYGWIN_ROOT%\conemu.7z" >NUL 2>&1 ) if not exist "%INSTALL_ROOT%conemu\ConEmu.xml" ( echo. - echo Replacing ConEmu config... + echo Exporting custom ConEmu config... ( echo ^ echo ^