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 !