0

When I created this Chocolatey package for Qt 5.12.1, everything seemed to work fine, except when I did choco install qt, it opened the Qt installer that I have embedded into the tools folder.

Here is the chocolateyinstall.ps1:

$ErrorActionPreference = 'Stop'; 
$packageName = 'qt'
$toolsDir   = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$fileLocation = Join-Path $toolsDir 'qt-opensource-windows-x86-5.12.1.exe'
$packageArgs = @{
  packageName   = $packageName
  unzipLocation = $toolsDir
  fileType      = 'EXE'
  file         = $fileLocation

  softwareName  = 'Qt*' 
  checksum      = ''
  checksumType  = 'sha256' 
  silentArgs   = "/S"          
  validExitCodes= @(0, 3010, 1641)
}

Install-ChocolateyInstallPackage @packageArgs 

Here is the qt.nuspec:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
  <metadata>
    <id>qt</id>
    <version>5.12.1</version>
    <title>qt (Install)</title>
    <authors>Qt Project</authors>
    <summary>Installs Qt</summary>
    <description>Installs Qt </description>
  </metadata>
  <files>
    <file src="tools\**" target="tools" />
  </files>
</package>

Thanks guys!

DeZLearnsPCs
  • 81
  • 2
  • 9
  • 1
    Are you sure, that `qt-opensource-windows-x86-5.12.1.exe /S` starts a silent install? – Manuel Batsching Mar 10 '20 at 14:28
  • I am not. I couldn't find a definitive silent argument on Qt's documentation. I did find /silent on the website for a different piece of software, but I assumed that /s and /silent are the same. Am I wrong in assuming this? – DeZLearnsPCs Mar 10 '20 at 14:29
  • Update: I changed the `silentArg` to `/silent` but it didn't change anything. The installer still opened, and when I closed the installer, `cmd` gave me this error: – DeZLearnsPCs Mar 10 '20 at 14:35
  • `ERROR: Running ["C:\ProgramData\chocolatey\lib\qt\tools\qt-opensource-windows-x86-5.12.1.exe" /silent ] was not successful. Exit code was '3'. Exit code indicates the following: A fatal error occurred when preparing or moving to next install phase. Check to be sure you have enough memory to perform an installation and try again..` – DeZLearnsPCs Mar 10 '20 at 14:36
  • 1
    Unfortunately you cant assume that with exe-installers. There is a tool called "ussf" linked to from the chocolatey quickstart guide, that helps you figure out the silent installer args, if there are any: https://chocolatey.org/docs/CreatePackagesQuickStart#quick-start-guide – Manuel Batsching Mar 10 '20 at 14:36
  • Installing that tool now. Thank you. So are you saying this is for sure a problem with the silent argument? – DeZLearnsPCs Mar 10 '20 at 14:38
  • 1
    If the installer opens, it is very likely that the wrong parameter for a silent install was provided. The exception that you mentioned in your comment seems to point to a different issue. – Manuel Batsching Mar 10 '20 at 14:41
  • Well, I found out that Qt Installation Framework doesn't provide any flavor of silent installs. Thank you for helping me recognize the problem! – DeZLearnsPCs Mar 10 '20 at 14:47

0 Answers0