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

(gh-568) Manual update for the kindlepreviewer package #570

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions automatic/kindlepreviewer/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# [<img src="https://cdn.jsdelivr.net/gh/dgalbraith/chocolatey-packages@53619ae4c9b43750b7f5801f620a5c94155a641d/icons/kindlepreviewer.png" width="48" height="48" />Kindle Previewer](https://chocolatey.org/packages/kindlepreviewer)

[![Software license](https://img.shields.io/badge/license-Proprietary-lightgrey)](https://www.amazon.com/gp/feature.html?docId=1000599251)
[![Software license](https://img.shields.io/badge/license-Proprietary-lightgrey)](https://www.amazon.com/b?node=23972708011)
[![Maintenance status](https://img.shields.io/badge/maintained%3F-yes-green.svg)](https://gitHub.com/dgalbraith/chocolatey-packages/graphs/commit-activity)
[![AppVeyor build](https://img.shields.io/appveyor/ci/dgalbraith/chocolatey-packages)](https://ci.appveyor.com/project/dgalbraith/chocolatey-packages)
[![Software version](https://img.shields.io/badge/source-v3.52-blue.svg)](https://www.amazon.com/gp/feature.html?docId=1000765261)
[![Software version](https://img.shields.io/badge/source-v3.82.0-blue.svg)](https://www.amazon.com/gp/feature.html?docId=1000765261)
[![Chocolatey package version](https://img.shields.io/chocolatey/v/kindlepreviewer?label=Chocolatey)](https://chocolatey.org/packages/kindlepreviewer)

Kindle Previewer is a graphical user interface tool that emulates how books display across Kindle devices and apps. Kindle Previewer makes it easy for publishers to preview the layout of a book and make sure its text displays properly for any orientation or font size to ensure publishers produce and submit the highest quality Kindle books.
Expand Down
10 changes: 5 additions & 5 deletions automatic/kindlepreviewer/kindlepreviewer.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>kindlepreviewer</id>
<version>3.52</version>
<version>3.82.0</version>
<packageSourceUrl>https://github.com/dgalbraith/chocolatey-packages/tree/master/automatic/kindlepreviewer</packageSourceUrl>
<owners>dgalbraith</owners>
<title>Kindle Previewer</title>
<authors>Amazon</authors>
<projectUrl>http://www.amazon.com/gp/feature.html?docId=1000765261</projectUrl>
<projectUrl>https://www.amazon.com/Kindle-Previewer/b?node=21381691011</projectUrl>
<iconUrl>https://cdn.jsdelivr.net/gh/dgalbraith/chocolatey-packages@53619ae4c9b43750b7f5801f620a5c94155a641d/icons/kindlepreviewer.png</iconUrl>
<copyright>Copyright Amazon.com 2020</copyright>
<licenseUrl>https://www.amazon.com/gp/feature.html?docId=1000599251</licenseUrl>
<copyright>Copyright Amazon.com 2024</copyright>
<licenseUrl>https://www.amazon.com/b?node=23972708011</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<docsUrl>http://kindlepreviewer3.s3.amazonaws.com/UserGuide320_EN.pdf</docsUrl>
<docsUrl>https://kindlepreviewer3.s3.amazonaws.com/UserGuide320_EN.pdf</docsUrl>
<mailingListUrl>https://www.amazonforum.com/s/global-search/previewer</mailingListUrl>
<tags>kindlepreview kindlepreviewer kindle amazon</tags>
<summary>A graphical user interface tool that emulates how books display across Kindle devices and apps</summary>
Expand Down
14 changes: 7 additions & 7 deletions automatic/kindlepreviewer/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
$ErrorActionPreference = 'Stop';

$packageArgs = @{
packageName = $env:ChocolateyPackageName
fileType = 'exe'
url = 'https://d2bzeorukaqrvt.cloudfront.net/KindlePreviewerInstaller.exe'
checksum = '83b882d47916c9d7b2deaf437eed738bcc52bc3ba8c7e53227eedf9668e46858'
checksumType = 'sha256'
silentArgs = '/S'
validExitCodes= @(0)
packageName = $env:ChocolateyPackageName
fileType = 'exe'
url64 = 'https://d2bzeorukaqrvt.cloudfront.net/KindlePreviewerInstaller.exe'
checksum64 = '6587236442c35180b8e9eb698a65b9d61406351f30e19b004749ddaa64eb01e1'
checksumType64 = 'sha256'
silentArgs = '/S'
validExitCodes = @(0)
}

Install-ChocolateyPackage @packageArgs
27 changes: 14 additions & 13 deletions automatic/kindlepreviewer/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,39 @@

$ErrorActionPreference = 'STOP'

$releases = 'https://www.amazon.com/gp/feature.html?docId=1000765261'
$releases = 'https://www.amazon.com/Kindle-Previewer/b?node=21381691011'
$download = 'https://d2bzeorukaqrvt.cloudfront.net/KindlePreviewerInstaller.exe'

$re64 = '(?<Url>(https://s.+exe))'
$reVersion = '(>K|-v).*?(?<Version>(\d\.\d+))'
$reChecksum = "(?<=checksum64\s*=\s*')(?<Checksum>[^']+)"
$reVersion = '(?<=v).*?(?<Version>(\d+\.\d+\.\d+))'

function global:au_BeforeUpdate {
$Latest.Checksum64 = Get-RemoteChecksum $download
}

function global:au_SearchReplace {
@{
".\README.md" = @{
"$($reVersion)" = "`${1}$($Latest.Version)"
"$($reVersion)" = "$($Latest.Version)"
}

".\tools\chocolateyinstall.ps1" = @{
"(url\s*=\s*)('.*')" = "`$1'$($Latest.Url64)'"
"(checksum\s*=\s*)('.*')" = "`$1'$(Get-RemoteChecksum $Latest.Url64)'"
".\tools\chocolateyInstall.ps1" = @{
"$($reChecksum)" = "$($Latest.Checksum64)"
}
}
}

function global:au_GetLatest {
$downloadPage = Invoke-WebRequest -UseBasicParsing -Uri $releases -MaximumRedirection 0 -ErrorAction SilentlyContinue

$downloadPage.Content -match $re64
$url64 = $Matches.Url
$downloadPage = Invoke-WebRequest -UseBasicParsing -Uri $releases

$downloadPage.Content -match $reVersion
$version = $Matches.Version

return @{
URL64 = $url64
URL64 = $download
ChecksumType64 = 'sha256'
Version = $version
}
}

update -ChecksumFor none -NoReadme
update -ChecksumFor none -NoReadme -NoCheckUrl -NoCheckChocoVersion