Code Monkey home page Code Monkey logo

cygwin-portable-installer's People

Contributors

asztalosdani avatar barcala avatar bofhbug avatar dependabot[bot] avatar freeload101 avatar itchychips avatar sebthom avatar userdocs avatar xnum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cygwin-portable-installer's Issues

updating setup.ini failed

Hi

On a new installation i get this error when trying to use apt-cyg:

> apt-cyg update
/usr/local/bin/apt-cyg: line 424: C:/Windows/system32/cmd.exe: Bad address
iconv: conversion from -t unsupported
iconv: try 'iconv -l' to get the list of supported encodings
cygpath: can't convert empty path
/usr/local/bin/apt-cyg: line 545: declare: last_cache: not found
/usr/local/bin/apt-cyg: line 545: declare: last_mirror: not found
Cache directory is
Mirror is
Updating setup.ini
/x86_64/setup.zst: Scheme missing.
/x86_64/setup.zst.sig: Scheme missing.
/x86_64/setup.xz: Scheme missing.
/x86_64/setup.xz.sig: Scheme missing.
/x86_64/setup.bz2: Scheme missing.
/x86_64/setup.bz2.sig: Scheme missing.
/x86_64/setup.ini: Scheme missing.
/x86_64/setup.ini.sig: Scheme missing.
Error: updating setup.ini failed, reverting.
at : /usr/local/bin/apt-cyg: setupini_download: 636

I am new to this so i can't tell if this problem is specific to cygwin-protable or apt-cyg. But it seems to me that apt-cyg can't find the cache and mirror directories and that causes the setup.ini creation to fail.

Any idea?

install python2.7

the default python is python3.7, but I need 2.7 instead, how do I install python2.7 and replace 3.7 ?

python ctypes does not find c lib, prevents ansible to start

Hi,
When selecting INSTALL_ANSIBLE=yes and ANSIBLE_GIT_BRANCH=stable-2.14, I systematically get the same error at ansible startup stating that function wcwidth cannot be found.
This comes from this line https://github.com/ansible/ansible/blob/stable-2.14/lib/ansible/utils/display.py#L47 which is failing to find 'c' library.
The test can be easily done like this
python -c 'import ctypes.util; print(ctypes.cdll.LoadLibrary(ctypes.util.find_library("c")))'
returning currently
<CDLL 'None', handle 100400000 at 0x6fffffec7210>

I thought it was a Cygwin issue but a "classic" install of cygwin does not have the issue and returns the cygwin libc implementation like expected
<CDLL 'cygwin1.dll', handle 180040000 at 0x6ffffffa4ca0>

I looked at differences in the environment, did a bunch of tests and could not find the right variable to set or package to install.
I guess there is some dependency missing in the config file.

NB: the wcwidth usage has been introduced in ansible 2.11, picking this version solved the issue but I am still looking at how to make 2.14 work.

Any idea how I could solve this ?

Installs the wrong architecture for ConEmu

Observation:

Upon installing via the .cmd file, and running the generated entry point cygwin-portable, the following error is found (paraphrased):

Can't create process. 
This version of %1 is not compatible with the version of Windows being run. Check that the program is compatible with this architecture, 32 or 64 bits, and contact your software distributor.

The cygwin-portable installer .cmd file seems to check the wrong environment variables for architecture, looking to an envvar called "PROCESSOR_ARCHITEW6432" when it should be looking for "PROCESSOR_ARCHITECTURE".

Even if manually correcting the W6432 variable sections so that PROCESSOR_ARCHITECTURE is read instead, the cygwin-portable installer insists on downloading ConEmu 64bit.

Expected Behaviour

The components of software downloaded and installed are compatible with the OS and the software can be run.

Observed Behaviour

The components of software downloaded and installed are not compatible with the OS and the software can't. be run. Furthermore, the installer wrongly reports a successful installation.

System: Windows 7 SP1 32-bit virtual machine on a Linux Debian 10 64-bit host.

Guest system's envvars:

PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 58 Stepping 9, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3a09

No variable called PROCESSOR_ARCHITEW6432 is found, yet the installer takes the wrong paths (at eg.: lines 148, 429) and installs ConEmu 64 bit to run on a 32-bit OS. Also, while I have not definitively verified it, it seems to install the wrong architecture of cygstdc++-6.dll.

Recommended Fix Pathways

  • Provide a better mechanism than reading envvars for detecting the architecture that is actually running (not the architecture that the hardware is "capable of").
  • Provide an installer flag to perform an alternate architecture install.

download of setup-x86.exe / setup-x86_64.exe fail (downloader.vbs(7, 1) WinHttp.WinHttpRequest: An error occurred in the secure channel support)

###########################################################

Installing [Cygwin Portable]...

###########################################################

Creating Cygwin root [U:\cygwin-portable-new-test\cygwin]...
Creating [U:\cygwin-portable-new-test\downloader.vbs] script...
Downloading 'https://cygwin.org/setup-x86_64.exe' to 'U:\cygwin-portable-new-test\cygwin\setup-x86_64.exe'...
U:\cygwin-portable-new-test\downloader.vbs(7, 1) WinHttp.WinHttpRequest: An error occurred in the secure channel support

Running Cygwin setup...
'"U:\cygwin-portable-new-test\cygwin\setup-x86_64.exe"' is not recognized as an internal or external command,
operable program or batch file.

###########################################################

Installing [Cygwin Portable] FAILED!

###########################################################

It is not portable

I installed it but when I run it on a different computer it show account of the users of the computer instead of my user. Please help me??

Postinstallation error in ca-certificates.sh

When running the script with its defaults, an error message is shown on the screen and continues. I don't know exactly the consequences of the problem:

...
running: C:\cygwin\cygwin\bin\bash.exe --norc --noprofile "/etc/postinstall/p11-kit.sh"
running: C:\cygwin\cygwin\bin\bash.exe --norc --noprofile "/etc/postinstall/ca-certificates.sh"
abnormal exit: exit code=1
running: C:\cygwin\cygwin\bin\bash.exe --norc --noprofile "/etc/postinstall/crypto-policies.sh"
...

xargs: too low environmental memory

xargs: Der Umgebungsspeicher ist für »exec« nicht ausreichend.

The active image address is not contained in the flash layout, please check !!!

What can I do?

Personalize installer

Hello,

Thank's for your greatfull project ! Just a simple question: if i want to personalize this installer (to adapt to my own application requirements) remove all no necessary and add required things in https://github.com/vegardit/cygwin-portable-installer/blob/master/cygwin-portable-installer.cmd is there the correct way ? Or there are variables to personalize ?

vim can't select text without pressing shift+click

So it looks like you can select normally but when you run vi (alias to vim in /etc/profile.d/vim.sh ? ) it makes it so you have to use shift+click to select. Not an issue if this is the desired result but for consistency not sure how to fix it.

Reference:
Maximus5/ConEmu#399 ( shift + click ) starts copy in conemu

also note vi and vim are different :

$ diff /usr/bin/vi /usr/bin/vim
Binary files /usr/bin/vi and /usr/bin/vim differ

image

"An error occurred in the secure channel support" when attempting to download cygwin installer

Please be aware that users may be unable to download the cygwin installer via the vbscript method if their system doesn't support TLS 1.1/1.2 in WinHTTP connections.

They'll see an error when running the installer: "An error occurred in the secure channel support".

The solution is to make the registry changes or apply the hotfix detailed here.

Please add this to the README or perhaps consider a workaround - such as allowing users to manually download and place thee cygwin installer executable in the required subfolder - if possible.

npm does not work

I had done a standard installation without any change to installer file. the installer later reported a successful installation including node.js
When type npm command, i get below error message:

$ npm -v
internal/modules/cjs/loader.js:969
throw err;
^

Error: Cannot find module 'C:\PortableApps\CygwinPortable\cygwin\opt\nodejs\current\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
internal/modules/cjs/loader.js:969
throw err;
^

