Brian Green Brian Green - 1 year ago 47
PowerShell Question

Is there anyway to check what chocolatey is passing Powershell from installArguments?

I'm trying to install an MSI that takes arguments with chocolatey

The msiexec command looks like

msiexec.exe /i path_to_msi UNAME="" PASS="" SQLSERVER="" CHKFRONTEND="1" CHKBACKEND="1" /quiet

My ps1 file has the following code in it

Start-Process -file 'bin\Release\Installer.msi' -args '/qn' -passthru | wait-process

and here is the cinst

cinst isbu -source %cd% -installArguments ‘UNAME=''user'' PASS=''pass'' SQLSERVER='''' CHKFRONTEND=''1'' CHKBACKEND=''0''’

When the CHKBACKEND is set to "1" it will interact with a sql database. But when it is set to 0 it skips it entirely.

I looked in Windows Event Viewer and it is saying it is failing on the sql database which it shouldn't even be interacting with. So I'm guessing the issue is somewhere when chocolatey sends the install args to powershell. Is there anywhere I can check what choco is passing? I looked in Event Viewer and didn't see anything in there.

Answer Source

To see what chocolatey is doing here, just pass -debug

I noticed that you are calling the MSI yourself here and not using Chocolatey's built in methods, which would make use of -installArgs, I'd suggest reading through CreatePackages

And then take a look at the Helper Reference, specifically Install-ChocolateyInstallPackage