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

(keyfinder) Migrated to AU + Embedded package #568

Merged
merged 8 commits into from Feb 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 30 additions & 12 deletions automatic/keyfinder/keyfinder.nuspec
@@ -1,27 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>{{PackageName}}</id>
<version>{{PackageVersion}}</version>
<title>The Magical Jelly Bean Keyfinder</title>
<id>keyfinder</id>
<version>2.0.10.10</version>
<packageSourceUrl>https://github.com/chocolatey/chocolatey-coreteampackages/tree/master/automatic/keyfinder</packageSourceUrl>
<owners>chocolatey</owners>
<title>The Magical Jelly Bean Keyfinder</title>
<authors>Magical Jelly Bean</authors>
<licenseUrl>http://www.magicaljellybean.com/tos/</licenseUrl>
<projectUrl>http://www.magicaljellybean.com/keyfinder/</projectUrl>
<iconUrl>https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/edba4a5849ff756e767cba86641bea97ff5721fe/icons/keyfinder.png</iconUrl>
<iconUrl>https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/4d1b2ee166754abb43796875684dbf5be79b2635/icons/keyfinder.png</iconUrl>
<copyright>© 2017 Magical Jelly Bean. All Rights Reserved</copyright>
<licenseUrl>http://www.magicaljellybean.com/tos/</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<docsUrl>https://www.magicaljellybean.com/keyfinder-faq/</docsUrl>
<tags>keyfinder product key license freeware</tags>
<summary>Retrieve product keys</summary>
<description>
The Magical Jelly Bean Keyfinder is a freeware utility that retrieves your Product Key (cd key) used to install windows from your registry. It also has a community-updated configuration file that retrieves product keys for many other applications. Another feature is the ability to retrieve product keys from unbootable Windows installations.

## Features
- 300+ Supported programs
- Scan another or non-bootable Windows
- Works with 64-bit systems
- Recover serials for Windows 7, 8 and Office 2010
- Save to: TXT, CSV
- Free

## Parameters
- `/DesktopIcon` - Create an icon on the Current Users Desktop
- `/QuickLaunchIcon` - Create an icon on the Current Users Quick Launch bar (only available for Windows 7)

These parameters can be passed to the installer with the use of `--params`.
For example: `--params '"/DesktopIcon /QuickLaunchIcon"'`
</description>
<summary>Retrieve product keys</summary>
<releaseNotes />
<copyright />
<language>en-US</language>
<tags>product key license</tags>
<packageSourceUrl>https://github.com/chocolatey/chocolatey-coreteampackages</packageSourceUrl>
<dependencies>
<dependency id="chocolatey-core.extension" version="1.0.6" />
</dependencies>
</metadata>
<files>
<file src="legal\**" target="legal" />
<file src="tools\**" target="tools" />
</files>
</package>
24 changes: 24 additions & 0 deletions automatic/keyfinder/legal/LICENSE.txt
@@ -0,0 +1,24 @@
Terms of use / EULA
This is the End User License Agreement (the "Agreement") is a legal agreement between you, the end-user ("Licensee"), and Magical Jelly Bean, the manufacturer and the copyright owner ("Owner"), for the use of the "Magical Jelly Bean Keyfinder" software product ("Software").

By using this Software or storing this program on a computer drive (or other media), you are agreeing to be bound by the terms of this Agreement. If you do not agree with the terms of this Agreement, please remove this Software from your system.
RIGHTS
The Software is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. Software is licensed, not sold. Software is free to use and includes no technical support. The origin of this Software must not be misrepresented.

COPYRIGHT
All title, including but not limited to copyrights, in and to the Software and any copies thereof are owned by Owner or its suppliers. All title and intellectual property rights in and to the content which may be accessed through use of the Software is the property of the respective content owner and may be protected by applicable copyright or other intellectual property laws and treaties. This Agreement grants you no rights to use such content. All rights not expressly granted are reserved by Owner.

DISTRIBUTION
This Software may be distributed freely through on-line services, bulletin boards, or other forms of electronic media, as long as the files are distributed in their entirety. Computer Magazines/Archives are authorized to distribute Software on any Cover Disk or CD-ROM without an individual permission.

RESTRICTIONS
You may not alter this Software in any way, including changing or removing any messages or windows. You may not decompile, reverse engineer, disassemble or otherwise reduce this Software to a human perceivable form. You may not modify, rent or resell this Software for profit, or create any derivative works, based upon this Software.

