chocolatey / chocolatey/choco

Templates are incorrectly marked as `(Unmanaged)` when there is a package managing the template

Open
#3,571 0 comments 0 reactions 0 assignees View on GitHub
0 - Backlog Bug
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

### Checklist

- [x] I confirm there are no unresolved issues reported on the [Chocolatey Status page](https://status.chocolatey.org).
- [x] I have verified this is the correct repository for opening this issue.
- [x] I have verified no other issues exist related to my problem.
- [x] I have verified this is not an issue for a specific package.
- [x] I have verified this issue is not security related.
- [x] I confirm I am using **official**, and **not** unofficial, or modified, Chocolatey products.

### What You Are Seeing?

There are two ways to have templates in Chocolatey CLI.

- You can manually create the template files in the `templates` folder.
- You can install a template package

When you run `choco template list` it will attempt to find any packages that manage the templates that are found in the template folder. If one is found, the version number of the package is shown. If no package is found, the version is 0.0.0.

When you run `choco template info --name choco template list
Chocolatey v2.4.0 Business
Packages 17.0 - ENU' has been upgraded.
gep13msi 0.0.0
msi 1.0.2
vscode 1.0.0
zip 1.0.0
4 Custom templates found at C:\ProgramData\chocolatey\templates

Built-in template is default.

PS C:\temp\template\gep13msi.template>

PS C:\temp\template\gep13msi.template> choco template info --name gep13msi
Chocolatey v2.4.0 Business
Template name: gep13msi
Version: 0.0.0
Default template: False
Title: gep13msi (Unmanaged)
Template not installed as a package
List of files:
C:\ProgramData\chocolatey\templates\gep13msi\gep13msi.nuspec
C:\ProgramData\chocolatey\templates\gep13msi\tools\chocolateyInstall.ps1
List of Parameters:
PackageNameLower
PackageName
PackageVersion
SoftwareAuthors
MaintainerName
PackageDescription
CustomValue
InstallerFileName
SilentArgs
ValidExitCodes

PS C:\temp\template\gep13msi.template>
```

### Additional Context

None

Contributor guide

Open the contributing guide

Research direction

Start by tracing the code behind `choco template list` and `choco template info --name `, focusing on how templates in `C:\ProgramData\chocolatey\templates` are matched to packages. Reproduce the behavior with a locally installed custom template whose package is unavailable from configured sources. Done means both commands use the installed package name and version, without showing `0.0.0` or `(Unmanaged)`.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.