Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
6 tasks done
gep13 opened this issue Nov 21, 2024 · 0 comments
Open
6 tasks done

Comments

@gep13
Copy link
Member

gep13 commented Nov 21, 2024

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • 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 <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?

  1. Install a custom template - one which is available on CCR, or any other configured source
  2. Run choco template list
  3. See in the output that the version of the template package that you just installed is 0.0.0
  4. Run choco template info --name <template-name)
  5. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant