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

Silent Args being passed as a string array cause package failure #808

Closed
ferventcoder opened this issue Jun 17, 2016 · 5 comments
Closed
Assignees
Milestone

Comments

@ferventcoder
Copy link
Member

ferventcoder commented Jun 17, 2016

First bug to come out of #697. https://chocolatey.org/docs/helpers-install-chocolatey-package#parameters SilentArgs is now strictly a string instead of left up for interpretation. Most items were converted in this way to provide clarity.

https://chocolatey.org/packages/OpenSSL.Light#files - chocolateyInstall.ps1:

 silentArgs = '/silent', '/verysilent', '/sp-', '/suppressmsgboxes',
    "/DIR=`"$installDir`"";

Results in:

ERROR: Cannot process argument transformation on parameter 'silentArgs'. Cannot convert value to type System.String.
The install of openssl.light was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\OpenSSL.Light\tools\chocolateyInstall.ps1'.
@ferventcoder
Copy link
Member Author

Is this something we fix or state that the package should not have done things in a non-compliant way?

@jberezanski
Copy link

Was it documented anywhere that silentArgs should have been a single string?

@ferventcoder
Copy link
Member Author

Yes - in all examples and in the old documentation for the last five
years we've said it was a string value.

You can look at the older wiki docs and the history of those wiki pages to
see this.

On Saturday, June 18, 2016, Jakub Berezanski notifications@github.com
wrote:

Was it documented anywhere that silentArgs should have been a single
string?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#808 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAD4DqDcmxSRT4fzcwB_khJ5gWTUha5iks5qNDqogaJpZM4I4wPz
.

Rob
"Be passionate in all you do"

http://codebetter.com/robreynolds
http://ferventcoder.com
https://twitter.com/ferventcoder

@jberezanski
Copy link

Ah, indeed, forgot about the wiki for a moment.
I examined the history of Install-ChocolateyPackage. The mention of a string data type only appeared after you turned on auto doc on April 12. In all earlier revisions, the description of the parameter did not specify the type, only the interpretation. The example did show a single string value, but it did not necessarily mean that an array of strings was invalid.
I agree, though, that the intent of the documentation was that it should have been a simple string. In that light, I'd say leave it as-is.

However, perhaps this is a good time for a small official usability improvement? Changing the parameter to a string[] would be a backward compatible change, I believe, and it would help packages with complex installer argument construction logic (such as Visual Studio) - those packages would be able to accumulate installer arguments in an array and pass it unmodified to the helper. This would also align the helper with existing PowerShell cmdlets which declare an ArgumentList parameter, where arguments are passed as an array (e.g. Invoke-Command, Start-Process, New-Object).

@ferventcoder ferventcoder modified the milestones: 0.9.10.2, 0.9.10.3 Jun 18, 2016
@ferventcoder
Copy link
Member Author

As long as it is backwards compatible, 👍

@ferventcoder ferventcoder self-assigned this Jun 22, 2016
ferventcoder added a commit that referenced this issue Jun 23, 2016
Some packages have passed silent arguments as an array. Allow
specifying it as a string array and then join the arguments together.
ferventcoder added a commit that referenced this issue Jun 23, 2016
* 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
ferventcoder added a commit that referenced this issue Jun 23, 2016
* 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
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

3 participants