WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

DeploymentManager auto-initializer

Open DrusTheAxe opened this issue 3 years ago • 4 comments

NOT YET READY FOR REVIEW TESTING IN PROGRESS

Add an auto-initializer for DeploymentManager (very similar to the Bootstrapper's auto-initializer).

If DeploymentManager Initialize fails...

...Write to the eventlog image

TODO replace image with the event from DeploymentManager

...Optionally

  • DebugBreak
  • DebugBreak if a debugger is attached to the process
  • FailFast
  • MessageBox (modeled after .NET's) asking if you'd like to install the WindowsAppRuntime and if so, ShellExecute(url) to the download page

image

The optional behavior is triggered by the new MddDeploymentManagerInitialize(...options) parameter or by environment variables

SET MICROSOFT_WINDOWSAPPRUNTIME_DEPLOYMENTMANAGER_INITIALIZE_DEBUGBREAK=1
SET MICROSOFT_WINDOWSAPPRUNTIME_DEPLOYMENTMANAGER_INITIALIZE_SHOWUI=1
SET MICROSOFT_WINDOWSAPPRUNTIME_DEPLOYMENTMANAGER_INITIALIZE_FAILFAST=1

Tested via manual testing (HelloWorldCS.msix and HelloWorldCS.exe) under debugger with memory fiddling and running after setting environment variables.

*.targets updated to provide build-time control.

  • To disable the auto-initializer the auto-initialize set the property WindowsAppSDKDeploymentManagerAutoInitialize=false
  • If the auto-initalizer is enabled you can define properties to control the options passed via DeploymentInitializeOptions to DeploymentManager.Initialize()
    • WindowsAppSDKDeploymentManagerAutoInitializeOptions_Default=true -- use the default options (OnError_ShowUI)
    • WindowsAppSDKDeploymentManagerAutoInitializeOptions_None=true -- use no options (None)
    • WindowsAppSDKDeploymentManagerAutoInitializeOptions_*=true -- enable the option where * is one or more of the following
      • OnError_DebugBreak
      • OnError_DebugBreak_IfDebuggerAttached
      • OnError_FailFast
      • OnError_ShowUI
      • OnNoPackageIdentity_NoOp

For example, to disable the auto-initializer add to your *proj file:

<PropertyGroup>
    <WindowsAppSDKDeploymentManagerAutoInitialize>false</WindowsAppSDKDeploymentManagerAutoInitialize>
</PropertyGroup>

or to enable the auto-initializer (default) but use the DebugBreak+FailFast options (instead of the default)

<PropertyGroup>
    <WindowsAppSDKDeploymentManagerAutoInitializeOptions_OnError_DebugBreak>true</WindowsAppSDKDeploymentManagerAutoInitializeOptions_OnError_DebugBreak>
    <WindowsAppSDKDeploymentManagerAutoInitializeOptions_OnError_ShowUI>true</WindowsAppSDKDeploymentManagerAutoInitializeOptions_OnError_ShowUI>
</PropertyGroup>

https://task.ms/40724739

DrusTheAxe avatar Aug 09 '22 01:08 DrusTheAxe

/azp run

DrusTheAxe avatar Aug 09 '22 05:08 DrusTheAxe

Pull request contains merge conflicts.

azure-pipelines[bot] avatar Aug 09 '22 05:08 azure-pipelines[bot]

/azp run

DrusTheAxe avatar Aug 10 '22 07:08 DrusTheAxe

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 10 '22 07:08 azure-pipelines[bot]

/azp run

DrusTheAxe avatar Aug 12 '22 17:08 DrusTheAxe

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 12 '22 17:08 azure-pipelines[bot]

/azp run

DrusTheAxe avatar Aug 12 '22 23:08 DrusTheAxe

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 12 '22 23:08 azure-pipelines[bot]

/azp run

DrusTheAxe avatar Aug 17 '22 02:08 DrusTheAxe

Pull request contains merge conflicts.

azure-pipelines[bot] avatar Aug 17 '22 02:08 azure-pipelines[bot]

/azp run

DrusTheAxe avatar Aug 17 '22 02:08 DrusTheAxe

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 17 '22 02:08 azure-pipelines[bot]

/azp run

DrusTheAxe avatar Aug 17 '22 02:08 DrusTheAxe

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 17 '22 02:08 azure-pipelines[bot]

/azp run

DrusTheAxe avatar Aug 17 '22 02:08 DrusTheAxe

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 17 '22 02:08 azure-pipelines[bot]

/azp run

DrusTheAxe avatar Aug 17 '22 02:08 DrusTheAxe

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 17 '22 02:08 azure-pipelines[bot]