• Stars
    star
    189
  • Rank 204,649 (Top 5 %)
  • Language Batchfile
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Windows batch file to perform unattended installations of a portable Cygwin environment.

cygwin-portable-installer

Build Status License Contributor Covenant

  1. What is it?
  2. Features
  3. Installation
    1. Customizing the installer
  4. Update
  5. License

What is it?

cygwin-portable-installer is a self-containing Windows batch file to perform an unattended installation of a portable Cygwin environment.

The installer has been implemented as a Batch script and not PowerShell script because in some corporate environments execution of PowerShell scripts is disabled for non-administrative users via group policies.

Tabbed Terminal

Features

  • portable: you can e.g. install it on an USB sticks and use the same configuration on different computers
  • 256-color multi-tabbed shell: ConEmu is pre-configured as terminal by default. Alternatively you can choose to use the single tabbed Mintty terminal.
  • command-line package installer: apt-cyg package manager will be automatically installed (opt-out via config parameter is possible)
  • adaptive Bash prompt: bash-funk will be automatically installed (opt-out via config parameter is possible)
  • winpty will be automatically installed (opt-out via config parameter is possible)
  • additional optional tools (opt-in via config parameter):
    • Ansible: deployment automation tool
    • AWS CLI: AWS cloud command-line tool
    • Node.js: JavaScript runtime
    • testssl.sh: command line tool to check SSL/TLS configurations of servers

Installation

  1. Get a copy of the installer using one of these ways:
    • Using old-school Copy & Paste:
      1. Create a local empty directory where Cygwin shall be installed, e.g. C:\apps\cygwin-portable
      2. Download the cygwin-portable-installer.cmd file into that directory.
    • Using Git:
      1. Clone the project into a local directory, e.g.
        git clone https://github.com/vegardit/cygwin-portable-installer --single-branch --branch main --depth 1 C:\apps\cygwin-portable
  2. (Optional) Open the file cygwin-portable-installer.cmd in a text editor and adjust the configuration variables to e.g. set an HTTP Proxy, change the set of pre-installed Cygwin packages, select the terminal (ConEmu or Mintty), etc.
  3. (Optional) Temporarily disable your Antivirus scanner in case it is known to interfere with Cygwin, otherwise you may end-up with a broken/incomplete installation. See cygwin.com/faq: What applications have been found to interfere with Cygwin?
    • For BitDefender Antivirus the Advanced Thread Defense protection feature needs to be disabled and not the Antivirus > Settings > BitDefender Shield.
  4. Execute the cygwin-portable-installer.cmd. This will automatically:
    1. download the 32-bit or 64-bit Cygwin setup.exe depending on your OS
    2. install Cygwin with the pre-selected set of packages
    3. install the ConEmu tabbed terminal
    4. create an init scripts that will keep the installation portable
    5. install the apt-cyg command-line package manager
    6. install the bash-funk Bash toolbox with it's adaptive Bash prompt
    7. install winpty
    8. install optional tools:
      1. Ansible
      2. AWS CLI
      3. Node.js
      4. testssl.sh
  5. Now you can launch your portable Cygwin environment using the newly created cygwin-portable.cmd batch file. Launch Script

Customizing the installer

You can customize the installer by either directly modifying the default settings in the cygwin-portable-installer.cmd file, or by placing a separate file called cygwin-portable-installer-config.cmd next to it where some or all of these settings are overwritten.

These settings are currently available:

:: set proxy if required (unfortunately Cygwin setup.exe does not have commandline options to specify proxy user credentials)
set PROXY_HOST=
set PROXY_PORT=8080

:: change the URL to the closest mirror https://cygwin.com/mirrors.html
set CYGWIN_MIRROR=https://linux.rz.ruhr-uni-bochum.de/download/cygwin

:: one of: auto,64,32 - specifies if 32 or 64 bit version should be installed or automatically detected based on current OS architecture
set CYGWIN_ARCH=auto

:: choose a user name under Cygwin
set CYGWIN_USERNAME=root

:: select the packages to be installed automatically via apt-cyg
set CYGWIN_PACKAGES=bash-completion,bc,bzip,coreutils,curl,dos2unix,expect,git,git-svn,gnupg,inetutils,jq,lz4,mc,nc,openssh,openssl,perl,psmisc,python37,pv,rsync,ssh-pageant,screen,subversion,unzip,vim,wget,zip,zstd

