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

dynamic arguments fail when chocolateyinstall.ps1 has no arguments #77

Open
lmayorga1980 opened this issue Aug 4, 2015 · 8 comments
Open

Comments

@lmayorga1980
Copy link

chocolateyinstall.ps1

Install-ChocolateyPackage 'siteminder' 'exe' '' 'http://mywebserver/puppet/siteminder-12.51.6-win64.exe'

puppet

  file { 'config' :
    ensure  => present,
    path    => "C:\\Temp\\${pkg}.properties",
    content => template('siteminder/siteminder-win64.properties.erb'),
  } ->

  package { $pkg :
    ensure          => $version,
    name            => 'siteminder',
    provider        => 'chocolatey',
    install_options => ['-override', '-installArgs', '"', 'f', '"C:\\Temp\\${pkg}.properties"','-i','silent', '"'],
  }

log file

https://gist.github.com/lmayorga1980/664e90b62b944dd199c6

@ferventcoder
Copy link
Contributor

@lmayorga1980 looks like the arguments are not being applied successfully -
https://gist.github.com/lmayorga1980/664e90b62b944dd199c6#file-puppet-chocolatey-log-L228

What version of the choco provider and what version of chocolatey?

@ferventcoder
Copy link
Contributor

It appears that you may not have applied the information as the instructions have stated. https://forge.puppetlabs.com/chocolatey/chocolatey#install-options-with-quotes--spaces

Try this:

 install_options => ['-override', '-installArgs', '"', 'f', '""C:\\Temp\\${pkg}.properties""','-i','silent', '"'],

Note the double double quotes in surrounding something you need quoted.

@lmayorga1980
Copy link
Author

Interesting since the it did not contain the spaces. Now it seems that the ${pkg} variable is not interpolated.

install_options => ['-override', '-installArgs', '"', 'f', \"'""C:\\Temp\\${pkg}.properties""'\",'-i','silent', '"'], maybe?

@ferventcoder
Copy link
Contributor

Interesting since the it did not contain the spaces.

But you want to specify quotes. If you don't need quotes passed it becomes easier.

Try this instead

install_options => ['-override', '-installArgs', '"', 'f', """C:\\Temp\\${pkg}.properties""",'-i','silent', '"'],

@ferventcoder
Copy link
Contributor

you can also add --noop in there and watch the log until the options look like they are being passed right.

@lmayorga1980
Copy link
Author

See the expanded one...

choco.exe install siteminder -version 12.51.6 -dvy -override --execution-timeout=3600 -installArgs " -f C:\Temp\siteminder-12.51.6-win64.properties -i silent " -source http://myserver/chocopack
I wonder if the timeout overlaps with the puppet apply timeout. Otherwise I will need an exec type.

@ferventcoder
Copy link
Contributor

3600 seconds. That's a long time.

@ferventcoder
Copy link
Contributor

See the expanded one...

Not completely sure I follow. What is the option you set?

DavidS pushed a commit to DavidS/puppetlabs-chocolatey that referenced this issue Nov 15, 2019
…ter/MODULES-4562_use_original_choco

(MODULES-4562) Use actual choco.exe
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

2 participants