Instructions to create a portable Chocolatey package are inscrutable
For the life of me, I cannot figure out how to make a standalone/portable/whatever Chocolatey package. There are 4 executables I'd like to package into Chocolatey package; no MSI, no installers, no unnecessary complexity. What is the directory layout supposed to be? https://github.com/chocolatey/choco/wiki/CreatePackagesQuickStart offers no assistance.
To be clear, I don't want to bundle an installation script. I just need 4 files extracted to somewhere in %ChocolateyInstall%\lib\PackageName and symlinked from %ChocolateyInstall%\bin.
An explicit file layout for the archive, like:
/
/Foo.nuspec
/tools/
/tools/release/
/tools/release/bin/
/tools/release/bin/foo.exe
would go a long way.
Literally doesn't matter where they are. Just put them in the package and choco will find them and create shims. It could not be simpler.
On Wednesday, March 18, 2015, Alex [email protected] wrote:
For the life of me, I cannot figure out how to make a standalone/portable/whatever Chocolatey package. There are 4 executables I'd like to package into Chocolatey package; no MSI, no installers, no unnecessary complexity. What is the directory layout supposed to be? https://github.com/chocolatey/choco/wiki/CreatePackagesQuickStart offers no assistance.
To be clear, I don't want to bundle an installation script. I just need 4 files extracted to somewhere in %ChocolateyInstall%\lib\PackageName and symlinked from %ChocolateyInstall%\bin.
An explicit file layout for the archive, like:
/ /Foo.nuspec /tools/ /tools/release/ /tools/release/bin/ /tools/release/bin/foo.exe
would go a long way.
— Reply to this email directly or view it on GitHub https://github.com/chocolatey/choco/issues/176.
Rob "Be passionate in all you do"
http://devlicio.us/blogs/rob_reynolds http://ferventcoder.com http://twitter.com/ferventcoder
We can add things to the wiki though
Are you sure? So if I just have a zipfile containing a .nuspec and 4 .exes, choco will know to create a bin directory and stick the exes in %ChocolateyInstall%\lib\PackageName\bin\?
And just as important, choco will remember and remove those 4 exes upon uninstallation?
What it will do is create a shim exe, in the Chocolatey bin folder, pointing at the exe's extracted from the zip file.
Right, but where are the exes extracted to? What is the mapping between the zip file and %ChocolateyInstall%\lib\PackageName? For example, untarring a tar.gz to a folder exactly replicates the tarball's directory structure.
Also, is it recommended for the package's root extraction directory to be %ChocolateyInstall%\lib\PackageName\tools? (resulting in %ChocolateyInstall%\lib\PackageName\tools\bin\, %ChocolateyInstall%\lib\PackageName\tools\README, etc)?
Or is it preferable to extract directly to %ChocolateyInstall%\lib\PackageName (resulting in %ChocolateyInstall%\lib\PackageName\README, %ChocolateyInstall%\lib\PackageName\bin\, etc)?
The wiki doesn't specify what file hierarchy convention should be followed for new chocolatey packages.
@alexchandel I see what you are getting at, but really chocolatey only needs the exe files to be in the package - they will get extracted as part of the package automatically and removed on uninstall.
And choco has a folder %chocolateyInstall%\bin where it will create a shim for any exe file it finds in the directory.
Perhaps just testing it locally will show you what it does. It's really considered very simple that we didn't really document it yet. I mean to say, it is documented somewhere, but prolly not called out well.
Also, you've probably been through the much larger wiki as well, I'd take a look starting here - https://github.com/chocolatey/choco/wiki/CreatePackages#how-do-i-exclude-executables-from-getting-batch-redirects
@ferventcoder local testing/try-and-fail did the trick ;) I ended up going with the following directory structure and mapping tools\** to tools:
purescript.nuspec
tools\bin\psc-docs.exe
tools\bin\psc-make.exe
tools\bin\psc.exe
tools\bin\psci.exe
tools\LICENSE
tools\README
For reference this is the package I ended up pushing. I don't think it's listed yet though.
I think we can improve the docs in this area to make this clearer. Moving this to the docs repository.