-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# URL of the file to download | ||
$url = "{{download_url}}" | ||
|
||
# Expected SHA256 hash of the file (replace with your actual hash) | ||
$expectedHash = "{{file_sha256}}" | ||
|
||
# Path where the downloaded file will be saved | ||
$outputFile = "C:\Windows\Temp\{{file_name}}" | ||
|
||
# Download the file | ||
Invoke-WebRequest -Uri $url -OutFile $outputFile | ||
|
||
# Calculate the actual SHA256 hash of the downloaded file | ||
$actualHash = Get-FileHash -Path $outputFile -Algorithm SHA256 | Select-Object -ExpandProperty Hash | ||
|
||
# Compare the actual and expected hashes | ||
if ($actualHash -eq $expectedHash) { | ||
Write-Output "Hashes match. Proceeding to execute the file." | ||
|
||
# Execute the downloaded file | ||
Start-Process -FilePath $outputFile -ArgumentList "/S" | ||
} else { | ||
Write-Output "Hashes do not match. The downloaded file may be corrupted or tampered with." | ||
# You can choose to delete the downloaded file in case of hash mismatch | ||
# Remove-Item -Path $outputFile | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# https://download.mozilla.org/?product=firefox-latest-ssl&os=osx&lang=en-US | ||
--- | ||
Description: Creates an installscript for the latest version of Firefox | ||
Identifier: com.github.jgstew.installscript.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/TemplateDictionaryAppend | ||
Arguments: | ||
dictionary_name: template_dictionary | ||
append_key: download_url | ||
append_value: "%download_url%" | ||
|
||
# create InstallFirefox.ps1 from template | ||
- Processor: com.github.jgstew.SharedProcessors/ContentFromTemplate | ||
Arguments: | ||
template_file_path: "./Mozilla/Firefox-Win.installscript.ps1" | ||
content_file_pathname: "%RECIPE_CACHE_DIR%/InstallFirefox.ps1" |