0

I must be missing something. I'd like to push two versions of my package - x86 and x64. How is this done? I failed to find any documentation about it, but it appears to be possible based on this issue: https://github.com/chocolatey/ChocolateyGUI/issues/262

So how do I publish two flavors of the same package?

Holt
  • 36,600
  • 7
  • 92
  • 139
  • Do you *need* two distinct versions of your package? Or is it okay if the package handles both the 32 and 64 bit case depending on platform? – codewario Aug 10 '21 at 17:12

1 Answers1

1

Unless you have a pressing need for two versions of the same package, you don't need two of them. Chocolatey's helper functions support 32 and 64 bit files from within the same chocolateyInstall.ps1 script.

See Install-ChocolateyPackage for details (other helpers have 32 and 64 bit differentiators as well) but for the parameters which have a 64 counterpart (e.g. -File and -File64), -File should be the 32 bit value and -File64 should be the 64 bit value. The others work much in the same way. Example:

$installPkgArgs = @{
  File = 'https://server.domain.tld/installer32.msi'
  File64 = 'https://server.domain.tld/installer64.msi
  Checksum = '32bitinstallerchecksum'
  Checksum64 = '64bitinstallerchecksum'

  # Other args like SilentArgs, etc.
}

Install-ChocolateyPackage @installPkgArgs

On the client side, if forcing the 32-bit or 64-bit version is desired (e.g. when installing the 32-bit version on 64-bit system), choco install --forceX86 pkg will achieve what you want. It's very unlikely (though not impossible) that you have a use case where using a single package won't work for your needs.

codewario
  • 19,553
  • 20
  • 90
  • 159