Ensure `--not-silent` should only remove the silent switches
Hey there, while writing packages I sometimes find myself in the situation that I want to pass some arguments to an installer, which are not related to making the process silent. For example a specific installation location. Currently I do this inside of the silentArgs, but in my option this isn't quit the best way to accomplish this, because when the user decides to use the -notsilent flag, these arguments are not getting applied. Or am I missing something?
@norbert6 you might want to take a look at using Package Parameters. There is a how-to here on how you can use them:
https://github.com/chocolatey/choco/wiki/How-To-Parse-PackageParameters-Argument
Does that answer your question?
@gep13 If I get the idea of Package Parameters right, it will still use the silentArgs "slot" when calling Install-ChocolateyPackage. What I was thinking about is a second way to pass Arguments to Install-ChocolateyPackage, which is not affected by the -notsilent flag. Because in my understanding Package Parameters will be ignored if the user sets this flag.
What exactly do you mean by:
silentArgs "slot" when calling Install-ChocolateyPackage.
So currently the Syntax for Install-ChocolateyPackage is
Install-ChocolateyPackage $packageName $installerType $silentArgs $url $url64bit
And with $silentArgs you are able to pass Arguments to the installer, mainly to make the process silent. If the user invokes the package installation with the -notsilent flag, these arguments will, correct me if I'm wrong, be simply ignored and not passed to the installer. Now I'm in the situation where I have some additional arguments I need to pass to the installer, which should not be affected by the -notsilent flag. So I was thinking about a new parameter for the Install-ChocolateyPackage function, something like this:
Install-ChocolateyPackage $packageName $installerType $args $silentArgs $url $url64bit
Ah, I see what you are getting at. @ferventcoder what are your thoughts on this?
This will get resolved as part choco getting smarter about native installers and be able to remove the silent argument only.
It's unlikely that will will want to introduce a new argument at this time as it would provide more confusion. Yes it is called silent arguments, but it is really all of the native installer arguments, including the silent switches.