@@ -9,7 +9,7 @@ Write-Host "Building Polygon version $versionNumber" -ForegroundColor Green;
9
9
10
10
# Clean build folder
11
11
Remove-Item - Path " $cwd \build" - Recurse - Force - ErrorAction SilentlyContinue;
12
- New-Item - Path " $cwd \build" - ItemType Directory;
12
+ New-Item - Path " $cwd \build" - ItemType Directory - Force | Out-Null ;
13
13
14
14
# Download AutoHotkey
15
15
$ahkFileNamePattern = " AutoHotkey_.*\.zip"
@@ -55,17 +55,32 @@ Expand-Archive -Path "$cwd\build\$wixFileNamePattern" -DestinationPath "$cwd\bui
55
55
Write-Host " Downloaded the latest release from Wix3 into `" $cwd \build\wix\`" " - ForegroundColor Green;
56
56
57
57
# Build polygon executables
58
- & " $cwd \build\ahk\Ahk2Exe.exe" / in polygon.ahk / out " $cwd \build\polygon-x64 .exe" / compress 2 / icon logo.ico / base " $cwd \build\ahk\AutoHotkey64 .exe" ;
59
- & " $cwd \build\ahk\Ahk2Exe.exe" / in polygon.ahk / out " $cwd \build\polygon-x86 .exe" / compress 2 / icon logo.ico / base " $cwd \build\ahk\AutoHotkey32 .exe" ;
58
+ Start-Process - FilePath " $cwd \build\ahk\Ahk2Exe.exe" - NoNewWindow - Wait - ArgumentList " /in polygon.ahk /out "" $cwd \build\polygon-x86 .exe"" /compress 2 /icon logo.ico /base "" $cwd \build\ahk\AutoHotkey32 .exe"" "
59
+ Start-Process - FilePath " $cwd \build\ahk\Ahk2Exe.exe" - NoNewWindow - Wait - ArgumentList " /in polygon.ahk /out "" $cwd \build\polygon-x64 .exe"" /compress 2 /icon logo.ico /base "" $cwd \build\ahk\AutoHotkey64 .exe"" " ;
60
60
61
61
Write-Host " Polygon binaries built successfully into `" $cwd \build\`" " - ForegroundColor Green;
62
62
63
+ # Generate checksums
64
+ $checksumFile = " $cwd \build\polygon-checksum.txt" ;
65
+ $hash_x86 = Get-FileHash - Path " $cwd \build\polygon-x86.exe" - Algorithm SHA256;
66
+ $hash_x64 = Get-FileHash - Path " $cwd \build\polygon-x64.exe" - Algorithm SHA256;
67
+ " polygon-x86.exe: $ ( $hash_x86.Hash ) " .ToLower() | Out-File - Append - FilePath $checksumFile ;
68
+ " polygon-x64.exe: $ ( $hash_x64.Hash ) " .ToLower() | Out-File - Append - FilePath $checksumFile ;
69
+
70
+ Write-Host " Polygon binary checksums calculated successfully into `" $cwd \build\`" " - ForegroundColor Green;
71
+
72
+ # Create Polygon archives
73
+ Compress-Archive - Path " $cwd \polygon.ini" , " $cwd \build\polygon-x86.exe" - DestinationPath " $cwd \build\polygon-x86.zip" ;
74
+ Compress-Archive - Path " $cwd \polygon.ini" , " $cwd \build\polygon-x64.exe" - DestinationPath " $cwd \build\polygon-x64.zip" ;
75
+
76
+ Write-Host " Polygon archives successfully generated into `" $cwd \build\`" " - ForegroundColor Green;
77
+
63
78
# Build polygon installer object file
64
- & " $cwd \build\wix\candle.exe" .\polygon.wxs - out " $cwd \build\polygon-x86.wixobj" - dVersion= " $versionNumber " - arch x86;
65
- & " $cwd \build\wix\candle.exe" .\polygon.wxs - out " $cwd \build\polygon-x64.wixobj" - dVersion= " $versionNumber " - arch x64;
79
+ Start-Process - FilePath " $cwd \build\wix\candle.exe" - NoNewWindow - Wait - ArgumentList " .\polygon.wxs -out "" $cwd \build\polygon-x86.wixobj"" -dVersion="" $versionNumber "" -arch x86" ;
80
+ Start-Process - FilePath " $cwd \build\wix\candle.exe" - NoNewWindow - Wait - ArgumentList " .\polygon.wxs -out "" $cwd \build\polygon-x64.wixobj"" -dVersion="" $versionNumber "" -arch x64" ;
66
81
67
82
# Build polygon installer MSI
68
- & " $cwd \build\wix\light.exe" " $cwd \build\polygon-x86.wixobj" - ext WixUIExtension - out " $cwd \build\polygon-x86.msi" ;
69
- & " $cwd \build\wix\light.exe" " $cwd \build\polygon-x64.wixobj" - ext WixUIExtension - out " $cwd \build\polygon-x64.msi" ;
83
+ Start-Process - FilePath " $cwd \build\wix\light.exe" - NoNewWindow - Wait - ArgumentList " "" $cwd \build\polygon-x86.wixobj"" -ext WixUIExtension -out "" $cwd \build\polygon-x86.msi"" " ;
84
+ Start-Process - FilePath " $cwd \build\wix\light.exe" - NoNewWindow - Wait - ArgumentList " "" $cwd \build\polygon-x64.wixobj"" -ext WixUIExtension -out "" $cwd \build\polygon-x64.msi"" " ;
70
85
71
86
Write-Host " Polygon installers built successfully into `" $cwd \build\`" " - ForegroundColor Green;
0 commit comments