Error: Cannot find module 'C:\PortableApps\CygwinPortable\cygwin\opt\nodejs\current\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

the installer bat file is placed in C:\PortableApps\CygwinPortable\ but above command is executed in cygwin env.
any idea how to fix it? thanks.

'bash' is not recognized as an internal or external command

I have configured cygwin-portable-installer.cmd for my needs, but when I run it, it aborts with this error message:

(...)
Creating updater [C:\Users\admin\cygwin-portable-updater.cmd]...
Disabling default Cygwin launcher [c:\cygwin64\Cygwin.bat]...
Creating [c:\cygwin64\portable-init.sh]...
dos2unix: converting file c:\cygwin64\portable-init.sh to Unix format...
Creating launcher [C:\Users\admin\cygwin-portable.cmd]...
Replacing [/etc/fstab]...
The system cannot find the path specified.
The system cannot find the path specified.
'bash' is not recognized as an internal or external command,
operable program or batch file.
'bash' is not recognized as an internal or external command,
operable program or batch file.
File not found - C:\CYGWIN64\HOME\ROOT.BASHRC
The system cannot find the path specified.

###########################################################

Installing [Cygwin Portable] FAILED!

###########################################################

Waiting for 28 seconds, press a key to continue ...

AWS CLI

This looks like something we have been needing.. Is there a way to also add AWS CLI to this?

package manager change

apt-cyg is dead and the authour reccomends the installer called sage.
https://github.com/svnpenn/sage
i'm not sure how the change would work but the cygwin folder would need to be writable and not read ol since windows sets folders to be this and sage doesn't like it.

Or you could alter the script to download and use setup.exe

Find Command Issues

