build/windows: Make MSIX script less confusing in some sections

This commit is contained in:
Bruno 2024-09-11 07:36:36 -03:00
parent 165f616fb7
commit de529a940a
1 changed files with 14 additions and 12 deletions

View File

@ -97,10 +97,6 @@ Write-Output "(INFO): Identity: $IDENTITY_NAME | Version: $CUSTOM_GIMP_VERSION (
# Autodetects what arch bundles will be packaged
if (-not (Test-Path .gitignore.bak -Type Leaf))
{
Copy-Item .gitignore .gitignore.bak
}
if (-not (Test-Path "$a64_bundle") -and -not (Test-Path "$x64_bundle"))
{
Write-Host "(ERROR): No bundle found. You can run 'build/windows/2_build-gimp-msys2.sh --relocatable' on some MSYS2 shell to make one." -ForegroundColor red
@ -119,7 +115,13 @@ foreach ($bundle in $supported_archs)
{
$msix_arch = 'x64'
}
Write-Output "(INFO): Arch: $msix_arch"
## Prevent Git going crazy
if (-not (Test-Path .gitignore.bak -Type Leaf))
{
Copy-Item .gitignore .gitignore.bak
}
$ig_content = "`n$msix_arch`n*.appxsym`n*.zip"
if (Test-Path .gitignore -Type Leaf)
{
@ -131,7 +133,7 @@ foreach ($bundle in $supported_archs)
Set-Content .gitignore "$ig_content"
}
Write-Output "(INFO): Arch: $msix_arch"
## Create temporary dir
if (Test-Path $msix_arch)
{
Remove-Item $msix_arch/ -Recurse
@ -143,6 +145,10 @@ foreach ($bundle in $supported_archs)
Write-Output "(INFO): configuring AppxManifest.xml for $msix_arch"
Copy-Item build\windows\store\AppxManifest.xml $msix_arch
## Set msix_arch
(Get-Content $msix_arch\AppxManifest.xml) | Foreach-Object {$_ -replace "neutral","$msix_arch"} |
Set-Content $msix_arch\AppxManifest.xml
## Set Identity Name
(Get-Content $msix_arch\AppxManifest.xml) | Foreach-Object {$_ -replace "@IDENTITY_NAME@","$IDENTITY_NAME"} |
Set-Content $msix_arch\AppxManifest.xml
@ -167,10 +173,6 @@ foreach ($bundle in $supported_archs)
(Get-Content $msix_arch\AppxManifest.xml) | Foreach-Object {$_ -replace "@GIMP_APP_VERSION@","$GIMP_APP_VERSION"} |
Set-Content $msix_arch\AppxManifest.xml
## Set msix_arch
(Get-Content $msix_arch\AppxManifest.xml) | Foreach-Object {$_ -replace "neutral","$msix_arch"} |
Set-Content $msix_arch\AppxManifest.xml
## Match supported filetypes
$file_types = Get-Content 'build\windows\installer\data_associations.list' | Foreach-Object {" <uap:FileType>." + $_} |
Foreach-Object {$_ + "</uap:FileType>"} | Where-Object {$_ -notmatch 'xcf'}
@ -206,9 +208,6 @@ foreach ($bundle in $supported_archs)
## Copy files into VFS folder (to support external 3P plug-ins)
Copy-Item "$bundle" "$vfs" -Recurse -Force
## Remove uneeded files (to match the Inno Windows Installer artifact)
Get-ChildItem "$vfs" -Recurse -Include (".gitignore", "gimp.cmd") | Remove-Item -Recurse
## Set revision (on GIMP about dialog)
(Get-Content "$vfs\share\gimp\*\gimp-release") | Foreach-Object {$_ -replace "revision=0","revision=$revision"} |
Set-Content "$vfs\share\gimp\*\gimp-release"
@ -219,6 +218,9 @@ foreach ($bundle in $supported_archs)
Add-Content "$vfs\share\gimp\*\gimp-release" 'check-update=false'
}
## Remove uneeded files (to match the Inno Windows Installer artifact)
Get-ChildItem "$vfs" -Recurse -Include (".gitignore", "gimp.cmd") | Remove-Item -Recurse
## Remove uncompliant files (to avoid WACK/'signtool' issues)
Get-ChildItem "$vfs" -Recurse -Include ("*.debug", "*.tar") | Remove-Item -Recurse