Skip to content

Commit

Permalink
Try another approach, from Kevin
Browse files Browse the repository at this point in the history
  • Loading branch information
brunchboy committed Feb 17, 2024
1 parent 6aab375 commit 3ebe526
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions .github/scripts/build_msi.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,12 @@ copy ".\.github\resources\MSI Template.wxs" ".\"
& $Candle -dAppName=""$env:blt_name"" -dAppVersion=""$env:build_version"" -dAppVendor=""$env:blt_vendor"" -dAppUpgradeCode=""$env:blt_upgradecode"" -dAppDescription=""$env:blt_description"" -dAppVendorFolder=""$env:blt_vendor_folder"" -dAppIcon=""$env:blt_icon"" -nologo *.wxs -ext WixUIExtension -ext WixFirewallExtension -arch x64

#Compile MSI
Write-Output "Light Command: $Light -b Beat Link Trigger -nologo *.wixobj -out ""$env:artifact_name"" -ext WixUIExtension -ext WixFirewallExtension"

function Printable([string] $s) {
$Matcher =
{
param($m)

$x = $m.Groups[0].Value
$c = [int]($x.ToCharArray())[0]
switch ($c)
{
9 { '\t' }
13 { '\r' }
10 { '\n' }
92 { '\\' }
Default { "\$c" }
}
}
return ([regex]'[^ -~\\]').Replace($s, $Matcher)
Try {
& $Light -b "Beat Link Trigger" -nologo "*.wixobj" -out ""$env:artifact_name"" -ext WixUIExtension -ext WixFirewallExtension
}
Catch {
Write-Output "Light threw an error, will try something different"
& $Light -b "Beat Link Trigger" -nologo "*.wixobj" -out $env:artifact_name -ext WixUIExtension -ext WixFirewallExtension
}

$CurrentWorkingDir = (Get-Location).Path
$LightOutFile = $CurrentWorkingDir+"\"+$env:artifact_name
Write-Output (Printable $LightOutFile)
Write-Output "Compile MSI: -out $LightOutFile"
& $Light -b "Beat Link Trigger" -nologo "*.wixobj" -out ""$LightOutFile"" -ext WixUIExtension -ext WixFirewallExtension

0 comments on commit 3ebe526

Please sign in to comment.