Don't have this issue with my old Cygwin env same binary for find too. Can't seem to find a fix with the conemu :( :

image

If I just run bash.exe from CMD it works fine:

bash -c "/bin/find . -exec /bin/ls '{}' \;

Uninstall cygwin?

Cannot delete cygwin folder after installation.

Tried to take ownership however still comes out with this error
rmdir : Directory A:\apps\cygwin-portable\cygwin\ cannot be removed because it is not empty.

Cygwin does not create its core files

Hello Vegardit,

First of all I would like to thank you for such a great tool, always wanted to have portable cygwin+comemu stack.

I wanted to ask if you experienced any similar issues while installing Cygwin portable.
I recently tried to install it on my PC (Windows 10 x64) and found that Cygwin does not create its core files during setup process. It hangs on "Replacing etc/fstab" stage and goes to :fail afterwards.
After this I looked into %CYGWIN_ROOT% folder and found that there are no core files (/home, /bin, etc.)
Only:
./etc/setup/setup.rc
./etc/setup/timestamp
./setup-x86_64.exe

Tried different mirrors, creating fstab file manually, running installation process from virtualbox VM with no success. The weird thing is that one week ago cygwin+conemu was installed without issues on my friend's PC (also Windows 10 x64)

Any help would be highly appreciated.


Regards,
Alex

Allow cygin version selection

Per these issues cmder and ConEmu

The latest version of cygwin cannot work with ConEmu/cmder. Can the ability to choose a version of cygwin to install be added to this script.

Potential conflict in setup.

I was not sure so i thought i'd ask first about these two lines.

https://github.com/vegardit/cygwin-portable-installer/blob/master/cygwin-portable-installer.cmd#L284-L285

If i am reading this right you want to set a custom path for the packages cache. Then use sed to edit the default line. The problem i see is that it matches nothing as the format of the line is :

last-cache
	C:\...\...\...\.pkg-cache
mirrors-lst

This works for me actually edit the line as it is created by the Cygwin installer.

pkg_cache_dir=$(cygpath -w "$CYGWIN_ROOT/../cygwin-pkg-cache")
sed -ri 's#(.*)\.pkg-cache$#'"\t${pkg_cache_dir//\\/\\\\}"'#' /etc/setup/setup.rc

Edit: what it makes me think though is if this is even necessary to do as I dont really see the purpose it serves.

Fails if folder has a space in the name

the .cmd fails as soon as it tries to create the download script if there's a space in the main folders name, or any folder above it. IE: C:\Users\Firstname Lastname\Downloads\cygwin portable

Failed to create file

###########################################################
# Installing [Cygwin Portable]...
###########################################################

Granting user [UserName] full access to Cygwin root [C:\Apps\cygwin-portable-installer\cygwin]...
processed file: C:\Apps\cygwin-portable-installer\cygwin
Successfully processed 1 files; Failed processing 0 files
Downloading '""https://cygwin.org/setup-x86_64.exe""' to '""C:\Apps\cygwin-portable-installer\cygwin\setup-x86_64.exe""' using curl...
Warning: Failed to create the file
Warning: _C:\Apps\cygwin-portable-installer\cygwin\setup-x86_64.exe_: Invalid
Warning: argument

curl: (23) Failed writing body (0 != 16384)

###########################################################
# Installing [Cygwin Portable] FAILED!
###########################################################

I think the problem is the double quote in the path.

I'm using Windows 10 latest version.

Installing on shared folder makes apt-cyg unavailable

For context: I main Linux systems and only run Windows via a number of VMs - development, work, etc. In order to save space and synchronize featuresets, my intention was to install a single instance of cygwin‑portable on a shared folder in the real host and then run the instance by mapping the networked drive on the Windows VMs.

The configuration for the shared folder is as follows:

[winshared]
browseable = yes
force user = winshared
force group = sharing
force create mode = 0777
force directory mode = 0775
acl allow execute always = True

Cygwin-Portable itself installs correctly. The problem is that the post-setup scripts in charge of installing apt-cyg, which I think run upon first opening conemu? download and install apt-cyg with some sort of permission issue that makes it unavailable:

root@Usuario-PC ~
$ ls /usr/local/bin
drwxrwxr-x  1 Unknown+User Unix_Group+1885   0 abr 13 12:44 .
drwxrwxr-x  1 Unknown+User Unix_Group+1885   0 abr 13 12:34 ..
-rw-rw-r--+ 1 Unknown+User Unix_Group+1885 65K abr 13 12:48 apt-cyg

root@Usuario-PC ~
$ apt-cyg
bash: /usr/local/bin/apt-cyg: Permission denied

Attempting to chmod +x the file has no observable effect:

root@Usuario-PC ~
$ chmod ugo+x /usr/local/bin/apt-cyg

root@Usuario-PC ~
$ ls -lha /usr/local/bin/
total 1,0M
drwxrwxr-x  1 Unknown+User Unix_Group+1885   0 abr 13 13:04 .
drwxrwxr-x  1 Unknown+User Unix_Group+1885   0 abr 13 12:34 ..
-rw-rw-r--+ 1 Unknown+User Unix_Group+1885 65K abr 13 12:48 apt-cyg

getfacl reports available permissions:

root@Usuario-PC /usr/local/bin
$ getfacl apt-cyg
# file: apt-cyg
# owner: Unknown+User
# group: Unix_Group+1885
user::rw-
user:Unknown+User:rw-
group::r--
group:Unix_Group+1885:r--
mask::rw-
other::r--

But using setfacl to try and modify them also has no observable effect.

The only apparent way to make the apt-cyg binary available is to raw-copying to a new filename, but it can't be placed anywhere in $PATH:

root@Usuario-PC /usr/local/bin
$ cat < apt-cyg > /usr/bin/apt-cyg2
$ cat < apt-cyg > /usr/local/bin/apt-cyg2
$ cat < apt-cyg > /tmp/apt-cyg2

$ /usr/bin/apt-cyg2
bash: /usr/bin/apt-cyg2: Permission denied
$ /usr/local/bin/apt-cyg2
bash: /usr/local/bin/apt-cyg2: Permission denied
$ /tmp/apt-cyg2
[normal apt-cyg output]

I presume this error could affect other components of Cygwin-Portable too, but since apt-cyg is not working correctly I can't install more software to test ATM. The components first installed by the system (ie.: anything listed in installer.cmd the first time) work without issue, but I can't tell at the moment about anything installed after.

For the record, installing Cygwin-Portable on the actual hard-drive works as intended, but copying the result to the shared folder results in the same errors as the above. Which defeats the point of having the install being portable.

Host: Linux Debian 10 with Samba
Guests:

  • Windows 7 FLP 32-bit
  • Windows 7 SP1 32-bit
  • Windows 8.1 32-bit

problem (and fix) with cygwin-portable.cmd

When running cygwin-portable.cmd I get strange output, example:

C:\Users\admin>cygwin-portable.cmd  pwd
Replacing [/etc/fstab]...
alternatives version 1.3.30c - Copyright (C) 2001 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.

usage: alternatives --install <link> <name> <path> <priority>
                    [--initscript <service>]
                    [--slave <link> <name> <path>]*
       alternatives --remove <name> <path>
       alternatives --auto <name>
       alternatives --config <name>
       alternatives --display <name>
       alternatives --set <name> <path>

common options: --verbose --test --help --usage --version
                --altdir <directory> --admindir <directory>
alternatives version 1.3.30c - Copyright (C) 2001 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.

usage: alternatives --install <link> <name> <path> <priority>
                    [--initscript <service>]
                    [--slave <link> <name> <path>]*
       alternatives --remove <name> <path>
       alternatives --auto <name>
       alternatives --config <name>
       alternatives --display <name>
       alternatives --set <name> <path>

common options: --verbose --test --help --usage --version
                --altdir <directory> --admindir <directory>
/home/root

C:\Users\admin>cygwin-portable.cmd  pwd
Replacing [/etc/fstab]...
/home/root

The "pwd" was executed, bute the usage of "alternatives" is annoying.

I found the bug in /portable-init.sh (I have no python installed) and here is my bugfix:
Test:

--- .versions/portable-init.sh~02~      2020-02-04 15:44:03.980437200 +0100
+++ portable-init.sh    2020-02-04 18:37:29.980422300 +0100
@@ -24,8 +24,10 @@
 sed -i -E "s/.*\\\.pkg-cache/"$'\t'"${pkg_cache_dir//\\/\\\\}/" /etc/setup/setup.rc

 # Make python3 available as python if python2 is not installed
-[[ -e /usr/bin/python3 ]] || /usr/sbin/update-alternatives --install /usr/bin/python3 python3 $(/usr/bin/find /usr/bin -maxdepth 1 -name "python3.*" -print -quit) 1
-[[ -e /usr/bin/python  ]] || /usr/sbin/update-alternatives --install /usr/bin/python  python  $(/usr/bin/find /usr/bin -maxdepth 1 -name "python3.*" -print -quit) 1
+if cygcheck -c | grep -q python; then
+  [[ -e /usr/bin/python3 ]] || /usr/sbin/update-alternatives --install /usr/bin/python3 python3 $(/usr/bin/find /usr/bin -maxdepth 1 -name "python3.*" -print -quit) 1
+  [[ -e /usr/bin/python  ]] || /usr/sbin/update-alternatives --install /usr/bin/python  python  $(/usr/bin/find /usr/bin -maxdepth 1 -name "python3.*" -print -quit) 1
+fi

 #

C:\Users\admin>cygwin-portable.cmd  pwd
Replacing [/etc/fstab]...
/home/root

Bug - Escape Special Character "!"

Some characters in cygwin-portable-installer.cmd need to be escaped before output lines to generated cmd files

example at portable-init.sh:
echo if [[ ! -e /opt/ansible ]]; then BAD RESULT >> if [[ -e /opt/ansible ]]
should be
echo if [[ ^! -e /opt/ansible ]]; then CORRECT RESULT >> if [[ ! -e /opt/ansible ]]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.