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

(7zip*) migrated from ferventcoder #488

Merged
merged 21 commits into from
Jan 18, 2017
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
dbedb56
(7zip*) original ferventcoder data
majkinetor Dec 21, 2016
a271934
(7zip) Removed ketarin file
AdmiringWorm Jan 14, 2017
1174267
(7zip) Added AU update script
AdmiringWorm Jan 14, 2017
b8d3e2b
(7zip) Updated metadata
AdmiringWorm Jan 14, 2017
c633732
(7zip.install) Updated metadata
AdmiringWorm Jan 14, 2017
fe4c5a4
(7zip.install) Updated install script and embedded installer
AdmiringWorm Jan 14, 2017
e66c143
(7zip.install) Added AU update script
AdmiringWorm Jan 14, 2017
798cb01
(7zip) Added uninstall script
AdmiringWorm Jan 14, 2017
bb5fd6c
(7zip.install) Added legal notes
AdmiringWorm Jan 14, 2017
7940972
(7zip.commandline) Updated metadata
AdmiringWorm Jan 14, 2017
17e2b62
(7zip.commandline) Added legal notes
AdmiringWorm Jan 14, 2017
27c7455
(7zip.commandline) Embedded package
AdmiringWorm Jan 14, 2017
6621cc0
(7zip.commandline) Added AU update script
AdmiringWorm Jan 14, 2017
b982905
(7zip*) Added release notes + reordered owners
AdmiringWorm Jan 14, 2017
bc5193d
(7zip*) Changed Remove-Item to be the same as other packages
AdmiringWorm Jan 14, 2017
a2643d7
(7zip.install) Extracted function to helpers.ps1
AdmiringWorm Jan 14, 2017
eec0f5a
(7zip.commandline) Moved variable to outside of try/catch block
AdmiringWorm Jan 14, 2017
c6a31e9
(7zip.commandline) Renamed to 7zip.portable
AdmiringWorm Jan 14, 2017
85b0a46
(7zip.commandline) Added as a deprecated package
AdmiringWorm Jan 14, 2017
90407d0
(7zip.install) Changed to not pass version as softwareName
AdmiringWorm Jan 18, 2017
ada3ad4
(7zip.commandline) Added space between Deprecated] and 7-Zip
AdmiringWorm Jan 18, 2017
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
49 changes: 49 additions & 0 deletions automatic/7zip.install/7zip.install.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata>
<id>7zip.install</id>
<title>7-Zip (Install)</title>
<version>0.0</version>
<authors>Igor Pavlov</authors>
<owners>chocolatey,Rob Reynolds</owners>
<summary>7-Zip is a file archiver with a high compression ratio.</summary>
<description>7-Zip is a file archiver with a high compression ratio.

## Features
- High compression ratio in [7z format](http://www.7-zip.org/7z.html) with **LZMA** and **LZMA2** compression
- Supported formats:
- Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM
- Unpacking only: AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR and Z.
- For ZIP and GZIP formats, **7-Zip** provides a compression ratio that is 2-10 % better than the ratio provided by PKZip and WinZip
- Strong AES-256 encryption in 7z and ZIP formats
- Self-extracting capability for 7z format
- Integration with Windows Shell
- Powerful File Manager
- Powerful command line version
- Plugin for FAR Manager
- Localizations for 87 languages

## Notes
- The installer for 7-Zip is known to close the explorer process.
This means you may lose current work. If it doesn't automatically restart explorer, type `explorer` on the command shell to restart it.
</description>
<projectUrl>http://www.7-zip.org/</projectUrl>
<packageSourceUrl>https://github.com/chocolatey/chocolatey-coreteampackages/tree/master/automatic/7zip</packageSourceUrl>
<tags>7zip zip archiver admin foss</tags>
<licenseUrl>http://www.7-zip.org/license.txt</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/dbedb56d5ff709cd37f4abecc736d4a9e6400da8/icons/7zip.svg</iconUrl>
<docsUrl>http://www.7-zip.org/faq.html</docsUrl>
<mailingListUrl>https://sourceforge.net/p/sevenzip/discussion/45797/</mailingListUrl>
<bugTrackerUrl>https://sourceforge.net/p/sevenzip/_list/tickets?source=navbar</bugTrackerUrl>
<releaseNotes>http://www.7-zip.org/history.txt</releaseNotes>
<dependencies>
<dependency id="chocolatey-core.extension" version="1.0.4" />
</dependencies>
</metadata>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add <releaseNotes> (http://www.7-zip.org/history.txt)

<files>
<file src="tools\**" target="tools" />
<file src="legal\**" target="legal" />
</files>
</package>
<!-- character encoding: “UTF-8” -->
56 changes: 56 additions & 0 deletions automatic/7zip.install/legal/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
7-Zip
~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

7-Zip Copyright (C) 1999-2016 Igor Pavlov.

Licenses for files are:

1) 7z.dll: GNU LGPL + unRAR restriction
2) All other files: GNU LGPL

