Skip to content

Commit

Permalink
work in progress screenconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
jgstew committed Mar 1, 2024
1 parent 779dbad commit e922dbf
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 0 deletions.
53 changes: 53 additions & 0 deletions ConnectWise/ScreenConnect-Win-Install_Update.bes.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?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 msiexec.exe /i __Download\{{{file_name}}} /qn /norestart
]]></ActionScript>
<SuccessCriteria Option="OriginalRelevance"></SuccessCriteria>
</DefaultAction>
</{{TypeTaskOrFixlet}}{{^TypeTaskOrFixlet}}Task{{/TypeTaskOrFixlet}}>
</BES>
36 changes: 36 additions & 0 deletions ConnectWise/ScreenConnect-Win.bigfix.recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
Description: Generates a BigFix Task for ScreenConnect
Identifier: com.github.jgstew.bigfix.ScreenConnect-Win
Input:
NAME: ScreenConnect-Win
DisplayName: ScreenConnect
# 64BitOnly: TRUE
MinimumVersion: "2.3"
ParentRecipe: com.github.jgstew.download.ScreenConnect-Win
Process:
- Processor: com.github.jgstew.SharedProcessors/BigFixPrefetchItem

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

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

- Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate
Arguments:
# use UNIX style paths so this works on Windows and non-Windows:
template_file_path: ./ConnectWise/ScreenConnect-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"
33 changes: 33 additions & 0 deletions ConnectWise/ScreenConnect-Win.download.recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
Description: Downloads the latest ScreenConnect
Identifier: com.github.jgstew.download.ScreenConnect-Win
Input:
NAME: ScreenConnect-Win
DisplayName: ScreenConnect
MinimumVersion: "2.3"
Process:
# get all versions found in this JSON doc:
- Processor: URLTextSearcher
Arguments:
url: https://screenconnect.connectwise.com/download
re_pattern: "(?P<url>https://d1kuyuqowve5id.cloudfront.net/ScreenConnect_23.9.10.8817_Release.msi)"

- Processor: URLDownloaderPython
Arguments:
filename: ScreenConnect_Release.msi
download_version: ""
COMPUTE_HASHES: True

- Processor: EndOfCheckPhase

# Get apparent SourceReleaseDate from MSI metadata:
- Processor: com.github.jgstew.SharedProcessors/FileMsiGetInfoOLE

# Get version number from MSI ProductVersion:
- Processor: com.github.jgstew.SharedProcessors/FileMsiGetProperty

# verify version is set correctly, at least major.minor:
- Processor: com.github.jgstew.SharedProcessors/TextSearcher
Arguments:
input_string: "%version%"
re_pattern: '^\d+\.\d+'

0 comments on commit e922dbf

Please sign in to comment.