DISCLAIMER
This Software is provided on an "as is" basis without warranty of any kind, expressed or implied, including but not limited to the implied warranties of merchantability and suitability for a particular purpose. The person using the Software bears all risk as to the quality and performance of the Software. Owner will not be liable for any special, incidental, consequential, indirect or similar damages due to loss of data or any other reason, even if Owner or an agent of Owner has been advised of the possibility of such damages. In no event will Owner be liable for costs of any damages. You acknowledge that you have read this license, understood it, and agreed to be bound by its terms.

3RD-PARTY SOFTWARE
OPENCANDY END USER LICENSE AGREEMENT
January 26, 2010

This installer uses the OpenCandy network to recommend other software you may find valuable during the installation of this software. OpenCandy collects *NON-personally identifiable* information about this installation and the recommendation process. Collection of this information ONLY occurs during this installation and the recommendation process; in accordance with OpenCandy's Privacy Policy, available at www.opencandy.com/privacy-policy
18 changes: 18 additions & 0 deletions automatic/keyfinder/legal/VERIFICATION.txt
@@ -0,0 +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 have been downloaded from the listed download
location on <https://www.magicaljellybean.com/keyfinder/>
and can be verified by doing the following:

1. Download the following <https://www.magicaljellybean.com/downloads/KeyFinderInstaller.exe>
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: A1E6F8195B1A486333665190212436EADA276741A264B2F0759EB1E7EEA0DCEE

The file 'LICENSE.txt' has been obtained from <https://www.magicaljellybean.com/tos/>
36 changes: 20 additions & 16 deletions automatic/keyfinder/tools/chocolateyInstall.ps1
@@ -1,22 +1,26 @@
$url = '{{DownloadUrl}}'
$scriptPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$exeFile = "keyfinder.exe"
$exeFileLink = "Keyfinder.lnk"
$exePath = Join-Path "$scriptPath" "$exeFile"
if (Test-Path "$exePath") {Remove-Item "$exePath"}
Install-ChocolateyZipPackage '{{PackageName}}' $url "$scriptPath"
$ErrorActionPreference = 'Stop';

Install-ChocolateyDesktopLink "$exePath"
$toolsPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
. "$toolsPath\helpers.ps1"

$desktop = [Environment]::GetFolderPath("Desktop")
$pp = Get-PackageParameters
$filePath = "$toolsPath\KeyFinderInstaller_x32.exe"
$packageArgs = @{
packageName = 'keyfinder'
fileType = 'exe'
file = $filePath
softwareName = 'Magical Jelly Bean KeyFinder'
silentArgs = '/SILENT' + (Get-InstallTasks $pp)
validExitCodes = @(0)
}

if (Test-Path "$desktop\$exeFileLink") {Remove-Item "$desktop\$exeFileLink"}
Install-ChocolateyInstallPackage @packageArgs

Rename-Item "$desktop\$exeFile.lnk" "$exeFileLink"
Remove-Item -Force -ea 0 $filePath,"$filePath.ignore"

$installDirectory = Get-AppInstallLocation $packageArgs.softwareName

$startMenu = $([System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::StartMenu))

if (Test-Path "$startMenu\Programs\$exeFileLink") {Remove-Item "$startMenu\Programs\$exeFileLink"}

Copy-Item "$desktop\$exeFileLink" "$startMenu\Programs\$exeFileLink"
if ($installDirectory) {
Install-BinFile -Name "keyfinder" -Path "$installDirectory\keyfinder.exe" -UseStart
Register-Application -ExePath "$installDirectory\keyfinder.exe" -Name "keyfinder"
}
44 changes: 39 additions & 5 deletions automatic/keyfinder/tools/chocolateyUninstall.ps1
@@ -1,6 +1,40 @@
$exeFileLink = "Keyfinder.lnk"
$desktop = [Environment]::GetFolderPath("Desktop")
if (Test-Path "$desktop\$exeFileLink") {Remove-Item "$desktop\$exeFileLink"}
$ErrorActionPreference = 'Stop';

$startMenu = $([System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::StartMenu))
if (Test-Path "$startMenu\Programs\$exeFileLink") {Remove-Item "$startMenu\Programs\$exeFileLink"}
$packageName = 'keyfinder'

$uninstalled = $false

