Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
* stable:
  (GH-964) Uninstall-ChocolateyPackage empty $fileType
  (maint) formatting
  (doc) Different Error for Empty Secure Checksums
  (doc) update generated docs
  (doc) note FileFullPath is an alias in 0.10.1
  • Loading branch information
ferventcoder committed Sep 15, 2016
2 parents 1784c93 + cd4b730 commit ab07573
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/generated/HelpersInstallChocolateyInstallPackage.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ Full file path to native installer to run. If embedding in the package,
you can get it to the path with
`"$(Split-Path -parent $MyInvocation.MyCommand.Definition)\\INSTALLER_FILE"`

In 0.10.1+, `FileFullPath` is an alias for File.

Property | Value
---------------------- | ------------
Aliases | fileFullPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ param(
if ($selection -eq 0) { return }
}

throw "Empty checksums are no longer allowed by default for non-secure sources. Please ask the maintainer to add checksums to this package. In the meantime if you need this package to work correctly, please enable the feature allowEmptyChecksums or provide the runtime switch '--allowEmptyChecksums'. We strongly advise against allowing empty checksums for HTTP/FTP sources."
if ($originalUrl -ne $null -and $originalUrl.ToLower().StartsWith("https")) {
throw "This package downloads over HTTPS but does not yet have package checksums to verify the package. We recommend asking the maintainer to add checksums to this package. In the meantime if you need this package to work correctly, please enable the feature allowEmptyChecksumsSecure or provide the runtime switch '--allowEmptyChecksums'."
} else {
throw "Empty checksums are no longer allowed by default for non-secure sources. Please ask the maintainer to add checksums to this package. In the meantime if you need this package to work correctly, please enable the feature allowEmptyChecksums or provide the runtime switch '--allowEmptyChecksums'. It is strongly advised against allowing empty checksums for non-internal HTTP/FTP sources."
}
}

if (!([System.IO.File]::Exists($file))) { throw "Unable to checksum a file that doesn't exist - Could not find file `'$file`'" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ Full file path to native installer to run. If embedding in the package,
you can get it to the path with
`"$(Split-Path -parent $MyInvocation.MyCommand.Definition)\\INSTALLER_FILE"`
In 0.10.1+, `FileFullPath` is an alias for File.
.PARAMETER ValidExitCodes
Array of exit codes indicating success. Defaults to `@(0)`.
Expand Down Expand Up @@ -164,8 +166,8 @@ param(
Write-Debug 'No FileType supplied. Using the file extension to determine FileType'
$fileType = [System.IO.Path]::GetExtension("$file").Replace(".", "")
}
$installerTypeLower = $fileType.ToLower()

$installerTypeLower = $fileType.ToLower()
if ($installerTypeLower -ne 'msi' -and $installerTypeLower -ne 'exe' -and $installerTypeLower -ne 'msu') {
Write-Warning "FileType '$fileType' is unrecognized, using 'exe' instead."
$fileType = 'exe'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ recommended that it matches the package id.
.PARAMETER FileType
This is the extension of the file. This should be either exe or msi.
If what is provided is empty or null, Chocolatey will use 'exe'
starting in 0.10.1.
.PARAMETER SilentArgs
OPTIONAL - These are the parameters to pass to the native uninstaller,
Expand Down Expand Up @@ -120,6 +123,13 @@ param(
$additionalInstallArgs = $env:chocolateyInstallArguments;
if ($additionalInstallArgs -eq $null) { $additionalInstallArgs = ''; }
$overrideArguments = $env:chocolateyInstallOverride;

if ($fileType -eq $null) { $fileType = '' }
$installerTypeLower = $fileType.ToLower()
if ($installerTypeLower -ne 'msi' -and $installerTypeLower -ne 'exe') {
Write-Warning "FileType '$fileType' is unrecognized, using 'exe' instead."
$fileType = 'exe'
}

if ($fileType -like 'msi') {
$msiArgs = "/x"
Expand Down

0 comments on commit ab07573

Please sign in to comment.