@@ -116,6 +116,9 @@ public class BootstrapperOptions : SharedOptions
116
116
[ Option ( 'm' , "msi-path" , Required = true , HelpText = "Path to the MSI package to embed" ) ]
117
117
public string MsiPath { get ; set ; }
118
118
119
+ [ Option ( 'w' , "windows-app-sdk-path" , Required = true , HelpText = "Path to the Windows App Sdk package to embed" ) ]
120
+ public string WindowsAppSdkPath { get ; set ; }
121
+
119
122
public new void Validate ( )
120
123
{
121
124
base . Validate ( ) ;
@@ -124,6 +127,8 @@ public class BootstrapperOptions : SharedOptions
124
127
throw new ArgumentException ( $ "Logo PNG file not found at '{ LogoPng } '", nameof ( LogoPng ) ) ;
125
128
if ( ! SystemFile . Exists ( MsiPath ) )
126
129
throw new ArgumentException ( $ "MSI package not found at '{ MsiPath } '", nameof ( MsiPath ) ) ;
130
+ if ( ! SystemFile . Exists ( WindowsAppSdkPath ) )
131
+ throw new ArgumentException ( $ "Windows App Sdk package not found at '{ WindowsAppSdkPath } '", nameof ( WindowsAppSdkPath ) ) ;
127
132
}
128
133
}
129
134
@@ -337,16 +342,11 @@ private static int BuildBundle(BootstrapperOptions opts)
337
342
{
338
343
opts . Validate ( ) ;
339
344
340
- if ( ! DotNetRuntimePackagePayloads . TryGetValue ( opts . Platform , out var payload ) )
345
+ if ( ! DotNetRuntimePackagePayloads . TryGetValue ( opts . Platform , out var dotNetRuntimePayload ) )
341
346
throw new ArgumentException ( $ "Invalid architecture '{ opts . Platform } ' specified", nameof ( opts . Platform ) ) ;
342
347
343
- // TODO: it would be nice to include the WindowsAppRuntime but
344
- // Microsoft makes it difficult to check from a regular
345
- // installer:
346
- // https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/check-windows-app-sdk-versions
347
- // https://github.com/microsoft/WindowsAppSDK/discussions/2437
348
348
var bundle = new Bundle ( ProductName ,
349
- new ExePackage
349
+ new ExePackage // .NET Runtime
350
350
{
351
351
PerMachine = true ,
352
352
// Don't uninstall the runtime when the bundle is uninstalled.
@@ -362,7 +362,28 @@ private static int BuildBundle(BootstrapperOptions opts)
362
362
// anyway. The MSI will fatally exit if the runtime really isn't
363
363
// available, and the user can install it themselves.
364
364
Vital = false ,
365
- Payloads = [ payload ] ,
365
+ Payloads = [ dotNetRuntimePayload ] ,
366
+ } ,
367
+ // TODO: right now we are including the Windows App Sdk in the bundle
368
+ // and always install it
369
+ // Microsoft makes it difficult to check if it exists from a regular installer:
370
+ // https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/check-windows-app-sdk-versions
371
+ // https://github.com/microsoft/WindowsAppSDK/discussions/2437
372
+ new ExePackage // Windows App Sdk
373
+ {
374
+ PerMachine = true ,
375
+ Permanent = true ,
376
+ Cache = PackageCacheAction . remove ,
377
+ // There is no license agreement for this SDK.
378
+ InstallArguments = "--quiet" ,
379
+ Vital = false ,
380
+ Payloads =
381
+ [
382
+ new ExePackagePayload
383
+ {
384
+ SourceFile = opts . WindowsAppSdkPath
385
+ }
386
+ ] ,
366
387
} ,
367
388
new MsiPackage ( opts . MsiPath )
368
389
{
0 commit comments