File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,23 @@ function Invoke-Checked {
1818 }
1919}
2020
21+ function Get-Sha256Hex {
22+ param (
23+ [Parameter (Mandatory = $true )][string ]$Path
24+ )
25+
26+ $Stream = [System.IO.File ]::OpenRead($Path )
27+ $Algorithm = [System.Security.Cryptography.SHA256 ]::Create()
28+ try {
29+ $Bytes = $Algorithm.ComputeHash ($Stream )
30+ return ([System.BitConverter ]::ToString($Bytes ) -replace " -" , " " ).ToLowerInvariant()
31+ }
32+ finally {
33+ $Algorithm.Dispose ()
34+ $Stream.Dispose ()
35+ }
36+ }
37+
2138$Package = Get-Content (Join-Path $Root " package.json" ) - Raw | ConvertFrom-Json
2239$Version = [string ]$Package.version
2340$Tauri = Get-Content (Join-Path $Root " src-tauri\tauri.conf.json" ) - Raw | ConvertFrom-Json
@@ -64,8 +81,7 @@ Remove-Item $PortableStage -Recurse -Force
6481
6582$ChecksumPath = Join-Path $Output " SHA256SUMS.txt"
6683$Checksums = @ ($InstallerPath , $PortablePath ) | ForEach-Object {
67- $Hash = Get-FileHash $_ - Algorithm SHA256
68- " $ ( $Hash.Hash.ToLowerInvariant ()) *$ ( [System.IO.Path ]::GetFileName($_ )) "
84+ " $ ( Get-Sha256Hex $_ ) *$ ( [System.IO.Path ]::GetFileName($_ )) "
6985}
7086$Checksums | Set-Content $ChecksumPath - Encoding ascii
7187
You can’t perform that action at this time.
0 commit comments