[array]$key = Get-UninstallRegistryKey -SoftwareName 'Magical Jelly Bean KeyFinder'

if ($key.Count -eq 1) {
$key | % {
$packageArgs = @{
packageName = $packageName
fileType = 'exe'
silentArgs = '/SILENT'
file = "$($_.UninstallString)"
}

Uninstall-ChocolateyPackage @packageArgs

Uninstall-BinFile -Name "keyfinder" -Path "$($_.InstallLocation)\keyfinder.exe"

$pathsToRemove = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\keyfinder.exe"
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\keyfinder.exe"
)

foreach ($path in $pathsToRemove) {
if (Test-Path $path) {
Remove-Item -Force -ea 0 $path
}
}
}
} elseif ($key.Count -eq 0) {
Write-Warning "$packageName has already been uninstalled by other means."
} elseif ($key.Count -gt 1) {
Write-Warning "$($key.Count) matches found!"
Write-Warning "To prevent accidental data loss, no programs will be uninstall."
Write-Warning "Please alert the package maintainer the following keys were matched:"
$key | % { Write-Warning "- $($_.DisplayName)" }
}
23 changes: 23 additions & 0 deletions automatic/keyfinder/tools/helpers.ps1
@@ -0,0 +1,23 @@
function Get-InstallTasks([HashTable]$pp) {
$parameters = @{
"DesktopIcon" = @{ Task = "!desktopicon"; Output = "Enabling Desktop Icon" }
"QuickLaunchIcon" = @{ Task = "!quicklaunchicon"; Output = "Enabling Quick Launch Icon" }
}

$tasks = @()

foreach ($param in $parameters.Keys) {
if ($pp[$param]) {
if ($parameters[$param].Task.StartsWith('!')) {
$parameters[$param].Task = $parameters[$param].Task.TrimStart('!')
} else {
$parameters[$param].Task = '!' + $parameters[$param].Task
}
Write-Host $parameters[$param].Output
}

$tasks += @($parameters[$param].Task)
}

' /TASKS="{0}"' -f ($tasks -join ',')
}
1 change: 0 additions & 1 deletion automatic/keyfinder/tools/keyfinder.exe.gui

This file was deleted.

47 changes: 47 additions & 0 deletions automatic/keyfinder/update.ps1
@@ -0,0 +1,47 @@
Import-Module AU

$domain = 'https://www.magicaljellybean.com'
$releases = "$domain/keyfinder/"
$softwareName = 'Magical Jelly Bean KeyFinder'

function global:au_BeforeUpdate {
Get-RemoteFiles -Purge
}

function global:au_SearchReplace {
@{
".\legal\VERIFICATION.txt" = @{
"(?i)(^\s*location on\:?\s*)\<.*\>" = "`${1}<$releases>"
"(?i)(\s*1\..+)\<.*\>" = "`${1}<$($Latest.URL32)>"
"(?i)(^\s*checksum\s*type\:).*" = "`${1} $($Latest.ChecksumType32)"
"(?i)(^\s*checksum(32)?\:).*" = "`${1} $($Latest.Checksum32)"
}
".\tools\chocolateyInstall.ps1" = @{
"(?i)(^\s*packageName\s*=\s*)'.*'" = "`${1}'$($Latest.PackageName)'"
"(?i)^(\s*softwareName\s*=\s*)'.*'" = "`${1}'$softwareName'"
"(?i)(^[$]filePath\s*=\s*`"[$]toolsPath\\)[^`"]*`""= "`${1}$($Latest.FileName32)`""
}
".\tools\chocolateyUninstall.ps1" = @{
"(?i)(^[$]packageName\s*=\s*)'.*'" = "`${1}'$($Latest.PackageName)'"
"(?i)(\-SoftwareName\s+)'.*'" = "`${1}'$softwareName'"
}
}
}
function global:au_GetLatest {
$download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing

$re = 'KeyFinderInstaller\.exe$'
$url32 = $download_page.Links | ? href -match $re | select -first 1 -expand href
if ($url32) { $url32 = $domain + $url32 }

$Matches = $null
$download_page.Content -match "Installer\s*v([\d\.]+)" | Out-Null
$version32 = $Matches[1]

@{
URL32 = $url32
Version = $version32
}
}

update -ChecksumFor none
Binary file modified icons/keyfinder.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 0 additions & 52 deletions ketarin/keyfinder.ketarin.xml

This file was deleted.