Part 2: Building packages
The wiki is by far the greatest reference, and will be my main reference here.
The idea for me will be to build an environment that is easy to deal with new package builds for distribution. I’ll rely on Rob’s heavy lifting from the wiki.
Build a build environment for building:
This section only needs to be performed once.
Install git and warm up:
cinst warmup && cinst git exit
There is no way to re-initialize the environment that cmd.exe is running to inherit the %path%, other than exiting and respawning cmd.exe.
Clone the template repo
cd %chocolateyinstall% git clone https://github.com/chocolatey/chocolateytemplates.git
Prepare the templates:
cd %chocolateyinstall%\chocolateytemplates\_templates warmup addTemplateFolder chocolatey "%cd%\chocolatey" #if XP you must also run: linkd "C:\CODE\_templates\chocolatey" "C:\Chocolatey\chocolateytemplates\_templates\chocolatey" warmup addTextReplacement __CHOCO_PKG_OWNER_NAME__ "Matt Brown" warmup addTextReplacement __CHOCO_PKG_OWNER_REPO__ "test repo" warmup addTextReplacement __CHOCO_AUTO_PKG_OWNER_REPO__ "test repo"
I will be creating three packages, each in a different situation:
- The first will be Parkdale, an “HDD” benchmark program by Steffan Z. It is available via HTTP in a ZIP that contains an EXE. This is classified as a Portable application. I will work off the example Space Sniffer by bdukes.
- The second will be VLC Player, a media player. It is available via HTTP in an EXE packaged by the Nullsoft Scriptable Install System (NSIS). This is classified as an Installable application. I will work off the example VLC by ferventcoder (aka Rob Reynolds himself)
- The third will be Desktop Restore, an desktop icon location saver program by Jamie O’Connell. It is available via HTTP in a
MicrosoftWindows Installer (MSI). This is classified as an installable application. I am currently unsure which package I will work off of for this situation.