I am trying to automate to set up a developer machine software installation. Chocolatey is good to install packages when you connected to the Internet. Is there a way to install packages offline?
I just want to put all the packages in a shared network folder and use that packages to install. If you have an internal application, how do you convert them into a Chocolatey package?
While there are ways to set the original nupkg (with the version on it, not the one in the packages directory - use download from left side of packages page on the Chocolatey community package repository) and preset the downloaded binaries into the cache folder, it's not always deterministic that it will work. You can also override the cache location, so that the folder is somewhere not in TEMP. See choco config
, choco config -h
and choco config set cacheLocation c:\some\location
to do this.
For packages you need offline, you have the ability to manage your own packages and you can embed software right into the package. This is desired when you want to manage software offline as most things on the community repository are subject to copyright law and distribution rights (why they don't simply have the software they represent embedded).
Creating and working with your own packages is very secure, but it does tend to take up time. If you are doing this for yourself, then it could override any time-savings you get as a consumer using Chocolatey and the community repository.
For organizations, we've developed Package Builder, which creates full software deployments (packages) in 5-10 seconds. It can also create packages right out of existing installed software (Programs and Features) in under 60 seconds! Read more about Package Builder.
The best thing you can do here is a process called internalizing, where you download and extract the package, download all of the resources and embed them in the package (or put them somewhere local), edit the scripts to use those embedded/local resources and recompile the package.
This allows you to take advantage of existing package logic without the issue of the internet.
For more details see Manually Internalizing Packages and Package Internalizer - Automatically Internalize Packages.
Most organizations using Chocolatey are doing some combination of creating packages and internalizing packages, because they need reliability and absolute trust and control over those packages when being used in production scenarios.