The bootstrapper downloads the latest stable paket.exe
. By default, the
bootstrapper caches downloaded versions of paket.exe
for the current user
across all projects. If the requested version is not present in the cache, it is
downloaded from github.com. If the download from GitHub
fails it tries to download the version from nuget.org
instead.
Cached versions of paket.exe
are removed when the NuGet cache directory is
cleared.
Ctrl + C interrupts the download process. The return value
of the bootstrapper is 0 when a fresh copy of paket.exe
was found, so that any
subsequent scripts can continue.
paket.bootstrapper.exe [prerelease|<version>] [--prefer-nuget] [--self] [-s] [-f]
-
prerelease
: Download the latestpaket.exe
from GitHub, including prerelease versions. -
<version>
: Download the given version ofpaket.exe
from GitHub. -
--prefer-nuget
: Downloadpaket.exe
from nuget.org instead of GitHub. Uses GitHub as a fallback, if the download from nuget.org fails. -
--force-nuget
: Similar to--prefer-nuget
, but won't use use GitHub.com as a fallback. -
--max-file-age=120
: Skip download ifpaket.exe
already exists and it is not older than120
minutes. -
--nuget-source=<URL>
: When specified as--nuget-source=http://example.com/path/here
, the specified URL is used instead of the default nuget.org download URL when trying to fetchpaket.exe
as a NuGet package. Combine this with either--prefer-nuget
or--force-nuget
to getpaket.exe
from a custom source. -
--self
: Self-update thepaket.bootstrapper.exe
. When this option is used the download ofpaket.exe
will be skipped. Can be combined with--prefer-nuget
. -
-s
: Make the bootstrapper more silent. Use it once to display only errors or twice to supress all output. -
-v
: Make the bootstrapper more verbose. Display more information about the boostrapper process, including operation timings. -
-f
: Force the bootstrapper to ignore any cachedpaket.exe
versions and go directly to GitHub or nuget.org, based on other flags. -
--run
: Once downloaded runpaket.exe
. All arguments following this one are ignored and passed directly topaket.exe
. -
--config-file=<config-file-path>
: Forces the bootstrapper to use another config file instead of the defaultpaket.bootstrapper.exe.config
file. -
--help
: Show help detailing all possible options.
If present, the paket.bootstrapper.exe.config
file can be used to configure
default options. When an option is passed on the command line, the corresponding
application setting is ignored.
Example:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="PreferNuget" value="True"/>
<add key="ForceNuget" value="True"/>
<add key="Prerelease" value="True"/>
<add key="PaketVersion" value="1.5"/>
<add key="BoostrapperOutputDir" value="_workDir" />
</appSettings>
</configuration>
PreferNuget
: Same as--prefer-nuget
option.ForceNuget
: Same as--force-nuget
option.Prerelease
: Same asprerelease
option.PaketVersion
: Same as<version>
option.BootstrapperOutputDir
: Same as--output-dir=
option.
PAKET_VERSION
: The requested version can also be set using this environment
variable.
- powershell
$env:PAKET_VERSION = "5.119.7"
- cmd
set PAKET_VERSION=5.119.7
- bash
export PAKET_VERSION="5.119.7"
If a paket.dependencies
file is found in the current
directory it may contain a special line containing options for the bootstrapper.
The line must start with version
followed by a requested paket.exe
version
and optionally other bootstrapper command line arguments:
version 3.24.1
source https://api.nuget.org/v3/index.json
nuget FAKE
nuget FSharp.Core ~> 4
or
version 3.24.1 --prefer-nuget
source https://api.nuget.org/v3/index.json
nuget FAKE
nuget FSharp.Core ~> 4
When paket.bootstrapper.exe
is renamed to paket.exe
, the real paket.exe
is
downloaded to a temporary location and executed with all arguments passed
directly.
paket.exe add nuget FAKE
Executes the same thing as:
paket.bootstrapper.exe -s --max-file-age=720 --run add nuget FAKE
Using this feature Paket usage may be simplified by committing a ~50KB
paket.exe
to source control and using it directly. The fact that a
bootstrapper exists is completely hidden and becomes an implementation detail
that contributors to your repository won't have to know — or care — about.
While bootstrapper command line options can't be used, the other sources
(application settings, environment variables and paket.dependencies) may still
be used to configure the bootstrapper. The only difference is that the
application settings file should be named paket.exe.config
rather than
paket.bootstrapper.exe.config
.
To self update the bootstrapper in magic mode you can run:
paket.exe --self --run --version
A few default settings are applied:
- The bootstrapper is silenced and only errors are displayed.
-v
can be used once to restore normal output or twice to show more details. - If no version is specified a default
--max-file-age
of12
hours is used.
Note about anti virus and magic mode:
If your anti virus is too aggressive, and must have paket excluded, it will not
be fully excluded unless you change the BoostrapperOutputDir
to a folder that
is excluded from the anti virus scanner, e.g. a sub folder inside the repository
of the project utilizing magic mode.