Skip to content

Commit

Permalink
example bigfix firefox recpie
Browse files Browse the repository at this point in the history
  • Loading branch information
jgstew committed Jul 7, 2024
1 parent 0e1bf3d commit 0961dcc
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Mozilla/Firefox-Mac.download.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Process:
datetime_parsed_name: SourceReleaseDate

# this is specifically for BigFix, but won't hurt other use cases:
#- Processor: com.github.jgstew.SharedProcessors/BigFixPrefetchItem
- Processor: com.github.jgstew.SharedProcessors/BigFixPrefetchItem

- Processor: com.github.jgstew.SharedProcessors/FileHasher

Expand Down
54 changes: 54 additions & 0 deletions Mozilla/Firefox-Win-Install_Update.bes.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BES.xsd">
<{{TypeTaskOrFixlet}}{{^TypeTaskOrFixlet}}Task{{/TypeTaskOrFixlet}}>
<Title>{{^patch}}Install/{{/patch}}Update: {{DisplayName}} v{{version}} - Windows{{#64BitOnly}} (x64){{/64BitOnly}}</Title>
<Description><![CDATA[
This task will download and install "{{DisplayName}} v{{version}}" package onto selected endpoints <br><br><b>Run Command As:</b> System User<br><br><b>Download Size:</b> {{DownloadSize}}
{{^patch}}{{#icon_base64}}<br/><br/><b>Icon:</b><br/><img style="display:block; width:256px;" src="data:{{icon_type}}{{^icon_type}}image/png{{/icon_type}};base64,{{icon_base64}}" />{{/icon_base64}}{{/patch}}
]]></Description>
<Relevance>windows of operating system</Relevance>
{{#64BitOnly}}
<Relevance><![CDATA[x64 of operating system]]></Relevance>
{{/64BitOnly}}
{{#patch}}{{#DisplayName}}
<Relevance><![CDATA[ exists keys whose(value "DisplayName" of it as string starts with "{{DisplayName}}") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries) ]]></Relevance>
{{/DisplayName}}{{/patch}}
<Relevance><![CDATA[not exists (it as string as version) whose(it >= "{{version}}") of values "DisplayVersion" of keys whose(value "DisplayName" of it as string starts with "{{DisplayName}}") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries)]]></Relevance>
<Category></Category>
<DownloadSize>{{DownloadSize}}{{^DownloadSize}}0{{/DownloadSize}}</DownloadSize>
<Source>{{DisplayName}}</Source>
<SourceID></SourceID>
<SourceReleaseDate>{{SourceReleaseDate}}</SourceReleaseDate>
<SourceSeverity></SourceSeverity>
<CVENames></CVENames>
<SANSID></SANSID>
<MIMEField>
<Name>action-ui-metadata</Name>
<Value>{ {{#version}}"version":"{{version}}",{{/version}}"size":{{DownloadSize}}{{^DownloadSize}}0{{/DownloadSize}}{{^patch}}{{#icon_base64}},"icon":"data:{{icon_type}}{{^icon_type}}image/png{{/icon_type}};base64,{{icon_base64}}"{{/icon_base64}}{{/patch}} }</Value>
</MIMEField>
<MIMEField>
<Name>x-fixlet-modification-time</Name>
<Value>{{x-fixlet-modification-time}}</Value>
</MIMEField>
<Domain>BESC</Domain>
<DefaultAction ID="Action1">
<Description>
<PreLink>Click </PreLink>
<Link>here</Link>
<PostLink> to deploy {{DisplayName}} v{{version}}.</PostLink>
</Description>
<ActionScript MIMEType="application/x-Fixlet-Windows-Shell"><![CDATA[
// Download:
{{{prefetch}}}
// Install:
override wait
hidden=true
completion=job
wait __Download\{{{file_name}}} /S
// End]]></ActionScript>
<SuccessCriteria Option="OriginalRelevance"></SuccessCriteria>
</DefaultAction>
</{{TypeTaskOrFixlet}}{{^TypeTaskOrFixlet}}Task{{/TypeTaskOrFixlet}}>
</BES>
56 changes: 56 additions & 0 deletions Mozilla/Firefox-Win.bigfix.recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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.bigfix.Firefox-Win64
Input:
NAME: "Firefox"
DisplayName: "Mozilla 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/BigFixPrefetchItem

# - Processor: com.github.jgstew.SharedProcessors/BigFixSetupTemplateDictionary

- Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppendInput

- Processor: com.github.jgstew.SharedProcessors/URLDownloaderPython
Arguments:
filename: "%NAME%-icon.png"
url: https://upload.wikimedia.org/wikipedia/commons/thumb/a/a0/Firefox_logo%2C_2019.svg/200px-Firefox_logo%2C_2019.svg.png
COMPUTE_HASHES: false

- Processor: com.github.jgstew.SharedProcessors/FileGetBase64

- Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppend
Arguments:
append_key: "icon_base64"
append_value: "%file_base64%"

- Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate
Arguments:
# use UNIX style paths so this works on Windows and non-Windows:
template_file_path: ./Mozilla/Firefox-Win-Install_Update.bes.mustache
content_file_pathname: "%RECIPE_CACHE_DIR%/%NAME%-InstallUpdate.bes"

- Processor: com.github.jgstew.SharedProcessors/BESImport

- Processor: com.github.jgstew.SharedProcessors/BigFixActioner

# create update(patch) only content:
- Processor: com.github.jgstew.SharedProcessors/TemplateDictionaryAppend
Arguments:
append_key: "patch"
append_value: true

- Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate
Arguments:
# template_file_path: "./%VendorFolder%/%NAME%-Win-Install_Update.bes.mustache"
content_file_pathname: "%RECIPE_CACHE_DIR%/%NAME%-Update.bes"

- Processor: com.github.jgstew.SharedProcessors/BESImport

0 comments on commit 0961dcc

Please sign in to comment.