Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(MODULES-3641) Remove Windows_env module dependency #34

Conversation

ferventcoder
Copy link

It was originally required to set the environment variables prior
to running Chocolatey install to help prepare the environment for
suitability. It was originally added in 5a849ad and ad57d14
to ensure that Chocolatey could be suitable to be installed and
used to install packages on the first run. This was also to
ensure that you could override the Chocolatey install directory
by setting the value in advance of the install.

In b5034d1 @rismoney removed the necessity for pre-setting the
environment variable as it was passed to the install exec.

We have since determined that the providers default to a location
of $env:ALLUSERSPROFILE\chocolatey\bin\choco.exe when an install
path cannot be found.

chocopath = (chocoInstallPath if (chocoInstallPath && file_exists?("#{chocoInstallPath}\\bin\\choco.exe"))) ||
('C:\ProgramData\chocolatey' if file_exists?('C:\ProgramData\chocolatey\bin\choco.exe')) ||
('C:\Chocolatey' if file_exists?('C:\Chocolatey\bin\choco.exe')) ||
"#{ENV['ALLUSERSPROFILE']}\\chocolatey"
chocopath += '\bin\choco.exe'

This evaluates to the default install path of
C:\ProgramData\chocolatey\bin\choco.exe, allowing suitability
to work properly on the same converge as the install ONLY if you
install to the default install location with Chocolatey. This
has nothing to do with the hope that windows_env would update
the current shell! So it is safe to remove windows_env without
losing any of the current behavior.

@ferventcoder ferventcoder force-pushed the ticket/master/MODULES-3641-remove-windows_env branch from 183b555 to 63ff946 Compare July 26, 2016 22:42
@ferventcoder ferventcoder changed the title {WIP}(MODULES-3641) Remove Windows_env module dependency (MODULES-3641) Remove Windows_env module dependency Jul 26, 2016
@ferventcoder ferventcoder force-pushed the ticket/master/MODULES-3641-remove-windows_env branch from 63ff946 to 33c6831 Compare July 26, 2016 22:48
@ferventcoder
Copy link
Author

Rebased against #33

@ferventcoder
Copy link
Author

@puppetlabs/windows please review.

@ferventcoder ferventcoder force-pushed the ticket/master/MODULES-3641-remove-windows_env branch from 33c6831 to e809a62 Compare July 28, 2016 22:44
When overriding the default installation directory, it can affect
suitability during the same run that Chocolatey is installed
during. Clarify what that is so folks can make an informed
opinion for installation.
@ferventcoder ferventcoder force-pushed the ticket/master/MODULES-3641-remove-windows_env branch from e809a62 to 05cae20 Compare July 29, 2016 19:24
It was originally required to set the environment variables prior
to running Chocolatey install to help prepare the environment for
suitability. It was originally added in 5a849ad and ad57d14
to ensure that Chocolatey could be suitable to be installed and
used to install packages on the first run. This was also to
ensure that you could override the Chocolatey install directory
by setting the value in advance of the install.

In b5034d1 @rismoney removed the necessity for pre-setting the
environment variable as it was passed to the install exec.

We have since determined that the providers default to a location
of `$env:ALLUSERSPROFILE\chocolatey\bin\choco.exe` when an install
path cannot be found. https://github.com/puppetlabs/puppetlabs-chocolatey/blob/fa67417bbfac06049f36346e02eb09dddb68084c/lib/puppet_x/chocolatey/chocolatey_common.rb#L31-L36
This evaluates to the default install path of
`C:\ProgramData\chocolatey\bin\choco.exe`, allowing suitability
to work properly on the same converge as the install ONLY if you
install to the default install location with Chocolatey. This
has nothing to do with the hope that windows_env would update
the current shell! So it is safe to remove windows_env without
losing any of the current behavior.
@ferventcoder ferventcoder force-pushed the ticket/master/MODULES-3641-remove-windows_env branch from 05cae20 to 10535d9 Compare August 1, 2016 18:28
@@ -2,6 +2,5 @@ fixtures:
forge_modules:
stdlib: "puppetlabs/stdlib"
powershell: "puppetlabs/powershell"
windows_env: "badgerious/windows_env"
Copy link
Author

@ferventcoder ferventcoder Aug 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned up after @jamesp noticed this was still in here.

@jpogran
Copy link

jpogran commented Aug 4, 2016

Found MODULES-3677 during testing, work to fix that requires new ticket and is not related to this one. 👍

@jpogran jpogran merged commit a4f36ea into puppetlabs:master Aug 4, 2016
@ferventcoder ferventcoder deleted the ticket/master/MODULES-3641-remove-windows_env branch August 4, 2016 21:32
ThoughtCrhyme pushed a commit to ThoughtCrhyme/puppetlabs-chocolatey that referenced this pull request Mar 20, 2017
…-document_qaelk

(QA-2747) document qaelk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants