@@ -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,16 @@ 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
+ var windowsAppSdkPaylod = new ExePackagePayload
349
+ {
350
+ SourceFile = opts . WindowsAppSdkPath
351
+ } ;
352
+
348
353
var bundle = new Bundle ( ProductName ,
349
- new ExePackage
354
+ new ExePackage // .NET Runtime
350
355
{
351
356
PerMachine = true ,
352
357
// Don't uninstall the runtime when the bundle is uninstalled.
@@ -362,7 +367,28 @@ private static int BuildBundle(BootstrapperOptions opts)
362
367
// anyway. The MSI will fatally exit if the runtime really isn't
363
368
// available, and the user can install it themselves.
364
369
Vital = false ,
365
- Payloads = [ payload ] ,
370
+ Payloads = [ dotNetRuntimePayload ] ,
371
+ } ,
372
+ // TODO: right now we are including the Windows App Sdk in the bundle
373
+ // and always install it
374
+ // Microsoft makes it difficult to check if it exists from a regular installer:
375
+ // https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/check-windows-app-sdk-versions
376
+ // https://github.com/microsoft/WindowsAppSDK/discussions/2437
377
+ new ExePackage // Windows App Sdk
378
+ {
379
+ PerMachine = true ,
380
+ Permanent = true ,
381
+ Cache = PackageCacheAction . remove ,
382
+ // There is no license agreement for this SDK.
383
+ InstallArguments = "--quiet" ,
384
+ Vital = false ,
385
+ Payloads =
386
+ [
387
+ new ExePackagePayload
388
+ {
389
+ SourceFile = opts . WindowsAppSdkPath
390
+ }
391
+ ] ,
366
392
} ,
367
393
new MsiPackage ( opts . MsiPath )
368
394
{
0 commit comments