In order to make install scripts and understanding existing ones, I would like to know what happens behind the scenes of the typical:
choco install notepadplusplus
I found the following here:
Installation
- Chocolatey uses Nuget.Core to retrieve the package from the source.
- Choco determines if it self-contained or has automation scripts - PowerShell scripts (*.ps1 files), and soon to be open to Scriptcs files in the 0.9.10.x timeframe (I know, right?!).
- Choco takes a registry snapshot for later comparison.
- If there are automation scripts, choco will run those. They can contain whatever you need to do, if they are PowerShell you have the full power of Posh (PowerShell), but you should try to ensure they are compatible with Posh v2+.
- Choco compares the snapshot and determines uninstaller information and saves that to a .registry file.
- Choco snapshots the folder based on all files that are currently in the package directory.
- Choco looks for executable files in the package folder and generates shims into the $env:ChocolateyInstall\bin folder so those items are available on the path. Those could have been embedded into the package or brought down from somewhere (internet, ftp, file folder share, etc) and placed there.
That given,
How can I get the
.nupkg
package URL? In general it seems like this:Which is the
.nupkg
package download directory?Where is the content of the
.nupkg
package extracted by default? This is important sincechocolateyInstall.ps1
sometime usesSplit-Path -Parent $MyInvocation.MyCommand.Definition
.
"Scriptcs files in the 0.9.10.x timeframe" is rather cryptic. Can you give some references?
Is Posh v2+ simply short for Powershell or is a specific technology?
There are several executable files in
$env:ChocolateyInstall\lib
without a link in$env:ChocolateyInstall\bin
. For example, thempv.exe
of the mpv player is not linked.