Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate the xml files without the byte order mark (BOM). #3233

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions scripts/xenadmin-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -298,19 +298,38 @@ $source_checksum | Out-File -LiteralPath "$OUTPUT_DIR\$appName-source.zip.checks

Write-Host "INFO: Calculated checksum source checksum: $source_checksum"

$xmlFormat='<?xml version="1.0" ?><patchdata><versions><version latest="true" latestcr="true" name="{0}" timestamp="{1}" url="{2}" checksum="{3}" value="{4}" /></versions></patchdata>'
$xmlFormat=@"
<?xml version="1.0" ?>
<patchdata>
<versions>
<version
latest="true"
latestcr="true"
name="{0}"
timestamp="{1}"
url="{2}"
checksum="{3}"
value="{4}"
/>
</versions>
</patchdata>
"@

$msi_url = $XC_UPDATES_URL -replace "XCUpdates.xml","$appName.msi"
$date=(Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
$productVersion = "$BRANDING_XC_PRODUCT_VERSION.$buildNumber"
$productFullName = "$appName $productVersion"
$productVersion = "$BRANDING_XC_PRODUCT_VERSION.$buildNumber"
$productFullName = "$appName $productVersion"

Write-Host "INFO: Generating XCUpdates.xml"
$prodXml = [string]::Format($xmlFormat, $productFullName, $date, $msi_url, $msi_checksum, $productVersion)
$testXml = [string]::Format($xmlFormat, $productFullName, $date, "@DEV_MSI_URL_PLACEHOLDER@", $msi_checksum, $productVersion)

[string]::Format($xmlFormat, $productFullName, $date, $msi_url, $msi_checksum, $productVersion) |`
Out-File -FilePath $OUTPUT_DIR\XCUpdates.xml -Encoding utf8
Write-Host $prodXml
Write-Host $testXml

Write-Host "INFO: Generating stage-test-XCUpdates.xml. URL is a placeholder value"
$bomLessEncoding = New-Object System.Text.UTF8Encoding $false

[string]::Format($xmlFormat, $productFullName, $date, "@DEV_MSI_URL_PLACEHOLDER@", $msi_checksum, $productVersion) |`
Out-File -FilePath $OUTPUT_DIR\stage-test-XCUpdates.xml -Encoding utf8
Write-Host "INFO: Generating XCUpdates.xml"
[System.IO.File]::WriteAllLines("$OUTPUT_DIR\XCUpdates.xml", $prodXml, $bomLessEncoding)

Write-Host "INFO: Generating stage-test-XCUpdates.xml. URL is a placeholder value"
[System.IO.File]::WriteAllLines("$OUTPUT_DIR\stage-test-XCUpdates.xml", $testXml, $bomLessEncoding)
Loading