-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(tinymediamanager) Update to expected format
- Loading branch information
1 parent
d6bf3f5
commit 58f79b2
Showing
7 changed files
with
147 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,18 @@ | ||
VERIFICATION | ||
|
||
Verification is intended to assist the Chocolatey moderators and community | ||
in verifying that this package's contents are trustworthy. | ||
|
||
The embedded software has been downloaded from the listed download | ||
location on <http://release.tinymediamanager.org/> | ||
The embedded software have been downloaded from the listed download | ||
location on <yup> | ||
and can be verified by doing the following: | ||
|
||
1. Download the following: | ||
|
||
url: <https://release.tinymediamanager.org/v5/dist/tinyMediaManager-5.0.3-windows-amd64.zip> | ||
|
||
2. You can obtain the checksum using one of the following methods: | ||
- Use powershell function 'Get-FileHash' | ||
- Use Chocolatey utility 'checksum.exe' | ||
1. Download the following <yup> | ||
2. Get the checksum using one of the following methods: | ||
- Using powershell function 'Get-FileHash' | ||
- Use chocolatey utility 'checksum.exe' | ||
3. The checksums should match the following: | ||
|
||
checksum type: sha256 | ||
checksum: 2BC86688454FE57AF1FA66A5818EC69EE1ABCDCC8CE93C5DF357AD4475B1CE91 | ||
|
||
Using AU: | ||
|
||
Get-RemoteChecksum | ||
checksum: D40AC6EC29DE25163DCBAAD86958CD53A2FA46C52056F8E9C2DD3B45DF961AB1 | ||
|
||
The file 'LICENSE.txt' is obtained from: | ||
<https://gitlab.com/tinyMediaManager/tinyMediaManager/-/blob/devel/LICENSE> | ||
The file 'LICENSE.txt' has been obtained from <https://gitlab.com/tinyMediaManager/tinyMediaManager/-/blob/devel/LICENSE> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
. "$PSScriptRoot\..\..\scripts\Run-PesterTests.ps1" | ||
|
||
$packageName = Split-Path -Leaf $PSScriptRoot | ||
|
||
Run-PesterTests ` | ||
-packageName "$packageName" ` | ||
-packagePath "$PSScriptRoot" ` | ||
-expectedEmbeddedMatch "^tinyMediaManager-[\d\.]+-windows-amd64\.zip$" ` | ||
-expectedDefaultDirectory "C:\tools\tinyMediaManager" ` | ||
-expectedShimFiles "tinyMediaManagerCMD.exe" ` | ||
-customInstallChecks @( | ||
{ | ||
It "Should create tinyMediaManager Start Menu shortcut" { | ||
$startMenu = [System.Environment]::GetFolderPath('Programs') | ||
"$startMenu\tinyMediaManager.lnk" | Should -Exist | ||
} | ||
|
||
It "Should create tinyMediaManager desktop shortcut" { | ||
$desktop = [System.Environment]::GetFolderPath('Desktop') | ||
"$desktop\tinyMediaManager.lnk" | Should -Exist | ||
} | ||
} | ||
) ` | ||
-customUninstallChecks @( | ||
{ | ||
It "Should remove tinyMediaManager Start Menu shortcut" { | ||
$startMenu = [System.Environment]::GetFolderPath('Programs') | ||
"$startMenu\tinyMediaManager.lnk" | Should -Not -Exist | ||
} | ||
|
||
It "Should remove tinyMediaManager desktop shortcut" { | ||
$desktop = [System.Environment]::GetFolderPath('Desktop') | ||
"$desktop\tinyMediaManager.lnk" | Should -Not -Exist | ||
} | ||
} | ||
) ` | ||
-failsOn32bit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,42 @@ | ||
$ErrorActionPreference = 'Stop'; | ||
|
||
Write-Host "Cleaning up leftover from old packages" | ||
|
||
$linkName = 'tinyMediaManager.lnk' | ||
$publicDesktop = "${env:Public}\Desktop\$linkName" | ||
$publicStartMenu = "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\$linkName" | ||
|
||
if (Test-Path $publicDesktop) { | ||
Remove-Item $publicDesktop -EA 0 | ||
} | ||
|
||
if (Test-Path $publicStartMenu) { | ||
Remove-Item $publicStartMenu -EA 0 | ||
} | ||
|
||
$toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition | ||
$destination = Get-ToolsLocation | ||
|
||
$packageArgs = @{ | ||
packageName = '' | ||
fileType = '' | ||
softwareName = '' | ||
|
||
checksum = '' | ||
checksum64 = '' | ||
checksumType = '' | ||
checksumType64= '' | ||
url = '' | ||
url64bit = '' | ||
|
||
silentArgs = "/VERYSILENT" | ||
validExitCodes= @() | ||
packageName = $env:ChocolateyPackageName | ||
file64 = "$toolsDir\" | ||
SpecificFolder = 'tinyMediaManager' | ||
Destination = $destination | ||
} | ||
|
||
Install-ChocolateyPackage @packageArgs | ||
Get-ChocolateyUnzip @packageArgs | ||
|
||
$destination = "$destination\tinyMediaManager" | ||
$env:ChocolateyPackageInstallLocation = $destination | ||
|
||
$guiTarget = "$destination\tinyMediaManager.exe" | ||
$cmdTarget = "$destination\tinyMediaManagerCMD.exe" | ||
|
||
$startMenu = [System.Environment]::GetFolderPath('Programs') | ||
Install-ChocolateyShortcut -ShortcutFilePath "$startMenu\$linkName" -TargetPath "$guiTarget" | ||
$desktop = [System.Environment]::GetFolderPath('Desktop') | ||
Install-ChocolateyShortcut -ShortcutFilePath "$desktop\$linkName" -TargetPath $guiTarget | ||
|
||
Install-BinFile -Name "tinyMediaManagerCMD" -Path $cmdTarget | ||
|
||
Remove-Item $packageArgs.file64 -Force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,23 @@ | ||
$packageName = 'tinymediamanager' | ||
$shortcutName = 'tinyMediaManager.lnk' | ||
$ErrorActionPreference = 'Stop'; | ||
|
||
Remove-Item "$env:Public\Desktop\$shortcutName" -Force -ErrorAction 'SilentlyContinue' | ||
Remove-Item "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\$shortcutName" -Force -ErrorAction 'SilentlyContinue' | ||
Remove-Item -r "C:\Tools\tinyMediaManager*" -ea 0 -Force | ||
$startMenu = [System.Environment]::GetFolderPath("Programs") | ||
$desktop = [System.Environment]::GetFolderPath('Desktop') | ||
$linkName = "tinyMediaManager.lnk" | ||
|
||
Uninstall-BinFile tinyMediaManagerCMD | ||
|
||
if (Test-Path "$startMenu\$linkName") { | ||
Write-Host "Removing Start Menu Icon" | ||
Remove-Item "$startMenu\$linkName" | ||
} | ||
if (Test-Path "$desktop\$linkName") { | ||
Write-Host "Removing Desktop Icon" | ||
Remove-Item "$desktop\$linkName" | ||
} | ||
|
||
$installPath = "$(Get-ToolsLocation)\tinyMediaManager" | ||
|
||
if (Test-Path $installPath) { | ||
Write-Host "Removing installed files." | ||
Remove-Item $installPath -Recurse -Force | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,45 @@ | ||
import-module au | ||
|
||
$releases = '' | ||
$releases = 'https://release.tinymediamanager.org' | ||
|
||
function global:au_BeforeUpdate { | ||
Get-RemoteFiles -Purge -NoSuffix | ||
} | ||
|
||
function global:au_SearchReplace { | ||
@{ | ||
".\legal\VERIFICATION.txt" = @{ | ||
"(?i)(^\s*location on\:?\s*)\<.*>" = "`${1}<$releases>" | ||
"(?i)(\s*1\..+)\<.*\>" = "`${1}<$($Latest.URL64)>" | ||
"(?i)(^\s*checksum\s*type\:).*" = "`${1} $($Latest.ChecksumType64)" | ||
"(?i)(^\s*checksum(64)?\:).*" = "`${1} $($Latest.Checksum64)" | ||
} | ||
".\tools\chocolateyInstall.ps1" = @{ | ||
"(^[$]url32\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'" | ||
"(^[$]url64\s*=\s*)('.*')" = "`$1'$($Latest.URL64)'" | ||
"(^[$]checksum32\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'" | ||
"(^[$]checksum64\s*=\s*)('.*')" = "`$1'$($Latest.Checksum64)'" | ||
"(^[$]checksumType32\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType32)'" | ||
"(^[$]checksumType64\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType64)'" | ||
"(?i)(^\s*file64\s*=\s*`"[$]toolsDir\\).*" = "`${1}$($Latest.FileName64)`"" | ||
} | ||
} | ||
} | ||
|
||
function global:au_AfterUpdate($Package) { | ||
Update-Changelog -useIssueTitle | ||
Invoke-VirusTotalScan $Package | ||
} | ||
|
||
function global:au_GetLatest { | ||
$download_page = Invoke-WebRequest -Uri $releases | ||
|
||
$re = '' | ||
$url = $download_page.links | ? href -match $re | select -First 1 -expand href | ||
$re = 'windows.*.zip$' | ||
$url = $download_page.links | ? href -match $re | select -First 1 -expand href | ||
|
||
$version = $url -split '[-]' | select -Last 1 -Skip 2 | ||
|
||
$version = $url -split '[._-]|.exe' | select -Last 1 -Skip 2 | ||
$url = [uri]::new([uri]$releases, $url) | ||
|
||
return @{ URL32 = $url; Version = $version } | ||
return @{ | ||
URL64 = $url | ||
ChecksumType64 = 'sha256' | ||
Version = $version | ||
} | ||
} | ||
|
||
update | ||
update -ChecksumFor none |