@@ -29,6 +29,22 @@ Expand-Archive -Path "$cwd\build\Ahk2exe.zip" -DestinationPath "$cwd\build\ahk";
29
29
30
30
Write-Host " Downloaded the latest release from Ahk2Exe into `" $cwd \build\ahk\`" " - ForegroundColor Green;
31
31
32
+ # Download upx
33
+ $upxFileNamePattern = " upx-.*\-win64.zip"
34
+ $upxLatestRelease = Invoke-RestMethod - Uri " https://api.github.com/repos/upx/upx/releases/latest" ;
35
+ $upxDownloadURL = ($upxLatestRelease.assets | Where-Object { $_.name -match " $upxFileNamePattern " }) | Select-Object - ExpandProperty browser_download_url
36
+ Invoke-WebRequest - Uri $upxDownloadURL - OutFile " $cwd \build\upx.zip" ;
37
+ Expand-Archive - Path " $cwd \build\upx.zip" - DestinationPath " $cwd \build\upx" - Force;
38
+ $sourceFolders = Get-ChildItem - Path " $cwd \build\upx\" - Directory - Filter " upx-*" ;
39
+ foreach ($folder in $sourceFolders ) {
40
+ $exeFiles = Get-ChildItem - Path $folder.FullName - Filter " *.exe" ;
41
+ foreach ($file in $exeFiles ) {
42
+ Move-Item - Path $file.FullName - Destination " $cwd \build\ahk\" - Force;
43
+ }
44
+ }
45
+
46
+ Write-Host " Downloaded the latest release from upx into `" $cwd \build\upx\`" " - ForegroundColor Green;
47
+
32
48
# Download Wix3
33
49
$wixFileNamePattern = " wix311-binaries.zip"
34
50
$wixLatestRelease = Invoke-RestMethod - Uri " https://api.github.com/repos/wixtoolset/wix3/releases/latest" ;
@@ -38,14 +54,17 @@ Expand-Archive -Path "$cwd\build\$wixFileNamePattern" -DestinationPath "$cwd\bui
38
54
39
55
Write-Host " Downloaded the latest release from Wix3 into `" $cwd \build\wix\`" " - ForegroundColor Green;
40
56
41
- & " $cwd \build\ahk\Ahk2Exe.exe" / in polygon.ahk / out " $cwd \build\polygon-x64.exe" / icon logo.ico / base " $cwd \build\ahk\AutoHotkey64.exe" ;
42
- & " $cwd \build\ahk\Ahk2Exe.exe" / in polygon.ahk / out " $cwd \build\polygon-x86.exe" / icon logo.ico / base " $cwd \build\ahk\AutoHotkey32.exe" ;
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" ;
43
60
44
61
Write-Host " Polygon binaries built successfully into `" $cwd \build\`" " - ForegroundColor Green;
45
62
63
+ # Build polygon installer object file
46
64
& " $cwd \build\wix\candle.exe" .\polygon.wxs - out " $cwd \build\polygon-x86.wixobj" - dVersion= " $versionNumber " - arch x86;
47
65
& " $cwd \build\wix\candle.exe" .\polygon.wxs - out " $cwd \build\polygon-x64.wixobj" - dVersion= " $versionNumber " - arch x64;
48
66
67
+ # Build polygon installer MSI
49
68
& " $cwd \build\wix\light.exe" " $cwd \build\polygon-x86.wixobj" - ext WixUIExtension - out " $cwd \build\polygon-x86.msi" ;
50
69
& " $cwd \build\wix\light.exe" " $cwd \build\polygon-x64.wixobj" - ext WixUIExtension - out " $cwd \build\polygon-x64.msi" ;
51
70
0 commit comments