:: if set to 'yes' the local package cache created by cygwin setup will be deleted after installation/update
set DELETE_CYGWIN_PACKAGE_CACHE=no

:: if set to 'yes' the apt-cyg command line package manager (https://github.com/kou1okada/apt-cyg) will be installed automatically
set INSTALL_APT_CYG=yes

:: if set to 'yes' the bash-funk adaptive Bash prompt (https://github.com/vegardit/bash-funk) will be installed automatically
set INSTALL_BASH_FUNK=yes

:: if set to 'yes' Node.js (https://nodejs.org/) will be installed automatically
set INSTALL_NODEJS=yes
:: Use of the folder names found here https://nodejs.org/dist/ as version name.
set NODEJS_VERSION=latest-v18.x
:: one of: auto,64,32 - specifies if 32 or 64 bit version should be installed or automatically detected based on current OS architecture
set NODEJS_ARCH=auto

:: if set to 'yes' Ansible (https://github.com/ansible/ansible) will be installed automatically
set INSTALL_ANSIBLE=yes
set ANSIBLE_GIT_BRANCH=stable-2.14

:: if set to 'yes' AWS CLI (https://github.com/aws/aws-cli) will be installed automatically
set INSTALL_AWS_CLI=yes

:: if set to 'yes' testssl.sh (https://testssl.sh/) will be installed automatically
set INSTALL_TESTSSL_SH=yes
:: name of the GIT branch to install from, see https://github.com/drwetter/testssl.sh/
set TESTSSL_GIT_BRANCH=3.0

:: use ConEmu based tabbed terminal instead of Mintty based single window terminal, see https://conemu.github.io/
set INSTALL_CONEMU=yes
set CON_EMU_OPTIONS=-Title cygwin-portable ^
 -QuitOnClose

:: if set to 'yes' the winpty (https://github.com/rprichard/winpty) will be installed automatically
set INSTALL_WINPTY=yes
set WINPTY_VERSION=0.4.3

:: add more path if required, but at the cost of runtime performance (e.g. slower forks)
set CYGWIN_PATH=%%SystemRoot%%\system32;%%SystemRoot%%

:: set Mintty options, see https://cdn.rawgit.com/mintty/mintty/master/docs/mintty.1.html#CONFIGURATION
set MINTTY_OPTIONS=--Title cygwin-portable ^
  -o Columns=160 ^
  -o Rows=50 ^
  -o BellType=0 ^
  -o ClicksPlaceCursor=yes ^
  -o CursorBlinks=yes ^
  -o CursorColour=96,96,255 ^
  -o CursorType=Block ^
  -o CopyOnSelect=yes ^
  -o RightClickAction=Paste ^
  -o Font="Courier New" ^
  -o FontHeight=10 ^
  -o FontSmoothing=None ^
  -o ScrollbackLines=10000 ^
  -o Transparency=off ^
  -o Term=xterm-256color ^
  -o Charset=UTF-8 ^
  -o Locale=C

Executing commands after installation

When you place a separate cygwin-portable-installer-post-tasks.cmd file next to the cygwin-portable-installer.cmd it will be executed automatically after the installation suceeded. You can use this file to perform additional configurations.

Updating your installation

To update installed Cygwin packages execute the generated cygwin-portable-updater.cmd file.

License

All files are released under the Apache License 2.0.

Individual files contain the following tag instead of the full license text:

SPDX-License-Identifier: Apache-2.0

This enables machine processing of license information based on the SPDX License Identifiers that are available here: https://spdx.org/licenses/.

More Repositories

1

prisma-generator-nestjs-dto

Generates NestJS DTO classes from Prisma Schema
TypeScript
274
star
2

docker-gitea-act-runner

Docker image based on debian:stable-slim to run Gitea's act_runner as a Docker container
Shell
162
star
3

haxe-concurrent

A haxelib for basic platform-agnostic concurrency support
Haxe
82
star
4

haxe-strings

A haxelib for consistent cross-platform UTF-8 string manipulation.
Haxe
76
star
5

docker-traefik-logrotate

Lightweight Docker image to be used in conjunction with a dockerized Traefik instance to rotate Traefik's access logs.
Shell
49
star
6

bash-funk

bash-funk is a collection of useful commands for Bash 3.2 or higher.
Shell
46
star
7

dart-hotreloader

Automatic hot code reloader for Dart projects.
Dart
46
star
8

haxe-files

A haxelib for cross-platform filesystem operations.
Haxe
46
star
9

docker-graalvm-maven

Docker image to build native Linux binaries from Java Maven projects using GraalVM native-image feature.
Shell
28
star
10

docker-softhsm2-pkcs11-proxy

Docker image to run a virtual HSM (Hardware Security Module) network service based on SoftHSM2 and pkcs11-proxy.
Dockerfile
26
star
11

fast-apt-mirror.sh

fast-apt-mirror.sh is a self-contained Bash script that helps you to easily and quickly determine and configure a fast APT repository mirror on Debian, Ubuntu and Pop!_OS systems.
Shell
24
star
12

copycat

Copycat is a cross-platform one-way file synchronization tool for local file systems similar to robocopy on Windows.
Java
23
star
13

haxe-doctest

A haxelib inspired by Python's doctest command that generates unit tests based on assertions specified within the source code.
Haxe
23
star
14

await.sh

Self-contained POSIX shell scripts to await the availability of resources and services. Can be used as a workaround for Docker Swarm's missing depends_on support.
Shell
20
star
15

haxe-reusable-workflows

Reusable workflows for GitHub Actions to build/test Haxe code.
Haxe
10
star
16

scoop-portable

Self-contained Windows batch file that installs/loads a portable scoop (https://scoop.sh) environment.
Batchfile
7
star
17

docker-osslsigncode

Docker image for signing Windows binaries with Microsoft Authenticode using osslsigncode
Dockerfile
7
star
18

docker-meshcentral

Opinionated docker image to run a MeshCentral server to manage/access remote machines from within a browser.
Shell
7
star
19

activemq-artemis-dynatrace-plugin

Custom Dynatrace JMX plug-in for ActiveMQ Artemis broker processes.
Shell
6
star
20

docker-openldap

Opinionated docker image based on debian:bookworm-slim to run an OpenLDAP 2.5 server.
Shell
5
star
21

no-npe

A carefully curated repository of Eclipse External null Annotations (EEA) for enhanced static null analysis
Java
5
star
22

vegardit-maven-parent

Opinionated best practices Maven parent project.
Shell
5
star
23

haxe-sshclient

A haxelib that provides a basic SSH client which uses a pre-installed OpenSSH, Putty, or Kitty client under the hood.
Haxe
3
star
24

gha-setup-yq

gha-setup-yq is a GitHub action to install the yq command line YAML parser.
3
star
25

docker-wordpress-ext

Docker image extending the official Wordpress docker image with support for LDAP auth, OPcache and reverse HTTPS proxies.
Shell
2
star
26

docker-shared

Scripts and resources to be reused by docker image repos
Shell
2
star
27

depcheck-maven-plugin

Maven plugin to check for used unused direct and used indirect (transitive) dependencies.
Java
2
star
28

node-har-extract

extract http archives (HAR 1.2) to filesystem
JavaScript
2
star
29

docker-jenkins-ext

Docker image based on the official Jenkins docker image with support for pre-installing plug-ins and pre-configuring the Jenkins instance during container start via YAML files using the configuration-as-code plugin.
Shell
2
star
30

gha-setup-jq

gha-setup-jq is a GitHub action to install the jq command-line JSON parser/processor.
2
star
31

docker-jenkins-swarm-agent

Docker image to be used with the Jenkins Docker Swarm Plugin
Shell
2
star
32

docker-openjdk-ext

This docker image extends the official OpenJDK docker images by pre-installing curl, git, less, and docker client.
Shell
1
star
33

haxe-clink-externs

A haxelib with Lua externs for the Clink API to develop custom command line completions for Clink using Haxe.
Haxe
1
star
34

docker-gitea-ext

Docker image based on the official Gitea docker image with additional support for rendering AsciiDoc files.
Shell
1
star