The GNU LGPL + unRAR restriction means that you must follow both
GNU LGPL rules and unRAR restriction rules.


Note:
You can use 7-Zip on any computer, including a computer in a commercial
organization. You don't need to register or pay for 7-Zip.


GNU LGPL information
--------------------

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You can receive a copy of the GNU Lesser General Public License from
http://www.gnu.org/


unRAR restriction
-----------------

The decompression engine for RAR archives was developed using source
code of unRAR program.
All copyrights to original unRAR code are owned by Alexander Roshal.

The license for original unRAR code has the following restriction:

The unRAR sources cannot be used to re-create the RAR compression algorithm,
which is proprietary. Distribution of modified unRAR sources in separate form
or as a part of other software is permitted, provided that it is clearly
stated in the documentation and source comments that the code may
not be used to develop a RAR (WinRAR) compatible archiver.


--
Igor Pavlov
19 changes: 19 additions & 0 deletions automatic/7zip.install/legal/VERIFICATION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
VERIFICATION
Verification is intended to assist the Chocolatey moderators and community
in verifying that this package's contents are trustworthy.

The installer have been downloaded from their official download link listed on <http://www.7-zip.org/download.html>
and can be verified like this:

1. Download the following installers:
32-Bit: <http://www.7-zip.org/a/7z1604.exe>
64-Bit: <http://www.7-zip.org/a/7z1604-x64.exe>
2. You can use one of the following methods to obtain the checksum
- Use powershell function 'Get-Filehash'
- Use chocolatey utility 'checksum.exe'

checksum type: sha256
checksum32: DBB2B11DEA9F4432291E2CBEFE14EBE05E021940E983A37E113600EEE55DAA95
checksum64: 9BB4DC4FAB2A2A45C15723C259DC2F7313C89A5AC55AB7C3F76BBA26EDC8BCAA

File 'LICENSE.txt' is obtained from <http://www.7-zip.org/license.txt>
37 changes: 37 additions & 0 deletions automatic/7zip.install/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
$ErrorActionPreference = 'Stop'

$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
. "$toolsDir\helpers.ps1"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add $ErrorActionPreference = 'Stop'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was sure I had it added, but will fix that one too.

$initialProcessCount = Get-ExplorerProcessCount
Write-Warning "This installer is known to close the explorer process. This means `nyou may lose current work. `nIf it doesn't automatically restart explorer, type 'explorer' on the `ncommand shell to restart it."

$filePath32 = "$toolsDir\7zip_x32.exe"
$filePath64 = "$toolsDir\7zip_x64.exe"

$filePath = if ((Get-ProcessorBits 64) -and $env:chocolateyForceX86 -ne $true) {
Write-Host "Installing 64 bit version" ; $filePath64
} else { Write-Host "Installing 32 bit version" ; $filePath32 }

$packageArgs = @{
packageName = '7zip.install'
fileType = 'exe'
softwareName = '7-zip 16.04*'
file = "$filePath"
silentArgs = '/S'
validExitCodes = @(0)
}

# To prevent shimming of installers
"" | Out-File "$filePath32.ignore"
"" | Out-File "$filePath64.ignore"

Install-ChocolateyInstallPackage @packageArgs

$finalProcessCount = Get-ExplorerProcessCount
if($initialProcessCount -lt $finalProcessCount)
{
Start-Process explorer.exe
}

Remove-Item "$filePath32*","$filePath64*" -Force -ea 0
27 changes: 27 additions & 0 deletions automatic/7zip.install/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
$ErrorActionPreference = 'Stop';

$packageName = '7zip.install'

