Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Desktop Developer

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

    Search

    XML Feeds

    Google Ads

    « Windows 8 Developer Preview with tools available for downloadChocolatey GUI »
    comments

    Introduction

    If you are using Chocolatey and you would now like to make a package of your own program to make it available through Chocolatey then you need to go through a few steps. Here is how I did it for ChocolateyGUI.

    But you can also watch the video ferventcoder has put up on youtube.

    WarmUp

    First I installed WarmUp via Chocolatey of course.

    cinst warmup

    Or in my case I just used the GUI.

    Then I downloaded the nugetpackages from ferventcoders github account and copied the Chocolatey folder in the _template folder to c:/CODE/_templates which will give you something like this.

    And now you can do the commandline thing and prepare your package easily.

    You will now find that it has created a package in your user folder.

    The package

    We now have to change the nuspec file. To this.

    1. <?xml version="1.0"?>
    2. <package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    3.   <metadata>
    4.     <id>ChocolateyGUI</id>
    5.     <title>ChocolateyGUI</title>
    6.     <version>0.0.1</version>
    7.     <authors>Christiaan Baes</authors>
    8.     <owners>Christiaan Baes</owners>
    9.     <summary>A GUI for Chocolatey</summary>
    10.     <description>ChocolateyGUI
    11. | Please install with chocolatey (http://nuget.org/List/Packages/chocolatey).</description>
    12.     <projectUrl>https://github.com/chrissie1/chocolatey-Explorer</projectUrl>
    13.     <tags>ChocolateyGUI chocolatey admin</tags>
    14.     <licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
    15.     <requireLicenseAcceptance>false</requireLicenseAcceptance>
    16.   </metadata>
    17. </package>

    And I also added a License.txt to the content folder.

    Then I copied my MSI-file into the tools folder.

    Now it is time to change the chocolateyinstall.ps1.
    Mine looks like this.

    1. try {
    2.   $scriptPath = $(Split-Path $MyInvocation.MyCommand.Path)
    3.   $nodePath = Join-Path $scriptPath 'SetupChocolateyGUI.msi'
    4.   Install-ChocolateyInstallPackage 'ChocolateyGUI' 'msi' '/quiet' $nodepath
    5.   Write-ChocolateySuccess 'ChocolateyGUI'
    6. } catch {
    7.   Write-ChocolateyFailure 'ChocolateyGUI' "$($_.Exception.Message)"
    8.   throw
    9. }

    After you have done all this. You have to pack it up with nuget.

    and now we should be able to test our package.

    And, woohoo, our program is installed.

    Chocolatey.org gallery

    Now I just need to upload the nupkg file to thocolatey.org and let you guys play with it.

    And here it is.

    Conclusion

    This was all pretty easy to do. And it works. Go ahead try it out.

    About the Author

    User bio imageChristiaan is a forensic technician who programs on the side, although my function description says that I do IT-things for 90% of the time . I'm an avid VB.NET fan and I use lots of the ALT.Net techniques, like unit-testing, nhibernate, logging, IoC, ...
    Social SitingsTwitterLinkedInHomePageLTD RSS Feed
    c#, chocolatey, nuget
    Instapaper

    No feedback yet

    Leave a comment


    Your email address will not be revealed on this site.

    Your URL will be displayed.
    (Line breaks become <br />)
    (Name, email & website)
    (Allow users to contact you through a message form (your email will not be revealed.)