Ability to pass in arguments to the chocolateyinstall.ps1 file #133
Comments
As much as possible I would like to avoid something powershell from the command line. The inner guts of chocolatey are powershell, but the way folks use it from the outside doesn't have to be. |
It doesn't have to be powershell-y. Is there a way to access the
|
Ha! I actually typed out the word "powershell-y" but then removed it. :D You can access that within the ps1 (it's gets set as an environment variable), but are you worried about it moving on to the installer? |
More information on how it is used: https://github.com/chocolatey/chocolatey/blob/master/src/helpers/functions/Install-ChocolateyInstallPackage.ps1#L51-53 |
No, I'm not worried about the installer because I'm installing a zip file (which I don't think uses the arguments??). There's some customizations I want to do like pass in like where to install and what url to download it from. |
So it sounds like the |
Do you think this might be better as an addition to https://github.com/chocolatey/chocolatey/blob/master/src/helpers/functions/Install-ChocolateyZipPackage.ps1 |
Like we'd leave it as |
I'm not sure it would be that useful for 99% of cases. I'm using it to install our applications in a QA environment as well as production and depending on where I'm installing it I want to download the artifacts from different places and also want to tell it which version of the configs to use. It may be too much of an edge-case to change the way the zip installer works for everyone. |
Another thing I need to do is pass in username and password so I can download the file using basic authentication. Currently the installer doesn't support this at all. Would be nice if it did. Perhaps I should create a separate issue? |
I, too, would like to see the ability to do package-specific arguments or overrides. I'm building a package now that installs a SQL maintenance script and would love to provide variables for configuration. For example, which instance the script should install to. |
I'm closing this as a dupe of #159 - that's where the work was done. Use -params |
So did this '$env:chocolateyInstallArguments' functionality ever get implemented? I need to be able to modify the $zabbixConf variable inside the chocolateyInstall.ps1 script for zabbix-agent install- not seeing how this is currently possible? |
@alyssenko-ssi An environment variable for Install Arguments was implemented. However it should not be looked at all for packages. If you need information from the user, one should be using |
I'm using chocolatey to install our custom internal applications. I want the ability to pass in arguments that are accessible to the chocolateyinstall.ps1 file. I could solve some of it by setting some environment variables, but it would be easier if I could pass in the arguments to the installer. Essentially what I'd like to do is this:
cinst myapp -args @{arg1="value1";arg2="value2"}
Then from my chocolateyinstall.ps1 file I'd like to access them like this:
Currently the
installArguments
is automatically appended to theexe
ormsi
arguments but I can't parse them or do anything with them from thechocolateyinstall.ps1
fileLink to original discussion: https://groups.google.com/group/chocolatey/browse_thread/thread/19160bee38885b97?hl=en
The text was updated successfully, but these errors were encountered: