Chocolatey Package Files

Josh edited this page Feb 16, 2016 · 1 revision

Installing the ChocolateyCoolWhip NuGet package will add several files related to packaging your application.

  • PrePackage.ps1
  • Tokens.json
  • package.nuspec

Quick Start

After installing the ChocolateyCoolWhip NuGet package, the only edit you need to make is to add a summary and description of your project to the package.nuspec file. Other than that you shouldn't need to change any of these files, but you may want to edit some values to match your project's needs. The most likely edits you'd want to make are:

  1. Add a summary and a description of your package in the package.nuspec file
  2. Change or delete any of the URLs in the package.nuspec file
  3. Change the value of the __PACKAGE_NAME__ token in the tokens.json file

PrePackaging

Before the build system creates your Chocolatey package it needs to update the scripts with the new version information as well as the new download URL for your binaries. It does this by running PrePackage.ps1 to replace tokens in the various packaging files. Most of the tokens are defined in the tokens.json file.

__VERSION__ is a special token. It is defined in PrePackage.ps1 to have the value of the APPVEYOR_REPO_TAG_NAME environment variable.

You can add or edit any of the tokens in the tokens.json file.

Tokens.json

[
  {
    "Name": "__PACKAGE_NAME__",
    "Value": "LogStitcher.portable",
    "Comment": "You only need to edit this if you want to use a name other than the default"
  },
  {
    "Name": "__PROJECT_BASE_URL__",
    "Value": "https://github.com/MasterDevs/LogStitcher",
    "Comment": "You don't need to edit this value"
  }
]

Nuspec

The package.nuspec is similar to NuGet's nuspec file. It defines the metadata for the package, including the package name, release notes, and copyright information. When installed ChocolateyCoolWhip attempts to guess the correct

<?xml version="1.0"?>
<package >
  <metadata>
    <id>LogStitcher.portable</id>
    <title>LogStitcher</title>
    <!-- Version is overwritten when the package is created -->
    <version>0.0.1</version>
    <authors>MasterDevs</authors>
    <owners>MasterDevs</owners>
    <summary>Enter Summary Here</summary>
    <description>Enter Description Here</description>
    <tags>Enter A List Of Tags Here</tags>
    <copyright>Copyright 2016</copyright>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <projectUrl>       https://github.com/MasterDevs/LogStitcher                     </projectUrl>
    <packageSourceUrl> https://github.com/MasterDevs/LogStitcher                     </packageSourceUrl>
    <docsUrl>          https://github.com/MasterDevs/LogStitcher                     </docsUrl>
    <projectSourceUrl> https://github.com/MasterDevs/LogStitcher                     </projectSourceUrl>
    <bugTrackerUrl>    https://github.com/MasterDevs/LogStitcher/issues              </bugTrackerUrl>
    <releaseNotes>     https://github.com/MasterDevs/LogStitcher/releases            </releaseNotes>
    <licenseUrl>       https://github.com/MasterDevs/LogStitcher/blob/master/LICENSE </licenseUrl>
<!-- Uncomment this line if you have an icon for your project
    <iconUrl>          https://github.com/MasterDevs/LogStitcher/icon.jpg            </iconUrl>
-->
  </metadata>
  <files>
    <file src="tools\**" target="tools" />
  </files>
</package>

Note that many of the *Url fields in the nuspec file are optional and can be left blank. We point them to logical GitHub defaults such as the issues page for the project. They can be changed or removed entirely to reflect your project.

The version field is set to a low value of 0.0.1. This value is not used and is overwritten by the build version passed in from AppVeyor at compile time.

What Should I Do?

The first thing you'll want to do is to update the summary, description and tags fields with relevant information about your project. This way when people find it on Chocolate.org, they'll know what it does and why they want to download it.

Testing Your Changes

To easily test your changes you can run the pack.bat script.

Prev | Up | Next

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.