Templates are incorrectly marked as `(Unmanaged)` when there is a package managing the template
Checklist
- [x] I confirm there are no unresolved issues reported on the Chocolatey Status page.
- [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
templatesfolder. - 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 <template-name) it will attempt to find any package that manages the template (if it exists). If one is found, the Title of the template is shown, and if not, the word (Unmanaged) is prefixed on the title.
It would appear that when searching of the package to match the template name, the search is done against currently configured sources, and not of the packages that are currently installed. i.e. via a choco search rather than a choco list.
This problem was discovered when testing for the Product Spotlight on Chocolatey Template Packages.
What is Expected?
It should not be necessary for a template package to exist on a currently configured source.
If a template exists, i.e. lives in the c:\programdata\chocolatey\templates folder, and there exists a locally installed package with that name, then it should not be marked as (Unmanaged) and the version of the package should be correctly shown.
How Did You Get This To Happen?
- Install a custom template - one which is available on CCR, or any other configured source
- Run
choco template list - See in the output that the version of the template package that you just installed is 0.0.0
- Run
choco template info --name <template-name) - See in the output that the title includes
(Unmanaged)
System Details
N/A - this has been tested on various places, and nothing is specific to the information that is typically captured here
Installed Packages
N/A
Output Log
PS C:\temp\template\gep13msi.template> 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