$uninstalled = $false
[array]$key = Get-UninstallRegistryKey -SoftwareName '7-zip 16.04*'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never a fan of passing the version. It doesn't upgrade well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally my reason for passing the version was to allow users to install multiple 7zip versions side-by-side, but noticed now that it doesn't matter since the registry key is overwritten anyhow.
I'll change it back to not pass the version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version 9.x and 15/16.x can be installed separately.


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

Uninstall-ChocolateyPackage @packageArgs
}
} 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 uninstalled."
Write-Warning "Please alert package maintainer the following keys were matched:"
$key | % {Write-Warning "- $($_.DisplayName)"}
}
6 changes: 6 additions & 0 deletions automatic/7zip.install/tools/helpers.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Function Get-ExplorerProcessCount
{
$process = Get-Process explorer -ErrorAction SilentlyContinue
$processCount = ($process | Measure-Object).Count
return $processCount
}
29 changes: 29 additions & 0 deletions automatic/7zip.install/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
. "$PSScriptRoot\..\7zip\update.ps1"

$softwareNamePrefix = '7-zip'

function global:au_BeforeUpdate {
Get-RemoteFiles -Purge -FileNameBase '7zip'
$Latest.ChecksumType = 'sha256'
}

function global:au_SearchReplace {
@{
".\tools\chocolateyInstall.ps1" = @{
"(?i)(^\s*softwareName\s*=\s*)'.*'" = "`$1'$softwareNamePrefix $($Latest.RemoteVersion)*'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO using $Latest.RemoteVersion is not 100% acurrate. It makes sense as long as the already installed version is the previous version, but what if I skip versions? But currently also don't have a better idea :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, in this case it will be accurate.
The software name should be part of or equal to the name displayed in program and features

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minus the version IMHO as well. If need be the major version.

}
".\tools\chocolateyUninstall.ps1" = @{
"(?i)(\s*\-SoftwareName\s+)'.*'" = "`$1'$softwareNamePrefix $($Latest.RemoteVersion)*'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be $Latest.Version here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, $Latest.Version will be changed if there is a fix version, which will make the uninstall script unusable since it won't be able to find the uninstall key

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the version here?

}
".\legal\verification.txt" = @{
"(?i)(listed on\s*)\<.*\>" = "`${1}<$releases>"
"(?i)(32-Bit.+)\<.*\>" = "`${1}<$($Latest.URL32)>"
"(?i)(64-Bit.+)\<.*\>" = "`${1}<$($Latest.URL64)>"
"(?i)(checksum type:).*" = "`${1} $($Latest.ChecksumType)"
"(?i)(checksum32:).*" = "`${1} $($Latest.Checksum32)"
"(?i)(checksum64:).*" = "`${1} $($Latest.Checksum64)"
}
}
}

update -ChecksumFor none
39 changes: 39 additions & 0 deletions automatic/7zip.portable/7zip.portable.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata>
<id>7zip.portable</id>
<title>7-Zip (Portable, CommandLine)</title>
<version>0.0</version>
<authors>Igor Pavlov</authors>
<owners>chocolatey,Rob Reynolds</owners>
<summary>7-Zip is a file archiver with a high compression ratio.</summary>
<description>7-Zip is a file archiver with a high compression ratio.

## Features
- High compression ratio in [7z format](http://www.7-zip.org/7z.html) with **LZMA** and **LZMA2** compression
- Supported formats:
- Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM
- Unpacking only: AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR and Z.
- For ZIP and GZIP formats, **7-Zip** provides a compression ratio that is 2-10 % better than the ratio provided by PKZip and WinZip
- Strong AES-256 encryption in 7z and ZIP formats
- Self-extracting capability for 7z format
- Powerful command line version
- Localizations for 87 languages
</description>
<projectUrl>http://www.7-zip.org/</projectUrl>
<packageSourceUrl>https://github.com/chocolatey/chocolatey-coreteampackages/tree/master/automatic/7zip</packageSourceUrl>
<tags>7zip zip archiver foss</tags>
<licenseUrl>http://www.7-zip.org/license.txt</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/dbedb56d5ff709cd37f4abecc736d4a9e6400da8/icons/7zip.svg</iconUrl>
<docsUrl>http://www.7-zip.org/faq.html</docsUrl>
<mailingListUrl>https://sourceforge.net/p/sevenzip/discussion/45797/</mailingListUrl>
<bugTrackerUrl>https://sourceforge.net/p/sevenzip/_list/tickets?source=navbar</bugTrackerUrl>
<releaseNotes>http://www.7-zip.org/history.txt</releaseNotes>
</metadata>
<files>
<file src="tools\**" target="tools" />
<file src="legal\**" target="legal" />
</files>
</package>
<!-- character encoding: “UTF-8” -->
56 changes: 56 additions & 0 deletions automatic/7zip.portable/legal/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
7-Zip
~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

7-Zip Copyright (C) 1999-2016 Igor Pavlov.

Licenses for files are:

1) 7z.dll: GNU LGPL + unRAR restriction
2) All other files: GNU LGPL

