diff --git a/automatic/audioshell/update.ps1 b/automatic/audioshell/update.ps1
index 77166032f..ab5ea259a 100644
--- a/automatic/audioshell/update.ps1
+++ b/automatic/audioshell/update.ps1
@@ -13,6 +13,13 @@ function global:au_SearchReplace {
}
}
+function global:au_BeforeUpdate {
+ . ..\..\scripts\Get-FileVersion.ps1
+ $FileVersion = Get-FileVersion $Latest.URL32
+ $Latest.Checksum32 = $FileVersion.Checksum
+ $Latest.ChecksumType32 = $FileVersion.checksumType
+}
+
function global:au_AfterUpdate($Package) {
Invoke-VirusTotalScan $Package
}
@@ -31,4 +38,4 @@ function global:au_GetLatest {
return $Latest
}
-update -ChecksumFor 32 -NoCheckChocoVersion
\ No newline at end of file
+update -ChecksumFor none
\ No newline at end of file
diff --git a/automatic/gnu-units/README.md b/automatic/gnu-units/README.md
index acf38ddab..811169a69 100644
--- a/automatic/gnu-units/README.md
+++ b/automatic/gnu-units/README.md
@@ -2,29 +2,12 @@
## GNU Units (Install)
----
-
-### [choco://gnu-units](choco://gnu-units)
-To use choco:// protocol URLs, install [(unofficial) choco:// Protocol support ](https://chocolatey.org/packages/choco-protocol-support)
-
----
-
GNU Units converts quantities expressed in various systems of measurement to their equivalents in other systems of measurement. Like many similar programs, it can handle multiplicative scale changes. It can also handle nonlinear conversions such as Fahrenheit to Celsius or wire gauge, and it can convert from and to sums of units, such as converting between meters and feet plus inches.
Beyond simple unit conversions, GNU Units can be used as a general-purpose scientific calculator that keeps track of units in its calculations. You can form arbitrary complex mathematical expressions of dimensions including sums, products, quotients, powers, and even roots of dimensions. Thus you can ensure accuracy and dimensional consistency when working with long expressions that involve many different units that may combine in complex ways.
The units are defined in an external data file. You can use the extensive data file that comes with this program, or you can provide your own data file to suit your needs. You can also use your own data file to supplement the standard data file.
-**[PACKAGE NOTES](https://github.com/bcurran3/ChocolateyPackages/blob/master/gnu-units/readme.md)**
-
-
-
----
-
-**Click here to [Patreon-ize](https://www.patreon.com/bcurran3) the package maintainer.**
-
----
-
#### [choco://gnu-units](choco://gnu-units)
To use choco:// protocol URLs, install [(unofficial) choco:// Protocol support ](https://chocolatey.org/packages/choco-protocol-support)
diff --git a/automatic/gnu-units/gnu-units.nuspec b/automatic/gnu-units/gnu-units.nuspec
index 0f32ca45a..82151506d 100644
--- a/automatic/gnu-units/gnu-units.nuspec
+++ b/automatic/gnu-units/gnu-units.nuspec
@@ -40,6 +40,7 @@ The units are defined in an external data file. You can use the extensive data f
https://www.gnu.org/software/units/manual/
+
diff --git a/automatic/gnu-units/tools/LICENSE.txt b/automatic/gnu-units/legal/LICENSE.txt
similarity index 100%
rename from automatic/gnu-units/tools/LICENSE.txt
rename to automatic/gnu-units/legal/LICENSE.txt
diff --git a/automatic/gnu-units/legal/VERIFICATION.txt b/automatic/gnu-units/legal/VERIFICATION.txt
new file mode 100644
index 000000000..90e616fd4
--- /dev/null
+++ b/automatic/gnu-units/legal/VERIFICATION.txt
@@ -0,0 +1,17 @@
+VERIFICATION
+Verification is intended to assist the Chocolatey moderators and community
+in verifying that this package's contents are trustworthy.
+
+1. Download the installer:
+
+ x32: https://sourceforge.net/projects/freeplane/files/freeplane%20stable/Freeplane-Setup-with-Java-1.12.5.exe/download
+
+2. You can use one of the following methods to obtain the checksum:
+ - Use powershell function 'Get-FileHash'
+ - Use Chocolatey utility 'checksum.exe'
+ - Using AU:
+ Get-RemoteChecksum https://sourceforge.net/projects/freeplane/files/freeplane%20stable/Freeplane-Setup-with-Java-1.12.5.exe/download
+
+3. Compare to Checksum:
+
+ checksum32: d214c610141466289b5bd717447626c706bab9aebb4fc86b6091f26ae5335523
diff --git a/automatic/gnu-units/tools/ChocolateyInstall.ps1 b/automatic/gnu-units/tools/ChocolateyInstall.ps1
index 6ed1a1c6d..a913946a5 100644
--- a/automatic/gnu-units/tools/ChocolateyInstall.ps1
+++ b/automatic/gnu-units/tools/ChocolateyInstall.ps1
@@ -1,11 +1,12 @@
$ErrorActionPreference = 'Stop'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$packageName = 'gnu-units'
+$file = Get-Item $toolsPath\*.exe
$packageArgs = @{
packageName = $packageName
fileType = 'EXE'
- file = "$toolsDir\units-2.22-setup.exe"
+ file = $file
validExitCodes = @(0)
silentArgs = '/VERYSILENT /NOCANCEL /CLOSEAPPLICATIONS /RESTART APPLICATIONS /NORESTART'
softwareName = 'units version 2.*'
diff --git a/automatic/gnu-units/tools/VERIFICATION.txt b/automatic/gnu-units/tools/VERIFICATION.txt
deleted file mode 100644
index 6902f47ee..000000000
--- a/automatic/gnu-units/tools/VERIFICATION.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-==================== GNU Units ====================
-
-This binary was directly downloaded and packaged up by bcurran3 from developer's site:
-
-"Windows Binary
-
-A binary distribution for Windows is available at http://ftp.gnu.org/gnu/units/windows/ (via HTTP) and ftp://ftp.gnu.org/gnu/units/windows (via FTP)."
-
-==================== GNU Units ====================
diff --git a/automatic/gnu-units/tools/units-2.22-setup.exe.sig b/automatic/gnu-units/tools/units-2.22-setup.exe.sig
deleted file mode 100644
index af2d20bc2..000000000
Binary files a/automatic/gnu-units/tools/units-2.22-setup.exe.sig and /dev/null differ
diff --git a/automatic/gnu-units/update.ps1 b/automatic/gnu-units/update.ps1
new file mode 100644
index 000000000..7e7b9e309
--- /dev/null
+++ b/automatic/gnu-units/update.ps1
@@ -0,0 +1,67 @@
+import-module au
+
+$releases = 'https://ftp.gnu.org/gnu/units/windows/'
+
+function global:au_SearchReplace {
+ @{
+ '.\legal\VERIFICATION.txt' = @{
+ "(?i)(\s+x32:).*" = "`${1} $($Latest.URL32)"
+ "(?i)(Get-RemoteChecksum).*" = "`${1} $($Latest.URL32)"
+ "(?i)(\s+checksum32:).*" = "`${1} $($Latest.Checksum32)"
+ }
+ }
+}
+
+function global:au_BeforeUpdate {
+ . ..\..\scripts\Get-FileVersion.ps1
+ $FileVersion = Get-FileVersion $Latest.URL32 -keep
+ Move-Item -Path $FileVersion.TempFile -Destination "tools\units-$($Latest.Version)-setup.exe"
+ $Latest.Checksum32 = $FileVersion.Checksum
+ $Latest.ChecksumType32 = $FileVersion.checksumType
+}
+
+function global:au_AfterUpdate($Package) {
+ Invoke-VirusTotalScan $Package
+}
+
+function global:au_GetLatest {
+ # URL of the GNU FTP directory
+ $url = "https://ftp.gnu.org/gnu/units/windows/"
+
+ # Fetch the HTML content from the page
+ $response = Invoke-WebRequest -Uri $url
+
+ # Extract all the file links from the page
+ $fileLinks = $response.Links | Where-Object { $_.href -match '\.exe$' }
+
+ # Define a regex pattern to extract the version numbers
+ $versionPattern = '(\d+\.\d+)'
+
+ # Initialize variables to store the highest version and its URL
+ $highestVersion = [Version]"0.0"
+ $highestVersionUrl = ""
+
+ # Iterate over each file link and compare versions
+ foreach ($link in $fileLinks) {
+ if ($link.href -match $versionPattern) {
+ $version = [Version]$matches[1]
+
+ # Compare the current version with the highest version found so far
+ if ($version -gt $highestVersion) {
+ $highestVersion = $version
+ $highestVersionUrl = $url + $link.href
+ }
+ }
+ }
+
+ # Output the URL of the file with the highest version
+ if ($highestVersionUrl) {
+ $url = $highestVersionUrl
+ $version = $highestVersion
+}
+
+ $Latest = @{ URL32 = $url; Version = $version }
+ return $Latest
+}
+
+update -NoCheckChocoVersion