-
Notifications
You must be signed in to change notification settings - Fork 905
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
Create custom package templates #76
Comments
Something like warmup? |
i know warmup and it was fine for me to use a 3rd party solution because the old chocolatey did not offer this at all. but if chocolatey wants to offer templates it should also offer a way to modify them. i mean |
If you drop a template into You would call To replace the built-in template, you should put a folder in the template with the name of "default". Then choco will use that instead of the built-in template with no need to specify a template name. |
Allow creation of custom templates. If you drop a template folder into `$env:ChocolateyInstall\templates` folder, you can use `-t name_of_template_folder` to generate a choco template based on that. If you were to drop an organization folder into the templates folder, you would call `choco new pkgname -t organization` and choco will use the template folder instead of the built-in template. You can also replace the built-in template by placing a "default" folder into the templates folder. choco will use that instead of the built-in template with no need to specify a template name.
* stable: (GH-76) Create custom templates (maint) comment about extension including dot (maint) resharper settings
A file with the extension <?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if ԏԠdoesnӴ appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>[[PackageNameLower]]</id>
<title>[[PackageName]] (Install)</title>
<version>[[PackageVersion]]</version>
<authors>Original authors</authors>
<owners>[[MaintainerName]]</owners>
<description>__REPLACE__MarkDown_Okay [[AutomaticPackageNotesNuspec]]
</description>
<tags>[[PackageNameLower]] admin</tags>
<!--<dependencies>
<dependency id="" version="__VERSION__" />
<dependency id="" />
</dependencies>-->
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
$ErrorActionPreference = 'Stop'; # stop on all errors
[[AutomaticPackageNotesInstaller]]
$packageName = '[[PackageName]]'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$fileLocation = Join-Path $toolsDir 'NAME_OF_EMBEDDED_INSTALLER_FILE'
$packageArgs = @{
packageName = $packageName
file = $fileLocation
fileType = '[[InstallerType]]' #only one of these: exe, msi, msu
#MSI
silentArgs = "/qn /norestart /l*v `"$env:TEMP\chocolatey\$($packageName)\$($packageName).MsiInstall.log`""
validExitCodes= @(0, 3010, 1641)
#OTHERS
#silentArgs ='[[SilentArgs]]' # /s /S /q /Q /quiet /silent /SILENT /VERYSILENT -s - try any of these to get the silent installer
#validExitCodes= @(0) #please insert other valid exit codes here
}
Install-ChocolateyInstallPackage @packageArgs
|
You can get the names by running
However Then you surround those templated values with |
Documentation coming up at https://github.com/chocolatey/choco/wiki/How-To-Create-Custom-Package-Templates |
I would like to be able to modify templates. My packages all look sort of similar so I find it faster to actually copy an existing package and modify it. If I could create a custom template the new-function would actually be useful to me.
The text was updated successfully, but these errors were encountered: