2023-04-20 07:47:05 -05:00
|
|
|
[CmdletBinding(DefaultParameterSetName = 'AppX')]
|
Add support for an unpackaged distribution of Terminal (#15034)
Since the removal of the Win10-specific variant of the Terminal MSIX in
#15031, there has been no officially-sanctioned (or even unofficially
tested!) way to get an unzippable double-click-runnable version of
Windows Terminal.
Due to a quirk in the resource loading system, an unpackaged
distribution of Terminal needs to ship all of XAML's resources and all
of is own resources in a single `resources.pri` file. The tooling to
support this is minimal, and we were previously just coasting by on
Visual Studio's generosity plus how the prerelease distribution of XAML
embedded itself into the consuming package.
This pull request introduces a build phase plus a supporting script (or
three) that produces a ZIP file distribution of Windows Terminal when
given a Terminal MSIX and an XAML AppX.
The three scripts are:
1. A script to merge any number of PRI files and/or PRI dump files (made
with `makepri dump /dt detailed`)
2. A script that specifically merges XAML's resources with Terminal's.
This is necessary because the XAML package emits a couple PRI
resources into Terminal's resources _even when it is not
co-packaged._ We need to remove the conflicting resources.
3. Finally, a script to take a WT and XAML distribution and combine them
-- resources, files, everything -- and strip out the things that we
don't need. This script is an all-in-one that calls the other two and
produces a ZIP file at the end.
The final distribution is named after the PFN
(`Microsoft.WindowsTerminal`, or `...Preview` or `WindowsTerminalDev`),
the version number and the architecture. When expanded, it produces a
directory named `terminal-X.Y.Z.A` (version number.)
I've also added the build script to the release pipeline.
As a treat, this also produces an unpackaged distribution out of every
CI build... that way, contributors can download live deployable copies
of WT Unpackaged to test out their changes. Pretty cool.
Refs #1386
2023-03-30 16:38:10 -05:00
|
|
|
Param(
|
2023-04-20 07:47:05 -05:00
|
|
|
[Parameter(Mandatory, HelpMessage="Path to Terminal AppX", ParameterSetName = 'AppX')]
|
Add support for an unpackaged distribution of Terminal (#15034)
Since the removal of the Win10-specific variant of the Terminal MSIX in
#15031, there has been no officially-sanctioned (or even unofficially
tested!) way to get an unzippable double-click-runnable version of
Windows Terminal.
Due to a quirk in the resource loading system, an unpackaged
distribution of Terminal needs to ship all of XAML's resources and all
of is own resources in a single `resources.pri` file. The tooling to
support this is minimal, and we were previously just coasting by on
Visual Studio's generosity plus how the prerelease distribution of XAML
embedded itself into the consuming package.
This pull request introduces a build phase plus a supporting script (or
three) that produces a ZIP file distribution of Windows Terminal when
given a Terminal MSIX and an XAML AppX.
The three scripts are:
1. A script to merge any number of PRI files and/or PRI dump files (made
with `makepri dump /dt detailed`)
2. A script that specifically merges XAML's resources with Terminal's.
This is necessary because the XAML package emits a couple PRI
resources into Terminal's resources _even when it is not
co-packaged._ We need to remove the conflicting resources.
3. Finally, a script to take a WT and XAML distribution and combine them
-- resources, files, everything -- and strip out the things that we
don't need. This script is an all-in-one that calls the other two and
produces a ZIP file at the end.
The final distribution is named after the PFN
(`Microsoft.WindowsTerminal`, or `...Preview` or `WindowsTerminalDev`),
the version number and the architecture. When expanded, it produces a
directory named `terminal-X.Y.Z.A` (version number.)
I've also added the build script to the release pipeline.
As a treat, this also produces an unpackaged distribution out of every
CI build... that way, contributors can download live deployable copies
of WT Unpackaged to test out their changes. Pretty cool.
Refs #1386
2023-03-30 16:38:10 -05:00
|
|
|
[ValidateScript({Test-Path $_ -Type Leaf})]
|
|
|
|
|
[string]
|
|
|
|
|
$TerminalAppX,
|
|
|
|
|
|
2023-04-20 07:47:05 -05:00
|
|
|
[Parameter(Mandatory, HelpMessage="Path to Terminal Layout Deployment", ParameterSetName='Layout')]
|
|
|
|
|
[ValidateScript({Test-Path $_ -Type Container})]
|
|
|
|
|
[string]
|
|
|
|
|
$TerminalLayout,
|
|
|
|
|
|
|
|
|
|
[Parameter(Mandatory, HelpMessage="Path to Xaml AppX", ParameterSetName='AppX')]
|
|
|
|
|
[Parameter(Mandatory, HelpMessage="Path to Xaml AppX", ParameterSetName='Layout')]
|
Add support for an unpackaged distribution of Terminal (#15034)
Since the removal of the Win10-specific variant of the Terminal MSIX in
#15031, there has been no officially-sanctioned (or even unofficially
tested!) way to get an unzippable double-click-runnable version of
Windows Terminal.
Due to a quirk in the resource loading system, an unpackaged
distribution of Terminal needs to ship all of XAML's resources and all
of is own resources in a single `resources.pri` file. The tooling to
support this is minimal, and we were previously just coasting by on
Visual Studio's generosity plus how the prerelease distribution of XAML
embedded itself into the consuming package.
This pull request introduces a build phase plus a supporting script (or
three) that produces a ZIP file distribution of Windows Terminal when
given a Terminal MSIX and an XAML AppX.
The three scripts are:
1. A script to merge any number of PRI files and/or PRI dump files (made
with `makepri dump /dt detailed`)
2. A script that specifically merges XAML's resources with Terminal's.
This is necessary because the XAML package emits a couple PRI
resources into Terminal's resources _even when it is not
co-packaged._ We need to remove the conflicting resources.
3. Finally, a script to take a WT and XAML distribution and combine them
-- resources, files, everything -- and strip out the things that we
don't need. This script is an all-in-one that calls the other two and
produces a ZIP file at the end.
The final distribution is named after the PFN
(`Microsoft.WindowsTerminal`, or `...Preview` or `WindowsTerminalDev`),
the version number and the architecture. When expanded, it produces a
directory named `terminal-X.Y.Z.A` (version number.)
I've also added the build script to the release pipeline.
As a treat, this also produces an unpackaged distribution out of every
CI build... that way, contributors can download live deployable copies
of WT Unpackaged to test out their changes. Pretty cool.
Refs #1386
2023-03-30 16:38:10 -05:00
|
|
|
[ValidateScript({Test-Path $_ -Type Leaf})]
|
|
|
|
|
[string]
|
|
|
|
|
$XamlAppX,
|
|
|
|
|
|
2023-04-20 07:47:05 -05:00
|
|
|
[Parameter(HelpMessage="Output Directory", ParameterSetName='AppX')]
|
|
|
|
|
[Parameter(HelpMessage="Output Directory", ParameterSetName='Layout')]
|
Add support for an unpackaged distribution of Terminal (#15034)
Since the removal of the Win10-specific variant of the Terminal MSIX in
#15031, there has been no officially-sanctioned (or even unofficially
tested!) way to get an unzippable double-click-runnable version of
Windows Terminal.
Due to a quirk in the resource loading system, an unpackaged
distribution of Terminal needs to ship all of XAML's resources and all
of is own resources in a single `resources.pri` file. The tooling to
support this is minimal, and we were previously just coasting by on
Visual Studio's generosity plus how the prerelease distribution of XAML
embedded itself into the consuming package.
This pull request introduces a build phase plus a supporting script (or
three) that produces a ZIP file distribution of Windows Terminal when
given a Terminal MSIX and an XAML AppX.
The three scripts are:
1. A script to merge any number of PRI files and/or PRI dump files (made
with `makepri dump /dt detailed`)
2. A script that specifically merges XAML's resources with Terminal's.
This is necessary because the XAML package emits a couple PRI
resources into Terminal's resources _even when it is not
co-packaged._ We need to remove the conflicting resources.
3. Finally, a script to take a WT and XAML distribution and combine them
-- resources, files, everything -- and strip out the things that we
don't need. This script is an all-in-one that calls the other two and
produces a ZIP file at the end.
The final distribution is named after the PFN
(`Microsoft.WindowsTerminal`, or `...Preview` or `WindowsTerminalDev`),
the version number and the architecture. When expanded, it produces a
directory named `terminal-X.Y.Z.A` (version number.)
I've also added the build script to the release pipeline.
As a treat, this also produces an unpackaged distribution out of every
CI build... that way, contributors can download live deployable copies
of WT Unpackaged to test out their changes. Pretty cool.
Refs #1386
2023-03-30 16:38:10 -05:00
|
|
|
[string]
|
|
|
|
|
$Destination = ".",
|
|
|
|
|
|
2023-04-20 07:47:05 -05:00
|
|
|
[Parameter(HelpMessage="Path to makeappx.exe", ParameterSetName='AppX')]
|
|
|
|
|
[Parameter(HelpMessage="Path to makeappx.exe", ParameterSetName='Layout')]
|
Add support for an unpackaged distribution of Terminal (#15034)
Since the removal of the Win10-specific variant of the Terminal MSIX in
#15031, there has been no officially-sanctioned (or even unofficially
tested!) way to get an unzippable double-click-runnable version of
Windows Terminal.
Due to a quirk in the resource loading system, an unpackaged
distribution of Terminal needs to ship all of XAML's resources and all
of is own resources in a single `resources.pri` file. The tooling to
support this is minimal, and we were previously just coasting by on
Visual Studio's generosity plus how the prerelease distribution of XAML
embedded itself into the consuming package.
This pull request introduces a build phase plus a supporting script (or
three) that produces a ZIP file distribution of Windows Terminal when
given a Terminal MSIX and an XAML AppX.
The three scripts are:
1. A script to merge any number of PRI files and/or PRI dump files (made
with `makepri dump /dt detailed`)
2. A script that specifically merges XAML's resources with Terminal's.
This is necessary because the XAML package emits a couple PRI
resources into Terminal's resources _even when it is not
co-packaged._ We need to remove the conflicting resources.
3. Finally, a script to take a WT and XAML distribution and combine them
-- resources, files, everything -- and strip out the things that we
don't need. This script is an all-in-one that calls the other two and
produces a ZIP file at the end.
The final distribution is named after the PFN
(`Microsoft.WindowsTerminal`, or `...Preview` or `WindowsTerminalDev`),
the version number and the architecture. When expanded, it produces a
directory named `terminal-X.Y.Z.A` (version number.)
I've also added the build script to the release pipeline.
As a treat, this also produces an unpackaged distribution out of every
CI build... that way, contributors can download live deployable copies
of WT Unpackaged to test out their changes. Pretty cool.
Refs #1386
2023-03-30 16:38:10 -05:00
|
|
|
[ValidateScript({Test-Path $_ -Type Leaf})]
|
|
|
|
|
[string]
|
2026-06-10 17:43:30 -05:00
|
|
|
$MakeAppxPath = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\MakeAppx.exe",
|
2023-09-28 13:25:26 -05:00
|
|
|
|
|
|
|
|
[Parameter(HelpMessage="Include the portable mode marker file by default", ParameterSetName='AppX')]
|
|
|
|
|
[Parameter(HelpMessage="Include the portable mode marker file by default", ParameterSetName='Layout')]
|
|
|
|
|
[switch]
|
|
|
|
|
$PortableMode = $PSCmdlet.ParameterSetName -eq 'Layout'
|
Add support for an unpackaged distribution of Terminal (#15034)
Since the removal of the Win10-specific variant of the Terminal MSIX in
#15031, there has been no officially-sanctioned (or even unofficially
tested!) way to get an unzippable double-click-runnable version of
Windows Terminal.
Due to a quirk in the resource loading system, an unpackaged
distribution of Terminal needs to ship all of XAML's resources and all
of is own resources in a single `resources.pri` file. The tooling to
support this is minimal, and we were previously just coasting by on
Visual Studio's generosity plus how the prerelease distribution of XAML
embedded itself into the consuming package.
This pull request introduces a build phase plus a supporting script (or
three) that produces a ZIP file distribution of Windows Terminal when
given a Terminal MSIX and an XAML AppX.
The three scripts are:
1. A script to merge any number of PRI files and/or PRI dump files (made
with `makepri dump /dt detailed`)
2. A script that specifically merges XAML's resources with Terminal's.
This is necessary because the XAML package emits a couple PRI
resources into Terminal's resources _even when it is not
co-packaged._ We need to remove the conflicting resources.
3. Finally, a script to take a WT and XAML distribution and combine them
-- resources, files, everything -- and strip out the things that we
don't need. This script is an all-in-one that calls the other two and
produces a ZIP file at the end.
The final distribution is named after the PFN
(`Microsoft.WindowsTerminal`, or `...Preview` or `WindowsTerminalDev`),
the version number and the architecture. When expanded, it produces a
directory named `terminal-X.Y.Z.A` (version number.)
I've also added the build script to the release pipeline.
As a treat, this also produces an unpackaged distribution out of every
CI build... that way, contributors can download live deployable copies
of WT Unpackaged to test out their changes. Pretty cool.
Refs #1386
2023-03-30 16:38:10 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
$filesToRemove = @("*.xml", "*.winmd", "Appx*", "Images/*Tile*", "Images/*Logo*") # Remove from Terminal
|
Remove Monarch/Peasant & Make UI single-threaded (#18215)
As before, a minor refactor:
* I started off by removing the Monarch/Peasant with the goal of moving
it into and deduplicating its functionality with `WindowEmperor`.
* Since I needed a replacement for the Monarch (= ensures that there's
a single instance), I wrote single-instance code with a NT mutex
and by yeeting data across processes with `WM_COPYDATA`.
* This resulted in severe threading issues, because it now started up
way faster. The more I tried to solve them the deeper I had to dig,
because you can't just put a mutex around `CascadiaSettings`.
I then tried to seeif WinUI can run multiple windows on a single
thread and, as it turns out, it can.
So, I removed the multi- from the window threading.
* At this point I had dig about 1 mile deep and brought no ladder.
So, to finish it up, I had to clean up the entire eventing system
around `WindowEmperor`, cleaned up all the coroutines,
and cleaned up all the callbacks.
Closes #16183
Closes #16221
Closes #16487
Closes #16532
Closes #16733
Closes #16755
Closes #17015
Closes #17360
Closes #17420
Closes #17457
Closes #17799
Closes #17976
Closes #18057
Closes #18084
Closes #18169
Closes #18176
Closes #18191
## Validation Steps Performed
* It does not crash ✅
* New/close tab ✅
* New/close window ✅
* Move tabs between windows ✅
* Split tab into new window ✅
* Persist windows on exit / restore startup ✅
2024-12-12 13:21:24 -08:00
|
|
|
$filesToKeep = @() # ... except for these
|
Add support for an unpackaged distribution of Terminal (#15034)
Since the removal of the Win10-specific variant of the Terminal MSIX in
#15031, there has been no officially-sanctioned (or even unofficially
tested!) way to get an unzippable double-click-runnable version of
Windows Terminal.
Due to a quirk in the resource loading system, an unpackaged
distribution of Terminal needs to ship all of XAML's resources and all
of is own resources in a single `resources.pri` file. The tooling to
support this is minimal, and we were previously just coasting by on
Visual Studio's generosity plus how the prerelease distribution of XAML
embedded itself into the consuming package.
This pull request introduces a build phase plus a supporting script (or
three) that produces a ZIP file distribution of Windows Terminal when
given a Terminal MSIX and an XAML AppX.
The three scripts are:
1. A script to merge any number of PRI files and/or PRI dump files (made
with `makepri dump /dt detailed`)
2. A script that specifically merges XAML's resources with Terminal's.
This is necessary because the XAML package emits a couple PRI
resources into Terminal's resources _even when it is not
co-packaged._ We need to remove the conflicting resources.
3. Finally, a script to take a WT and XAML distribution and combine them
-- resources, files, everything -- and strip out the things that we
don't need. This script is an all-in-one that calls the other two and
produces a ZIP file at the end.
The final distribution is named after the PFN
(`Microsoft.WindowsTerminal`, or `...Preview` or `WindowsTerminalDev`),
the version number and the architecture. When expanded, it produces a
directory named `terminal-X.Y.Z.A` (version number.)
I've also added the build script to the release pipeline.
As a treat, this also produces an unpackaged distribution out of every
CI build... that way, contributors can download live deployable copies
of WT Unpackaged to test out their changes. Pretty cool.
Refs #1386
2023-03-30 16:38:10 -05:00
|
|
|
$filesToCopyFromXaml = @("Microsoft.UI.Xaml.dll", "Microsoft.UI.Xaml") # We don't need the .winmd
|
|
|
|
|
|
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
|
|
|
|
|
|
If ($null -Eq (Get-Item $MakeAppxPath -EA:SilentlyContinue)) {
|
|
|
|
|
Write-Error "Could not find MakeAppx.exe at `"$MakeAppxPath`".`nMake sure that -MakeAppxPath points to a valid SDK."
|
|
|
|
|
Exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$tempDir = Join-Path ([System.IO.Path]::GetTempPath()) "tmp$([Convert]::ToString((Get-Random 65535),16).PadLeft(4,'0')).tmp"
|
|
|
|
|
New-Item -ItemType Directory -Path $tempDir | Out-Null
|
|
|
|
|
|
|
|
|
|
$XamlAppX = Get-Item $XamlAppX | Select-Object -Expand FullName
|
|
|
|
|
|
|
|
|
|
########
|
|
|
|
|
# Reading the AppX Manifest for preliminary info
|
|
|
|
|
########
|
|
|
|
|
|
2023-04-20 07:47:05 -05:00
|
|
|
If ($TerminalAppX) {
|
|
|
|
|
$appxManifestPath = Join-Path $tempDir AppxManifest.xml
|
|
|
|
|
& tar.exe -x -f "$TerminalAppX" -C $tempDir AppxManifest.xml
|
|
|
|
|
} ElseIf($TerminalLayout) {
|
|
|
|
|
$appxManifestPath = Join-Path $TerminalLayout AppxManifest.xml
|
|
|
|
|
}
|
Add support for an unpackaged distribution of Terminal (#15034)
Since the removal of the Win10-specific variant of the Terminal MSIX in
#15031, there has been no officially-sanctioned (or even unofficially
tested!) way to get an unzippable double-click-runnable version of
Windows Terminal.
Due to a quirk in the resource loading system, an unpackaged
distribution of Terminal needs to ship all of XAML's resources and all
of is own resources in a single `resources.pri` file. The tooling to
support this is minimal, and we were previously just coasting by on
Visual Studio's generosity plus how the prerelease distribution of XAML
embedded itself into the consuming package.
This pull request introduces a build phase plus a supporting script (or
three) that produces a ZIP file distribution of Windows Terminal when
given a Terminal MSIX and an XAML AppX.
The three scripts are:
1. A script to merge any number of PRI files and/or PRI dump files (made
with `makepri dump /dt detailed`)
2. A script that specifically merges XAML's resources with Terminal's.
This is necessary because the XAML package emits a couple PRI
resources into Terminal's resources _even when it is not
co-packaged._ We need to remove the conflicting resources.
3. Finally, a script to take a WT and XAML distribution and combine them
-- resources, files, everything -- and strip out the things that we
don't need. This script is an all-in-one that calls the other two and
produces a ZIP file at the end.
The final distribution is named after the PFN
(`Microsoft.WindowsTerminal`, or `...Preview` or `WindowsTerminalDev`),
the version number and the architecture. When expanded, it produces a
directory named `terminal-X.Y.Z.A` (version number.)
I've also added the build script to the release pipeline.
As a treat, this also produces an unpackaged distribution out of every
CI build... that way, contributors can download live deployable copies
of WT Unpackaged to test out their changes. Pretty cool.
Refs #1386
2023-03-30 16:38:10 -05:00
|
|
|
$manifest = [xml](Get-Content $appxManifestPath)
|
|
|
|
|
$pfn = $manifest.Package.Identity.Name
|
|
|
|
|
$version = $manifest.Package.Identity.Version
|
|
|
|
|
$architecture = $manifest.Package.Identity.ProcessorArchitecture
|
|
|
|
|
|
|
|
|
|
$distributionName = "{0}_{1}_{2}" -f ($pfn, $version, $architecture)
|
|
|
|
|
$terminalDir = "terminal-{0}" -f ($version)
|
|
|
|
|
|
|
|
|
|
########
|
|
|
|
|
# Unpacking Terminal and XAML
|
|
|
|
|
########
|
|
|
|
|
|
|
|
|
|
$terminalAppPath = Join-Path $tempdir $terminalDir
|
2023-04-20 07:47:05 -05:00
|
|
|
|
|
|
|
|
If ($TerminalAppX) {
|
|
|
|
|
$TerminalAppX = Get-Item $TerminalAppX | Select-Object -Expand FullName
|
|
|
|
|
New-Item -ItemType Directory -Path $terminalAppPath | Out-Null
|
|
|
|
|
& $MakeAppxPath unpack /p $TerminalAppX /d $terminalAppPath /o | Out-Null
|
|
|
|
|
If ($LASTEXITCODE -Ne 0) {
|
|
|
|
|
Throw "Unpacking $TerminalAppX failed"
|
|
|
|
|
}
|
|
|
|
|
} ElseIf ($TerminalLayout) {
|
|
|
|
|
Copy-Item -Recurse -Path $TerminalLayout -Destination $terminalAppPath
|
|
|
|
|
}
|
|
|
|
|
|
Add support for an unpackaged distribution of Terminal (#15034)
Since the removal of the Win10-specific variant of the Terminal MSIX in
#15031, there has been no officially-sanctioned (or even unofficially
tested!) way to get an unzippable double-click-runnable version of
Windows Terminal.
Due to a quirk in the resource loading system, an unpackaged
distribution of Terminal needs to ship all of XAML's resources and all
of is own resources in a single `resources.pri` file. The tooling to
support this is minimal, and we were previously just coasting by on
Visual Studio's generosity plus how the prerelease distribution of XAML
embedded itself into the consuming package.
This pull request introduces a build phase plus a supporting script (or
three) that produces a ZIP file distribution of Windows Terminal when
given a Terminal MSIX and an XAML AppX.
The three scripts are:
1. A script to merge any number of PRI files and/or PRI dump files (made
with `makepri dump /dt detailed`)
2. A script that specifically merges XAML's resources with Terminal's.
This is necessary because the XAML package emits a couple PRI
resources into Terminal's resources _even when it is not
co-packaged._ We need to remove the conflicting resources.
3. Finally, a script to take a WT and XAML distribution and combine them
-- resources, files, everything -- and strip out the things that we
don't need. This script is an all-in-one that calls the other two and
produces a ZIP file at the end.
The final distribution is named after the PFN
(`Microsoft.WindowsTerminal`, or `...Preview` or `WindowsTerminalDev`),
the version number and the architecture. When expanded, it produces a
directory named `terminal-X.Y.Z.A` (version number.)
I've also added the build script to the release pipeline.
As a treat, this also produces an unpackaged distribution out of every
CI build... that way, contributors can download live deployable copies
of WT Unpackaged to test out their changes. Pretty cool.
Refs #1386
2023-03-30 16:38:10 -05:00
|
|
|
$xamlAppPath = Join-Path $tempdir "xaml"
|
|
|
|
|
New-Item -ItemType Directory -Path $xamlAppPath | Out-Null
|
|
|
|
|
& $MakeAppxPath unpack /p $XamlAppX /d $xamlAppPath /o | Out-Null
|
|
|
|
|
If ($LASTEXITCODE -Ne 0) {
|
|
|
|
|
Throw "Unpacking $XamlAppX failed"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
########
|
|
|
|
|
# Some sanity checking
|
|
|
|
|
########
|
|
|
|
|
|
|
|
|
|
$xamlManifest = [xml](Get-Content (Join-Path $xamlAppPath "AppxManifest.xml"))
|
|
|
|
|
If ($xamlManifest.Package.Identity.Name -NotLike "Microsoft.UI.Xaml*") {
|
|
|
|
|
Throw "$XamlAppX is not a XAML package (instead, it looks like $($xamlManifest.Package.Identity.Name))"
|
|
|
|
|
}
|
|
|
|
|
If ($xamlManifest.Package.Identity.ProcessorArchitecture -Ne $architecture) {
|
|
|
|
|
Throw "$XamlAppX is not built for $architecture (instead, it is built for $($xamlManifest.Package.Identity.ProcessorArchitecture))"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
########
|
|
|
|
|
# Preparation of source files
|
|
|
|
|
########
|
|
|
|
|
|
|
|
|
|
$itemsToRemove = $filesToRemove | ForEach-Object {
|
|
|
|
|
Get-Item (Join-Path $terminalAppPath $_) -EA:SilentlyContinue | Where-Object {
|
|
|
|
|
$filesToKeep -NotContains $_.Name
|
|
|
|
|
}
|
|
|
|
|
} | Sort-Object FullName -Unique
|
|
|
|
|
$itemsToRemove | Remove-Item -Recurse
|
|
|
|
|
|
|
|
|
|
$filesToCopyFromXaml | ForEach-Object {
|
|
|
|
|
Get-Item (Join-Path $xamlAppPath $_)
|
|
|
|
|
} | Copy-Item -Recurse -Destination $terminalAppPath
|
|
|
|
|
|
|
|
|
|
########
|
|
|
|
|
# Resource Management
|
|
|
|
|
########
|
|
|
|
|
|
|
|
|
|
$finalTerminalPriFile = Join-Path $terminalAppPath "resources.pri"
|
|
|
|
|
& (Join-Path $PSScriptRoot "Merge-TerminalAndXamlResources.ps1") `
|
|
|
|
|
-TerminalRoot $terminalAppPath `
|
|
|
|
|
-XamlRoot $xamlAppPath `
|
|
|
|
|
-OutputPath $finalTerminalPriFile `
|
2023-04-20 07:47:05 -05:00
|
|
|
-Verbose:$Verbose | Out-Host
|
Add support for an unpackaged distribution of Terminal (#15034)
Since the removal of the Win10-specific variant of the Terminal MSIX in
#15031, there has been no officially-sanctioned (or even unofficially
tested!) way to get an unzippable double-click-runnable version of
Windows Terminal.
Due to a quirk in the resource loading system, an unpackaged
distribution of Terminal needs to ship all of XAML's resources and all
of is own resources in a single `resources.pri` file. The tooling to
support this is minimal, and we were previously just coasting by on
Visual Studio's generosity plus how the prerelease distribution of XAML
embedded itself into the consuming package.
This pull request introduces a build phase plus a supporting script (or
three) that produces a ZIP file distribution of Windows Terminal when
given a Terminal MSIX and an XAML AppX.
The three scripts are:
1. A script to merge any number of PRI files and/or PRI dump files (made
with `makepri dump /dt detailed`)
2. A script that specifically merges XAML's resources with Terminal's.
This is necessary because the XAML package emits a couple PRI
resources into Terminal's resources _even when it is not
co-packaged._ We need to remove the conflicting resources.
3. Finally, a script to take a WT and XAML distribution and combine them
-- resources, files, everything -- and strip out the things that we
don't need. This script is an all-in-one that calls the other two and
produces a ZIP file at the end.
The final distribution is named after the PFN
(`Microsoft.WindowsTerminal`, or `...Preview` or `WindowsTerminalDev`),
the version number and the architecture. When expanded, it produces a
directory named `terminal-X.Y.Z.A` (version number.)
I've also added the build script to the release pipeline.
As a treat, this also produces an unpackaged distribution out of every
CI build... that way, contributors can download live deployable copies
of WT Unpackaged to test out their changes. Pretty cool.
Refs #1386
2023-03-30 16:38:10 -05:00
|
|
|
|
|
|
|
|
########
|
|
|
|
|
# Packaging
|
|
|
|
|
########
|
|
|
|
|
|
2023-09-28 13:25:26 -05:00
|
|
|
$portableModeMarkerFile = Join-Path $terminalAppPath ".portable"
|
|
|
|
|
If ($PortableMode) {
|
|
|
|
|
"" | Out-File $portableModeMarkerFile
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-20 07:47:05 -05:00
|
|
|
If ($PSCmdlet.ParameterSetName -Eq "AppX") {
|
|
|
|
|
# We only produce a ZIP when we're combining two AppX directories.
|
|
|
|
|
New-Item -ItemType Directory -Path $Destination -ErrorAction:SilentlyContinue | Out-Null
|
|
|
|
|
$outputZip = (Join-Path $Destination ("{0}.zip" -f ($distributionName)))
|
|
|
|
|
& tar -c --format=zip -f $outputZip -C $tempDir $terminalDir
|
|
|
|
|
Remove-Item -Recurse -Force $tempDir -EA:SilentlyContinue
|
|
|
|
|
Get-Item $outputZip
|
|
|
|
|
} ElseIf ($PSCmdlet.ParameterSetName -Eq "Layout") {
|
|
|
|
|
Get-Item $terminalAppPath
|
|
|
|
|
}
|