The GNU LGPL + unRAR restriction means that you must follow both
GNU LGPL rules and unRAR restriction rules.


Note:
You can use 7-Zip on any computer, including a computer in a commercial
organization. You don't need to register or pay for 7-Zip.


GNU LGPL information
--------------------

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You can receive a copy of the GNU Lesser General Public License from
http://www.gnu.org/


unRAR restriction
-----------------

The decompression engine for RAR archives was developed using source
code of unRAR program.
All copyrights to original unRAR code are owned by Alexander Roshal.

The license for original unRAR code has the following restriction:

The unRAR sources cannot be used to re-create the RAR compression algorithm,
which is proprietary. Distribution of modified unRAR sources in separate form
or as a part of other software is permitted, provided that it is clearly
stated in the documentation and source comments that the code may
not be used to develop a RAR (WinRAR) compatible archiver.


--
Igor Pavlov
21 changes: 21 additions & 0 deletions automatic/7zip.portable/legal/VERIFICATION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
VERIFICATION
Verification is intended to assist the Chocolatey moderators and community
in verifying that this package's contents are trustworthy.

The installer have been downloaded from their official download link listed on <http://www.7-zip.org/download.html>
and can be verified like this:

1. Download the following installers:
32-Bit: <http://www.7-zip.org/a/7z1604.exe>
64-Bit: <http://www.7-zip.org/a/7z1604-x64.exe>
Extra : <http://www.7-zip.org/a/7z1604-extra.7z>
2. You can use one of the following methods to obtain the checksum
- Use powershell function 'Get-Filehash'
- Use chocolatey utility 'checksum.exe'

checksum type: sha256
checksum32 : DBB2B11DEA9F4432291E2CBEFE14EBE05E021940E983A37E113600EEE55DAA95
checksum64 : 9BB4DC4FAB2A2A45C15723C259DC2F7313C89A5AC55AB7C3F76BBA26EDC8BCAA
checksumExtra: 59F41025ACC40CF2E0B30B5CC6E4BCB1E07573201E256FBE8EDB3C9C514DD251

File 'LICENSE.txt' is obtained from <http://www.7-zip.org/license.txt>
33 changes: 33 additions & 0 deletions automatic/7zip.portable/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
$ErrorActionPreference = 'Stop'

$toolsDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition)

$filePath32 = "$toolsDir\7zip_x32.exe"
$filePath64 = "$toolsDir\7zip_x64.exe"
$filePathExtra = "$toolsDir\7zip_extra.7z"

$packageArgs = @{
packageName = '7zip.portable'
destination = "$toolsDir"
file = if ((Get-ProcessorBits 64) -and $env:chocolateyForceX86 -ne $true) {
Write-Host "Installing 64 bit version" ; $filePath64
} else {
Write-Host "Installing 32 bit version" ; $filePath32
}
}
Get-ChocolateyUnzip @packageArgs

$packageArgs.packageName = '7zip.portable Extras'
$packageArgs.destination = "$toolsDir\7z-extra"
$packageArgs.file = $filePathExtra
Get-ChocolateyUnzip @packageArgs

Remove-Item -Path "$toolsDir\Uninstall.exe",$filePath32,$filePath64,$filePathExtra -Force -ea 0

if ((Get-ProcessorBits 64) -and $env:chocolateyForceX86 -ne $true) {
#generate ignore for 7za.exe and let x64 version pick up and shim
New-Item "$($packageArgs.destination)\7za.exe.ignore" -Type file -Force | Out-Null
} else {
# generate ignore for x64\7za.exe
New-Item "$($packageArgs.destination)\x64\7za.exe.ignore" -Type file -Force | Out-Null
}
Loading