Skip to content

Commit f20a8e2

Browse files
committed
Add notes on building package from commandline
Unfortunately, does not come up with a good inner loop for buidling the package from the commandline. The inner loop for the resources just sucks. * [x] closes #926
1 parent df06c54 commit f20a8e2

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

doc/building.md

+43
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,46 @@ If you want to use .nupkg files instead of the downloaded Nuget package, you can
8787
2. Create the folder /dep/packages
8888
3. Put your .nupkg files in /dep/packages
8989
4. If you are using different versions than those already being used, you need to update the references as well. How to do that is explained under "Updating Nuget package references".
90+
91+
92+
## Building the Terminal package from the commandline
93+
94+
The Terminal is bundled as an `.msix`, which is produced by the `CascadiaPackage.wapproj` project. To build that project from the commandline, you can run the following (from a window you've already run `tools\razzle.cmd` in):
95+
96+
```cmd
97+
"%msbuild%" "%OPENCON%\OpenConsole.sln" /p:Configuration=%_LAST_BUILD_CONF% /p:Platform=%ARCH% /p:AppxSymbolPackageEnabled=false /t:Terminal\CascadiaPackage /m
98+
```
99+
100+
This takes quite some time, and only generates an `msix`. It does not install the msix. To deploy the package:
101+
102+
```powershell
103+
# If you haven't already:
104+
Import-Module tools\OpenConsole.psm1;
105+
Set-MsBuildDevEnvironment;
106+
107+
# The Set-MsBuildDevEnvironment call is needed for finding the path to
108+
# makeappx. It also takes a little longer to run. If you're sticking in powershell, best to do that.
109+
110+
Set-Location -Path src\cascadia\CascadiaPackage\AppPackages\CascadiaPackage_0.0.1.0_x64_Debug_Test;
111+
if ((Get-AppxPackage -Name 'WindowsTerminalDev*') -ne $null) {
112+
Remove-AppxPackage 'WindowsTerminalDev_0.0.1.0_x64__8wekyb3d8bbwe'
113+
};
114+
New-Item ..\loose -Type Directory -Force;
115+
makeappx unpack /v /o /p .\CascadiaPackage_0.0.1.0_x64_Debug.msix /d ..\Loose\;
116+
Add-AppxPackage -Path ..\loose\AppxManifest.xml -Register -ForceUpdateFromAnyVersion -ForceApplicationShutdown
117+
```
118+
119+
Or the cmd.exe version:
120+
```cmd
121+
@rem razzle.cmd doesn't set:
122+
@rem set WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\
123+
@rem vsdevcmd.bat does a lot of logic to find that.
124+
@rem
125+
@rem I'm gonna hardcode it below:
126+
127+
powershell -Command Set-Location -Path %OPENCON%\src\cascadia\CascadiaPackage\AppPackages\CascadiaPackage_0.0.1.0_x64_Debug_Test;if ((Get-AppxPackage -Name 'WindowsTerminalDev*') -ne $null) { Remove-AppxPackage 'WindowsTerminalDev_0.0.1.0_x64__8wekyb3d8bbwe'};New-Item ..\loose -Type Directory -Force;C:\'Program Files (x86)'\'Windows Kits'\10\bin\10.0.19041.0\x64\makeappx unpack /v /o /p .\CascadiaPackage_0.0.1.0_x64_Debug.msix /d ..\Loose\;Add-AppxPackage -Path ..\loose\AppxManifest.xml -Register -ForceUpdateFromAnyVersion -ForceApplicationShutdown
128+
```
129+
130+
(yes, the cmd version is just calling powershell to do the powershell version. Too lazy to convert the rest by hand, I'm already copying from `.vscode\tasks.json`)
131+
132+
Building the package from VS generates the loose layout to begin with, and then registers the loose manifest, skipping the msix stop. It's a lot faster than the commandline inner loop here, unfortunately.

0 commit comments

Comments
 (0)