Skip to content

Commit

Permalink
Added Chocolatey packaging. [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakritzator committed Nov 14, 2015
1 parent eac3276 commit 1b90c2a
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions Build/build_success.ps1
@@ -0,0 +1,54 @@
################################################################
# Greenshot cholocatey script, written for the Windows Power Shell
# Assumes the installation of Microsoft .NET Framework 4.5
################################################################
# Greenshot - a free and open source screenshot tool
# Copyright (C) 2007-2015 Thomas Braun, Jens Klingen, Robin Krom
#
# For more information see: http://getgreenshot.org/
# The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 1 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
################################################################

$builddir = "$(get-location)\Build"

# This function builds & uploads the chocolatey package
Function ChocolateyPackage {
pushd "$builddir\chocolatey"
Try
{
Write-Host "Generating chocolatey package"
choco pack
Write-Host "Set chocolatey key"
choco apiKey -k $env:choco_api_key -source https://chocolatey.org/
Write-Host "Pushing chocolatey package"
Get-ChildItem -Recurse -Include *.nupkg | foreach {
choco push $_.fullname
}
}
Catch [system.exception]
{
#error logging
}
Finally
{
popd
}
}

if ($env:build_type -eq "RELEASE") {
Write-Host "Building & uploading chocolatey package"
ChocolateyPackage
}
26 changes: 26 additions & 0 deletions Build/chocolatey/greenshot/greenshot.nuspec
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>greenshot</id>
<title>Greenshot</title>
<version>1.2.8.12</version>
<authors>Greenshot</authors>
<owners>devious</owners>
<summary>Greenshot is a light-weight screenshot software tool for Windows.</summary>
<description>Greenshot is a light-weight screenshot software tool for Windows with the following key features:
Quickly create screenshots of a selected region, window or fullscreen; you can even capture complete (scrolling) web pages from Internet Explorer.
Easily annotate, highlight or obfuscate parts of the screenshot.
Export the screenshot in various ways: save to file, send to printer, copy to clipboard, attach to e-mail, send Office programs or upload to photo sites like Flickr or Picasa, and others.
...and a lot more options simplyfying creation of and work with screenshots every day.

Being easy to understand and configurable, Greenshot is an efficient tool for project managers, software developers, technical writers, testers and anyone else creating screenshots.</description>
<projectUrl>http://getgreenshot.org/</projectUrl>
<tags>greenshot screenshot screen capture notsilent</tags>
<licenseUrl>http://www.gnu.org/licenses/gpl.html</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>http://upload.wikimedia.org/wikipedia/commons/9/95/GreenshotLogo.png</iconUrl>
<!--<dependencies>
<dependency id="" version="" />
</dependencies>-->
</metadata>
</package>
2 changes: 2 additions & 0 deletions Build/chocolatey/greenshot/tools/chocolateyInstall.ps1
@@ -0,0 +1,2 @@
if (Get-Process 'Greenshot' -ea SilentlyContinue) {Stop-Process -processname Greenshot}
Install-ChocolateyPackage 'greenshot' 'EXE' '/VERYSILENT' 'https://github.com/greenshot/greenshot/releases/download/Greenshot-RELEASE-1.2.8.12/Greenshot-INSTALLER-1.2.8.12-RELEASE.exe'
12 changes: 12 additions & 0 deletions Build/chocolatey/greenshot/tools/chocolateyuninstall.ps1
@@ -0,0 +1,12 @@
$packageName = "Greenshot"
$installerType = "exe"


# Uninstall $packageName if older version is installed
if (Test-Path "$env:ProgramFiles\$packageName") {
Uninstall-ChocolateyPackage $packageName $installerType "/VERYSILENT /NORESTART" "$env:ProgramFiles\$packageName\unins000.exe"
}

if (Test-Path "${env:ProgramFiles(x86)}\$packageName") {
Uninstall-ChocolateyPackage $packageName $installerType "/VERYSILENT /NORESTART" "${env:ProgramFiles(x86)}\$packageName\unins000.exe"
}
6 changes: 4 additions & 2 deletions appveyor13.yml
Expand Up @@ -40,12 +40,14 @@ environment:
build_type: ALPHA
before_build:
- nuget restore
- ps: Build/prebuild.ps1
- ps: Build/before_build.ps1
build:
project: greenshot.sln
verbosity: normal
after_build:
- ps: Build/build.ps1
- ps: Build/after_build.ps1
on_success:
- ps: Build/build_success.ps1
test: off
artifacts:
- path: AssemblyDir\Greenshot*INSTALLER*.exe
Expand Down

0 comments on commit 1b90c2a

Please sign in to comment.