<commit_before># TODO: This script should be replaced with wixproj and/or CPack.
# TODO: Add Debug mode to override CompressionLevel with "none".

# Sample command:
# .\build.ps1 -Arch x64 -Version 0.4.0 -PackagePath "c:\tmp\zeal-0.4.0-windows-x64" -SignMsi

param(
    [Parameter(Mandatory=$True)]
    [ValidatePattern("[0-9].[0-9].[0-9]")]
    [string]$Version,

    [Parameter(Mandatory=$True)]
    [ValidateSet('x86', 'x64')]
    [string]$Arch,

    [Parameter(Mandatory=$True)]
    [string]$PackagePath,

    [Switch]$SignMsi
)

$BaseFilename = "zeal-$Version-windows-$Arch"
$WixobjFilename = "$BaseFilename.wixobj"
$MsiFilename = "$BaseFilename.msi"
function CleanUp {
    Remove-Item -Path "$WixobjFilename"

    # We are not going to build patches for now.
    # More infor about wixpdb: https://www.firegiant.com/wix/tutorial/upgrades-and-modularization/patchwork/
    Remove-Item -Path "$BaseFilename.wixpdb"
}

Write-Output "Building $MsiFilename..."<commit_msg>windows-wix: Do not throw if cleanup in build.ps1 fails<commit_after># TODO: This script should be replaced with wixproj and/or CPack.
# TODO: Add Debug mode to override CompressionLevel with "none".

# Sample command:
# .\build.ps1 -Arch x64 -Version 0.4.0 -PackagePath "c:\tmp\zeal-0.4.0-windows-x64" -SignMsi

param(
    [Parameter(Mandatory=$True)]
    [ValidatePattern("[0-9].[0-9].[0-9]")]
    [string]$Version,

    [Parameter(Mandatory=$True)]
    [ValidateSet('x86', 'x64')]
    [string]$Arch,

    [Parameter(Mandatory=$True)]
    [string]$PackagePath,

    [Switch]$SignMsi
)

$BaseFilename = "zeal-$Version-windows-$Arch"
$WixobjFilename = "$BaseFilename.wixobj"
$MsiFilename = "$BaseFilename.msi"
function CleanUp {
    Remove-Item -ErrorAction Ignore -Path "$WixobjFilename"

    # We are not going to build patches for now.
    # More infor about wixpdb: https://www.firegiant.com/wix/tutorial/upgrades-and-modularization/patchwork/
    Remove-Item -ErrorAction Ignore "$BaseFilename.wixpdb"
}

Write-Output "Building $MsiFilename..."
{'fraction_non_alphanumeric': 0.152324431256182, 'fraction_numerical': 0.02126607319485658, 'mean_word_length': 4.0701754385964914, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2604313', 'n_tokens_mistral': 732, 'n_tokens_neox': 707, 'n_words': 154}