While creating a package for chocolatey, the installation fails because the installer asks for a language selection: Window asking for the user's language for installation.
So I tried, as explained in this page to get the user's language (get-culture
) and add it in the installation arguments by calling the variable ($locale
):
$ErrorActionPreference = 'Stop';
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$locale = "/L=" + (Get-Culture).LCID
$packageArgs = @{
packageName = 'PNAME'
unzipLocation = $toolsDir
file = "PNAME32bit.exe"
file64 = "PNAME64bit.exe"
fileType = 'EXE'
silentArgs = '/S $locale'
softwareName = 'PNAME*'
validExitCodes= @(0)
}
Install-ChocolateyInstallPackage @packageArgs
Remove-Item $toolsDir\*.exe -ea 0 -force
Unfortunately, no change, this window still appears.
My question is therefore: how to specify during installation, the user's language so that this is taken into account by the installer?
Thank you in advance for your help !
If the installer does not allow you to specify the language at the time of installation then you have two options:
The first one is relatively trivial to do but can be a little messy (Autohotkey would run in the background, detect the window, click the right language etc.). It may also get messy when you have to start 'clicking' the correct language. The second one would be the preferred method as it's less messy but would require some time working with the installer.
The ideal solution is of course to either find the correct parameter to pass to the installer OR get the vendor to add such a parameter.