Skip to content

Commit

Permalink
add chocolateytemplate recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
jgstew committed Jul 7, 2024
1 parent 22b45c6 commit 9c7d14a
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Mozilla/Firefox-Win.ChocolateyTemplate.Firefox.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Firefox</id>
<version>{{version}}</version>
<title>Firefox</title>
<authors>Mozilla</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Firefox web browser.</description>
</metadata>
</package>
11 changes: 11 additions & 0 deletions Mozilla/Firefox-Win.ChocolateyTemplate.chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$ErrorActionPreference = 'Stop'
$toolsDir = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)"
$file = Join-Path $toolsDir '{{file_name}}'
$packageArgs = @{
packageName = 'Firefox'
fileType = 'exe'
silentArgs = '/S'
file = $file
}

Install-ChocolateyInstallPackage @packageArgs
33 changes: 33 additions & 0 deletions Mozilla/Firefox-Win.ChocolateyTemplate.recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# https://download.mozilla.org/?product=firefox-latest-ssl&os=osx&lang=en-US
---
Description: Creates an choco package for the latest version of Firefox
Identifier: com.github.jgstew.ChocolateyTemplate.Firefox-Win64
Input:
NAME: "Firefox"
product: firefox-latest-ssl
OS: win64
filename: FirefoxSetup.exe
# https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US
# https://download.mozilla.org/?product=firefox-msi-latest-ssl&os=win64&lang=en-US
MinimumVersion: "2.3"
ParentRecipe: com.github.jgstew.download.Firefox-Win64
Process:
- Processor: com.github.jgstew.SharedProcessors/FileTouch
Arguments:
pathname: "%RECIPE_CACHE_DIR%/tmp/tools/chocolateyInstall.ps1"
touch_create_folders: True
- Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate
Arguments:
template_file_path: "./Mozilla/Firefox-Win.ChocolateyTemplate.Firefox.nuspec"
content_file_pathname: "%RECIPE_CACHE_DIR%/tmp/Firefox.nuspec"
- Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate
Arguments:
template_file_path: "./Mozilla/Firefox-Win.ChocolateyTemplate.chocolateyInstall.ps1"
content_file_pathname: "%RECIPE_CACHE_DIR%/tmp/tools/chocolateyInstall.ps1"
# - Processor: PathDeleter
# Arguments:
# path_list: ["%RECIPE_CACHE_DIR%/tmp/tools/FirefoxSetup.exe"]
- Processor: com.github.jgstew.SharedProcessors/FileCopyNewest
Arguments:
file_path_first: "%RECIPE_CACHE_DIR%/downloads/FirefoxSetup.exe"
file_path_second: "%RECIPE_CACHE_DIR%/tmp/tools/FirefoxSetup.exe"

0 comments on commit 9c7d14a

Please sign in to comment.