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

Chocolatey 0.9.10 and exit codes - Chocolatey Package Provider is now reporting successful package installs as failures #131

Open
ferventcoder opened this issue Jun 17, 2016 · 2 comments
Assignees
Milestone

Comments

@ferventcoder
Copy link
Contributor

I mentioned this before in April - chocolatey/choco#512. 0.9.10 just released today and folks are going to start reporting breakages even though we noted it in our release notes and tried to give plenty of notice to folks that it was coming (2 months notice in this case).

Here is the relevant portion of the ChangeLog (under breaking changes):

  • Exit with the same exit code as the software being installed - see #512

There are more exit codes from Chocolatey now that indicate success -0, 1605, 1614, 1641, and 3010. You may need to adjust anything you were using that would only check for 0 and nonzero.
If you need the previous behavior, be sure to disable the feature usePackageExitCodes or use the --ignore-package-exit-codes switch in your choco commands.

@ferventcoder ferventcoder changed the title Chocolatey 0.9.10 and exit codes Chocolatey 0.9.10 and exit codes - reporting package install failures Jun 17, 2016
@ferventcoder ferventcoder changed the title Chocolatey 0.9.10 and exit codes - reporting package install failures Chocolatey 0.9.10 and exit codes - Provider is now reporting successful package installs as failures Jun 17, 2016
@ferventcoder ferventcoder changed the title Chocolatey 0.9.10 and exit codes - Provider is now reporting successful package installs as failures Chocolatey 0.9.10 and exit codes - Chocolatey Package Provider is now reporting successful package installs as failures Jun 17, 2016
@ferventcoder
Copy link
Contributor Author

ferventcoder commented Jun 17, 2016

The workaround until the provider handles this correctly is listed above.

To reiterate:

If you need the previous behavior, be sure to disable the feature usePackageExitCodes or use the --ignore-package-exit-codes switch in your choco commands.

You can add this to install_options or set the feature.

It's preferred to set the feature. You can do that with this:

$_choco_exe_path = "c:\\ProgramData\\chocolatey\\bin\\choco.exe"

# lint:ignore:80chars
    exec { "chocolatey_usePackageExitCodes_disable":
      path        => $::path,
      command     => "${_choco_exe_path} feature disable -n usePackageExitCodes",
      unless      => "cmd.exe /c ${_choco_exe_path} feature list -r | findstr /B /I /C:\"[ ] usePackageExitCodes\"",
    }
# lint:endignore

This may need a bit of tweaking, but it will be about what you need.

@ferventcoder
Copy link
Contributor Author

This was released as part of puppetlabs/chocolatey in 2.0.0. Will retroactively apply it back to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant