Skip to content

Commit

Permalink
Add Chocolatey package (Issue #143)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Aug 24, 2019
1 parent 5542328 commit efdb340
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
34 changes: 34 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@
<property name="app.path" value="${project.basedir}\app"/>
<property name="build.path" value="${bin.path}\build"/>
<property name="release.path" value="${bin.path}\release"/>
<property name="choco.path" value="${bin.path}\choco"/>
<property name="lib.path" value="${bin.path}\lib"/>
<property name="tmp.path" value="${bin.path}\tmp"/>
<property name="upx" value="${lib.path}\upx\upx.exe"/>
<property name="ldflags" value="-s -w"/>

<!-- Combined path -->
<path id="combined-path">
<pathelement path="${env.PATH}"/>
<pathelement path="${env.Path}"/>
</path>
<property name="PATH" refid="combined-path"/>

<!-- Macros -->
<macrodef name="assertdir">
<attribute name="dir"/>
Expand Down Expand Up @@ -58,6 +66,32 @@
<target name="release" depends="init, load.lib, infos, downmod, generate, build" description="Release">
<echo message="Creating release..."/>
<copy file="${tmp.path}\${app.id}.exe" todir="${release.path}" overwrite="true"/>

<echo message="Creating Chocolatey package..."/>
<fail message="Choco not found in PATH">
<condition><not><available file="choco.exe" filepath="${PATH}"/></not></condition>
</fail>
<delete dir="${choco.path}"/>
<mkdir dir="${choco.path}\legal"/>
<copy todir="${choco.path}">
<fileset dir="${project.basedir}\chocolatey" defaultexcludes="no"/>
</copy>
<copy file="${release.path}\${app.id}.exe" todir="${choco.path}\tools" overwrite="true"/>
<copy file="${project.basedir}\LICENSE" tofile="${choco.path}\legal\LICENSE.txt" overwrite="true"/>
<copy file="${project.basedir}\chocolatey\windowsspyblocker.nuspec" todir="${choco.path}" overwrite="true">
<filterset refid="filterset.app"/>
</copy>
<exec executable="choco" failonerror="true" dir="${choco.path}">
<arg value="pack"/>
<arg value="--out"/>
<arg value="${release.path}"/>
<arg value="--version"/>
<arg value="${app.version}"/>
<arg value="--acceptlicense"/>
<arg value="--yes"/>
</exec>
<delete dir="${release.path}\\windowsspyblocker.${app.version}"/>
<assertfile file="${release.path}\windowsspyblocker.${app.version}.nupkg"/>
</target>

<target name="setup" depends="init, load.lib, downmod, generate" description="Setup workspace"/>
Expand Down
6 changes: 6 additions & 0 deletions chocolatey/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$toolsDir = Split-Path $MyInvocation.MyCommand.Definition
$desktopPath = [Environment]::GetFolderPath("Desktop")
$lnkPath = $desktopPath + "\WindowsSpyBlocker.lnk"
$exePath = Join-Path $toolsDir "WindowsSpyBlocker.exe"

Install-ChocolateyShortcut -shortcutFilePath $lnkPath -targetPath $exePath
43 changes: 43 additions & 0 deletions chocolatey/windowsspyblocker.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?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">
<metadata>
<!-- Read this before publishing packages to chocolatey.org: https://github.com/chocolatey/chocolatey/wiki/CreatePackages -->
<id>windowsspyblocker</id>
<title>WindowsSpyBlocker</title>
<version>@APP_VERSION@</version>
<authors>CrazyMax</authors>
<owners>CrazyMax</owners>
<summary>Block spying and tracking on Windows</summary>
<description><![CDATA[WindowsSpyBlocker 🛡 is an application written in Go and delivered as a single executable to block spying and tracking on Windows systems ⛔.
The approach of this project is to capture and interpret network traffic 🚦 based on a set of tools. Depending on the interactions ⛓ between services and source or destination of traffic, rules are created and sorted by assignment.
![](https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/.res/wsb-main-window.png)
All kinds of contributions are welcome 🙌! The most basic way to show your support is to star :star2: the project, or to raise issues 💬. But we're not gonna lie to each other, I'd rather you buy me a beer or two 🍻!
[![Support me on Patreon](https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/.res/patreon.png)](https://www.patreon.com/crazymax)
[![Paypal](https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/.res/paypal-donate.png)](https://www.paypal.me/crazyws)
]]></description>
<projectUrl>https://github.com/crazy-max/WindowsSpyBlocker</projectUrl>
<tags>windows security antispy foss</tags>
<copyright></copyright>
<licenseUrl>https://github.com/crazy-max/WindowsSpyBlocker/blob/master/LICENSE</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/.res/logo.png</iconUrl>
<dependencies>
<dependency id="chocolatey-core.extension" version="1.2" />
</dependencies>
<releaseNotes>https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/CHANGELOG.md</releaseNotes>
<docsUrl>https://github.com/crazy-max/WindowsSpyBlocker/wiki</docsUrl>
<bugTrackerUrl>https://github.com/crazy-max/WindowsSpyBlocker/issues</bugTrackerUrl>
<projectSourceUrl>https://github.com/crazy-max/WindowsSpyBlocker</projectSourceUrl>
<packageSourceUrl>https://github.com/crazy-max/WindowsSpyBlocker/blob/master/chocolatey</packageSourceUrl>
</metadata>
<files>
<file src="tools\**" target="tools" />
<file src="legal\**" target="legal" />
</files>
</package>

0 comments on commit efdb340

Please sign in to comment.