Skip to content

Commit 72c05bf

Browse files
committed
Replace CertUtil with 7za.exe for file hashing
1 parent e179d42 commit 72c05bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/buildactions/utils.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function os.sha256_file(path)
9696
local windows = os.host() == "windows"
9797
local s, errc
9898
if windows then
99-
s, errc = os.outputof(string.format("CertUtil -hashfile \"%s\" SHA256", path))
99+
s, errc = os.outputof(string.format("utils\\7z\\7za.exe h -scrcSHA256 \"%s\"", path))
100100
else
101101
s, errc = os.outputof(string.format("sha256sum \"%s\" | awk '{ print $1 }'", path))
102102
end
@@ -109,7 +109,7 @@ function os.sha256_file(path)
109109

110110
-- Clean windows output
111111
if windows then
112-
s = (s:match("\n(.*)\n(.*)") or ""):gsub(" ", "")
112+
s = (s:match("SHA256 for data: +([^\n]*)") or "")
113113
end
114114

115115
return s:lower()

0 commit comments

Comments
 (0)