How to change installargs value for installed Chocolatey package?

Viewed 297

Assume, I've installed the Opera by command:

choco install opera

The chocolatey update Opera correct. It's good. But Opera add icons to taskbar and desktop on each upgrade.

I want updates to be performed with an argument --installargs (not to be confused with --params), as if the installation was performed by the command:

choco install opera --installargs "-desktopshortcut 0 -pintotaskbar 0"
  1. Where these --installargs are stored?
  2. How to change --installargs value for installed Chocolatey package?
1 Answers

During an installation/upgrade, Chocolatey stores the arguments that were passed in, in an encrypted file in the c:/programdata/chocolatey/.chocolatey folder. In order to ignore, or rather override, the arguments that are stored by Chocolatey, you can simply pass the arguments again in the new command you are executing.

By default, Chocolatey doesn't currently use the stored arguments when performing an upgrade. You need to manually opt-in to use the stored arguments by enabling the useRememberedArgumentsForUpgrades feature, which can be done using the feature command.

If you are using this feature, there are some additional arguments that you can pass into the upgrade command:

  • --userememberedargs
  • --ignorerememberedargs

to control whether they are used or not.

Related