(#2074) Control shim generation with a .shiminclude file #2075
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A .shiminclude file specifies executables that Chocolatey should
generate a shim for. This mechanism provides an opt-in alternative to
the default behaviour, which is to automatically shim all .exe files
found in the package unless there is a matching file suffixed .ignore.
Each line in a .shiminclude file specifies a path relative to the
package's tools directory. This can point to either a specific file
type (.exe, .bat or .cmd), or to a directory or group of directories in
which to search for .exe files.
Format:
A .shiminclude file is UTF-8 encoded without a BOM.
A blank line matches no directories or files.
A line starting with
#serves as a comment. Put a backslash\infront of the first hash for paths that begin with a hash.
An optional prefix
!negates the path. Put a backslash\in frontof the first
!for paths that begin with a literal!.A backslash
\or a forward slash/can be used as a directoryseparator.
The
?wildcard matches zero or one character except a directoryseparator.
The
*wildcard matches zero or more characters except a directoryseparator.
The order of entries is not considered: duplicates are skipped and
negated paths are irrevocable.
Usage:
A .shiminclude file must be located in the package's tools directory
and its entries must be relative paths from this location. If an entry
resolves to a location outside the package directory it will be
skipped. If no .shiminclude file is found, Chocolatey will search for
.exe files to shim.
Chocolatey will not search for files to shim if the .shiminclude file
is empty, or contains only blank/comment entries.
An entry is treated as a path to a file if it ends with an .exe, .bat
or .cmd extension, otherwise it is considered a path to a directory.
If a matching file suffixed .ignore is found, a shim will not be
generated.
Examples:
The following examples assume that a package has installed its software
into the
<pkg>\tools\progdirectory, where<pkg>is the location ofthe package. The shiminclude file is located at
<pkg>\tools\.shiminclude.prog\sbin\prog.exematches the<pkg>\tools\prog\sbin\prog.exefile.prog\sbinmatches all .exe files in<pkg>\tools\prog\sbin.prog\*matches all .exe files in all top level directories in<pkg>\tools\prog.prog\sbin\prog?.exematches<pkg>\tools\prog\sbin\prog.exeand<pkg>\tools\prog\sbin\prog2.exe.The file extension must be included to match other file types. For
example
prog\sbin\prog3.batmatches the<pkg>\tools\prog\sbin\prog3.batfile, while
prog\*\*.batmatches all .bat files in all top leveldirectories in
<pkg>\tools\prog.