Haven't heard of Chocolatey? Rather than me rehash what it is you can read about it here.
The documentation for creating a package is a bit fragmented and difficult to follow. It's actually easy once you see how one is done. So here goes.
First off, Chocolatey in not an installer. It automates the process of downloading a setup program and then running it. It's essentially a smart PowerShell script for downloading and running an installer.
- Signup for a Chocolatey account. It's free.
- In the, "My Account" page, copy the API Key.
- Open a command prompt and run the following:
nuget setApiKey YOUR_API_KEY_HERE -Source http://chocolatey.org/
- Create a new folder called, "example-package". Substitute "example" with your package name.
- Create a new file called, "example.nuspec".
- Open the file in a text editor and insert the following contents
<summary>Yeah, its an awesome example</summary>
<description>Did I mention its awesome?</description>
<dependency id="DotNet4.5.1" />
- Change the contents of the tags to reflect what's in your package. The, "DotNet4.5.1" dependency is an example of how to do a dependency. Remove or change it as required. Use the appropriate license and icon.
- Create a subfolder called, "tools".
- In the, "tools" subfolder, create a file called, "ChocolateyInstall.ps1".
- Edit the contents of, "ChocolateyInstall.ps1" as follows:
Install-ChocolateyPackage 'example' 'msi' '/s' 'http://example.com/setup.msi
- The first parameter is the same name as the <id> in the, "example.nupec" file.
- The second parameter is one of the following: exe, msi, mui
- The third parameter is the command line switch for a silent install. Use the appropriate switch for the installer program.
- The forth parameter is the download URL of the installer.
- Return to the folder where you created, "example.nuspec.
- Build the package by running:
- Test your installation by running:
cinst example -source %cd%
- Once your satisfied with the results you can publish the package by running:
Chocolatey can handle more complex situations. See the documentation for details. Good luck!