Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating your own packages using Chocolatey

I am trying to create a package with Chocolatey for an application called Listary. I have followed the instructions on the Chocolatey wiki and also the article here.

I have also created an account on http://chocolatey.org and set up the API key using

nuget setApiKey -Source http://chocolatey.org/api/v2/

where &ltapiKey> is replaced with your API key.

When I entered the command choco pack to create the NuGet package, it said Successfully created package, but when I test the package that I just created using cinst Listary -source Listary.1.0.nupkg -force it says

Invalid URI: The format of the URI could not be determined.

Command 'install' failed (sometimes this indicates a partial failure). Additional info/packages: Listary

This is what I have in my Listary.nuspec file.

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
  <metadata>
    <id>Listary</id>
    <title>Listary</title>
    <version>1.0</version>
    <authors>Zhenheng Dai</authors>
    <owners>Zhenheng Dai</owners>
    <summary>Keep files at your fingertips. Listary is a unique search utility for Windows.</summary>
    <description>Listary is a unique search utility for Windows. Not only does it make file browsing truly flexible -- thanks to its multi-file managers support -- but the ultra-compact UI also redefines minimalism. The lightweight design doesn't stop it from providing various advanced features however, that may fit the needs of both casual and power users alike. All you have to do is just type the file name that you’re looking for, and Listary will display the search results at breakneck speed.</description>
    <projectUrl>http://www.listary.com</projectUrl>
    <tags>listary search find filemanager admin</tags>
    <copyright></copyright>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <releaseNotes></releaseNotes>
  </metadata>
  <files>
    <file src="tools\**" target="tools" />
  </files>
</package>

and the chocolateyInstall.ps1 contains the following.

$packageName = 'Listary'
$installerType = 'exe'
$url = 'http://www.listary.com/download/Listary.exe'
$silentArgs = '/SP /VERYSILENT /NORESTART'
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url"
like image 945
Ishan Avatar asked Dec 06 '13 09:12

Ishan


People also ask

How do I publish a package to Chocolatey?

Publish the Package First, go to http://chocolatey.org/ and create an account. Go to the Upload Package page, and upload your package there. Done!

Is Chocolatey a package manager?

Chocolatey is a package manager for Windows that builds on top of existing Windows technologies, using NuGet for packaging. A package manager, for those not familiar, is a way to get software onto your machine without much work on your part. It's the Windows equivalent of yum or apt-get.

What do you use Chocolatey for?

What is Chocolatey? Chocolatey is a command line application installer for Windows based on a developer-centric package manager called NuGet. Unlike manual installations, Chocolatey adds, updates, and uninstalls programs in the background requiring very little user interaction.


1 Answers

https://github.com/chocolatey/choco/wiki/CreatePackages#testing-your-package (fixed link)

Note the source is not a nupkg but rather a directory where the nupkg file is found.

In choco.exe (the reincarnation of Chocolatey), you can simply point to a nuspec or a nupkg file for install.

like image 60
ferventcoder Avatar answered Oct 07 '22 08:10

ferventcoder