Skip to content

Commit

Permalink
[AU cygwin] fixed bug with non existing tools location
Browse files Browse the repository at this point in the history
closes #1291
  • Loading branch information
majkinetor committed Oct 22, 2019
1 parent 9b6fe53 commit 2870bd3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 7 additions & 0 deletions automatic/cygwin/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Package changelog for [cygwin](https://chocolatey.org/packages/cygwin)

## Version: 3.0.7.20191022

- **BUGS:** Fixed permission bug when package was installed when `$Env:ChocolateyToolsLocation` wasn't created yet [#1291](https://github.com/chocolatey-community/chocolatey-coreteampackages/issues/1291)

## Version: 2.11.2.20181212 (2018-12-12)

- **BUGS:** Using cygwin x86 as the source tries to install x64 version of cygwin (thanks to [@OXINARF](https://github.com/OXINARF) for providing the fix in PR [#1165](https://github.com/chocolatey/chocolatey-coreteampackages/pull/1165))

## Version: 2.8.1 (2017-07-03)

- **BUGS:** Removed admin tag

## Version: 2.8.0.20170607 (2017-06-07)

- **BUGS:** Changed docs url to https equivalent
- **ENHANCEMENT:** Added changelog for package
- **ENHANCEMENT:** Embedded cygwin package
Expand Down
2 changes: 1 addition & 1 deletion automatic/cygwin/Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# <img src="https://cdn.jsdelivr.net/gh/chocolatey-community/chocolatey-coreteampackages@c8d48758cdc18d43e6c1525824720377c8b9ba24/icons/Cygwin.png" width="48" height="48"/> [Cygwin](https://chocolatey.org/packages/Cygwin)


Cygwin is a collection of tools which provide a Linux look and feel environment for Windows. Cygwin is also a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality.

## Package parameters
Expand All @@ -17,6 +16,7 @@ Example: `choco install cygwin --params "/InstallDir:C:\your\install\path /NoSta

## Notes

- [Cygwin setup command line arguments](https://cygwin.com/faq/faq.html#faq.setup.cli)
- This package provides only the last version of Cygwin.
- For better functionality, it is recommended you install the [cyg-get package](/packages/cyg-get). Use the cyg-get utility to add packages to your Cygwin installation.

12 changes: 7 additions & 5 deletions automatic/cygwin/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# https://cygwin.com/faq/faq.html#faq.setup.cli

$ErrorActionPreference = 'Stop'
$toolsPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$ErrorActionPreference = 'Stop'

$toolsPath = Split-Path $MyInvocation.MyCommand.Definition
$pp = Get-PackageParameters
$toolsLocation = Get-ToolsLocation

#https://github.com/chocolatey-community/chocolatey-coreteampackages/issues/1291
mkdir $toolsLocation -ea 0 | Out-Null

$cygwin_root = (Get-ItemProperty 'HKLM:\SOFTWARE\Cygwin\setup' -ea 0).rootdir
if (!$cygwin_root) {
$cygwin_root = if ($pp.InstallDir) { $pp.InstallDir } else { (Get-ToolsLocation) + '\cygwin' }
$cygwin_root = if ($pp.InstallDir) { $pp.InstallDir } else { "$toolsLocation\cygwin" }
} else { Write-Host 'Existing installation detected, ignoring InstallDir argument' }

if (!$pp.Proxy) {
Expand Down

0 comments on commit 2870bd3

Please sign in to comment.