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

{WIP}(GH-598) add outputdirectory for choco pack #609

Closed
wants to merge 457 commits into from
Closed

{WIP}(GH-598) add outputdirectory for choco pack #609

wants to merge 457 commits into from

Conversation

laedit
Copy link
Contributor

@laedit laedit commented Feb 4, 2016

Fix #598
Add a new option outputdirectory for PackCommand and the corresponding
OutputDirectory property in ChocolateyConfiguration.

Pack run can't be tested because PackageBuilder isn't mocked and not
use mocked filesystem.

Should I add an indirection for PackageBuilder through an IPackageBuilderFactory which can be passed to NugetService constructor?

@@ -186,6 +186,7 @@ private void append_output(StringBuilder propertyValues, string append)
public string Version { get; set; }
public bool AllVersions { get; set; }
public bool SkipPackageInstallProvider { get; set; }
public string OutputDirectory { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

👍

When interacting with a PowerShell host, ensure it returns the proper
exit code by calling the right method that will set it for both system
powershell and the internal host.
When attempting to act on a downloaded file, it may be a text file and
not a binary. When that is determined, throw an error instead.
When running PowerShell and certain things are found, exit
appropriately.

- When a file is not found, exit 2.
- When a file found is not right, exit 4.
- When a file can not be downloaded, exit 404.
- When unzipping has issues, exit with its result exit code
When running native installers, allow choco to exit with the same exit
code as the installer. Additionally, detect valid exit codes and do not
error when receiving those exit codes.

Pass the exit code to the package so  that result can be passed back.
This is more reflective of what the function does.
* stable:
  (maint) rename Get-FileName to Get-WebFileName
  (maint) Log host version as well.
  (GH-512) Exit with same code as installer
  (GH-707) Exit with specific exit codes
  (GH-649) Error if executable is text file
  (GH-709) Get Exit code from PowerShell Host
  (GH-512) Display exit code for packages
  (GH-710) prompt with timeout on some commands
  (maint) better error handling
Package exit codes provide the ability for the exit code of an
underlying installer to be passed through to Chocolatey's exit code.
This value is the last non-zero exit code from a package or dependency
that Chocolatey is currently installing. This change, while
very enabling, may be surprising for some folks and they may wish to
shut this feature off.

As this feature may need to be shut off, provide it as both a feature
and switches to turn it on/off per install, upgrade, and uninstall. Add
the switches to tab expansion as well.
* stable:
  (GH-512) Allow configuring package exit codes
@ferventcoder ferventcoder changed the title (GH-598) add outputdirectory for choco pack {WIP} {WIP}(GH-598) add outputdirectory for choco pack Apr 25, 2016
Add installer types for

- BitRock Installer
- QT Installer
- Squirrel
When loading extensions, make sure the user also knows they are being
loaded by reporting them in log info.
When installs exit in a way that indicates a reboot is necessary,
indicate so in the summary log. Include the package name and exit code.
* stable:
  (log) Explain how to install licensed extension
  (GH-712) Report required reboots
  (GH-641) Allow more exit codes for install shield
  (GH-715) Report loaded extensions to the user
  (GH-258) Remove unnecessary configuration
  (GH-641) Add BitRock / QT / Squirrel Installers
Once every ten runs or  so, randomly mention the professional and
business versions. This will help bring awareness for users that won't
be aware in any other way.

When a user is using install directory override through the install
arguments, provide awareness that there is a feature that will save
them the trouble of spending extra time determining the install
directory themselves.
* stable:
  (maint) formatting
  (maint) Provide awareness of pro / business
Certain package commands will honor the install directory override, but
others will not. If those are used, Chocolatey should warn that the
directory override will not work.
* stable:
  (GH-258) Warn when directory overrides won't be honored
Would you look at that? I mean, just look at it!
* stable:
  (maint) Look at that new logo!
  (doc) update readme with support / newsletter
  (doc) update changelog/nuspec
* stable:
  (doc) see logo in readme/changelog
ferventcoder and others added 22 commits June 22, 2016 09:11
There are cases when the process has signalled it has exited, but it
hasn't actually returned an exit code yet. Hold for 2 seconds to allow
the process to fully exit before attempting to capture the exit code.
When a pending file is created, it needs to be at least 10 seconds old
before choco will automatically remove the unfinished pacakge. This
allows running choco functions inside of a package (as long as they are
done quickly).

If someone needs to override the functionality of the removal of a
package due to the pending file, choco will also look for a
.chocolateyPendingSkip and skip the removal if that file is found.
After downloading or FTPing a file, sleep for a second. When finishing
running processes, do the same.
If a valid exit code specified is not recognized as one of choco's
valid exit codes, provide a warning and set the exit code to 0.
Some packages have passed silent arguments as an array. Allow
specifying it as a string array and then join the arguments together.
Using `Path.GetTempPath()` instead of
`Environment.GetEnvironmentVariable("TEMP")` in 76ae7e2 for GH-532
has caused the SYSTEM user to return one of the following:

 * `c:\windows\system32\config\systemprofile\appdata\local\temp`
 * `c:\windows\syswow64\config\systemprofile\appdata\local\temp`

These folders seem to cause issues with accessing files, causing all
kinds of fun issues, such as "Not able to read package from path" and
not able to find executables being downloaded to these folders.

If one of these two folders is detected, ensure that the folder
structure is `%SystemRoot%\TEMP`.
* stable:
  (GH-826) SYSTEM user always uses machine TEMP
  (GH-808) Allow silent args as array
  (GH-821) ValidExitCodes not recognized return 0
  (GH-818) Allow disk to catch up - sleep
  (GH-822) Provide pending override and file wait
  (GH-818) Wait for processes to exit + 2 seconds
  (maint) formatting
  (GH-819) Fix - NotSilent install failure binding
  (GH-775) remove 7za
  (GH-775) Use 7z instead of 7za
If it is a valid exit code, choco used to set the exit code to zero.
Otherwise the exit code was set to 1. That behavior needs to continue to
be that way for the exit code of choco.exe when ignoring package exit
codes.
* stable:
  (GH-827) No really, ignore package exit codes
To maintain compatibility with licensed versions for now, allow
RemovePendingPackagesTask to continue to use the previous constructor
as well as the new one.
* stable:
  (maint) match casing for directory override args
  (version) 0.9.10.3
  (GH-808) type is string, not statements
  update CHANGELOG/nuspec
  (maint) RemovePendingPackagesTask 2 constructors
Add a new option outputdirectory for PackCommand and the corresponding
OutputDirectory property in ChocolateyConfiguration.
Pack run can't be tested because PackageBuilder isn't mocked and not
used mocked filesystem.
…r-choco-pack' into (GH-598)-add-output-directory-for-choco-pack
@laedit
Copy link
Contributor Author

laedit commented Jun 27, 2016

I have added the integration tests and done a rebase since the branch was behind.
Sorry for the mess.

@ferventcoder
Copy link
Member

ferventcoder commented Jul 24, 2016

Please don't merge, always fetch and rebase. Right now this is not in a state that it can even be reviewed. You can try to back out the merge and just provide the commits for the changes or you can close and reopen this with just the changes.

@laedit
Copy link
Contributor Author

laedit commented Jul 31, 2016

Sorry about that, I'll try to fix it this week.

@laedit
Copy link
Contributor Author

laedit commented Aug 3, 2016

I am sorry, this one is irrecoverable, I had to create a new PR #891.

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

Successfully merging this pull request may close these issues.

5 participants