Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package succeeds but software Install silently fails when Install-ChocolateyInstallPackage has the wrong arguments #629

Closed
ferventcoder opened this issue Feb 11, 2016 · 1 comment

Comments

@ferventcoder
Copy link
Member

If a package tries to install something but doesn't pass the right arguments, do not silently state it is successful

https://gist.github.com/fredrikaverpil/b8b1ce5fd0bacca0a644#file-vcpython27_no_uninstall_possible-log-L84

@ferventcoder ferventcoder self-assigned this Feb 11, 2016
@ferventcoder ferventcoder added this to the 0.9.10 milestone Feb 11, 2016
@ferventcoder ferventcoder changed the title If a package tries to install something but doesn't pass the right arguments, do not silently state it is successful Package succeeds but software Install silently fails when Install-ChocolateyInstallPackage has the wrong arguments Feb 11, 2016
@ferventcoder
Copy link
Member Author

Found it, fileType is the switch. Since it is empty, it should fail.

if ($fileType -like 'msi') {
$msiArgs = "/i `"$file`""
if ($overrideArguments) {
$msiArgs = "$msiArgs $additionalInstallArgs";
write-host "Overriding package arguments with `'$additionalInstallArgs`'";
} else {
$msiArgs = "$msiArgs $silentArgs $additionalInstallArgs";
}
Start-ChocolateyProcessAsAdmin "$msiArgs" 'msiexec' -validExitCodes $validExitCodes
#Start-Process -FilePath msiexec -ArgumentList $msiArgs -Wait
}
if ($fileType -like 'exe') {
if ($overrideArguments) {
Start-ChocolateyProcessAsAdmin "$additionalInstallArgs" $file -validExitCodes $validExitCodes
write-host "Overriding package arguments with `'$additionalInstallArgs`'";
} else {
Start-ChocolateyProcessAsAdmin "$silentArgs $additionalInstallArgs" $file -validExitCodes $validExitCodes
}
}
if($fileType -like 'msu') {
if ($overrideArguments) {
$msuArgs = "$file $additionalInstallArgs"
} else {
$msuArgs = "$file $silentArgs $additionalInstallArgs"
}
Start-ChocolateyProcessAsAdmin "$msuArgs" 'wusa.exe' -validExitCodes $validExitCodes
}

ferventcoder added a commit that referenced this issue Feb 12, 2016
Validate that File and FileType are not null. If FileType is present
but is not one of the proper settings, write a warning and set it to
'exe'.
ferventcoder added a commit to ferventcoder/choco that referenced this issue Feb 12, 2016
* stable:
  (doc) update changelog/nuspec
  (chocolateyGH-631) Remove Get-BinRoot, Add Get-ToolsLocation
  (chocolateyGH-606) Check for License in User Profile
  (chocolateyGH-629) Install-ChocolateyInstallPackage Validate Parameters
  (doc) Update changelog/nuspec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants