-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UndockedRegFreeWinRT self-contained and auto-initialization support #2493
Conversation
…initialization support
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -7,4 +7,8 @@ | |||
<WindowsAppSdkUndockedRegFreeWinRTInitialize>true</WindowsAppSdkUndockedRegFreeWinRTInitialize> | |||
</PropertyGroup> | |||
|
|||
<PropertyGroup Condition="'$(WindowsAppSdkUndockedRegFreeWinRTInitializeLoadLibrary)'=='' and '$(WindowsAppSdkUndockedRegFreeWinRTInitialize)'=='true'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this always false (can't be both == '' and == 'true'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Those two checks are against two different variables - WindowsAppSdkUndockedRegFreeWinRTInitializeLoadLibrary & WindowsAppSdkUndockedRegFreeWinRTInitialize. The two conditions can be true at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to get rid of WindowsAppSdkUndockedRegFreeWinRTInitializeLoadLibrary
but trying to statically link in microsoft.windowsappruntime.dll was giving unresolved external symbol for the ..._EnsureIsLoaded export, despite the lib in the link list. So I punted to unblock us and went with a ctor calling LoadLibrary(), and that's used by default. Kept the other logic around so we can experiment later to see what's griefing.
You shouldn't need to do anything. Like the Bootstrapper auto-init, do nothing and if selfcontained you get the URFW auto-init. And unlike the Bootstrapper the only reason that could fail is if your app's self-contained install is horrifically damaged microsoft.windowsappruntime.dll and imports can't be loaded. Pretty hard trick, and if you're in that state WinAppSDK's probably the least of your worries.
@@ -7,4 +7,8 @@ | |||
<WindowsAppSdkUndockedRegFreeWinRTInitialize>true</WindowsAppSdkUndockedRegFreeWinRTInitialize> | |||
</PropertyGroup> | |||
|
|||
<PropertyGroup Condition="'$(WindowsAppSdkUndockedRegFreeWinRTInitializeLoadLibrary)'=='' and '$(WindowsAppSdkUndockedRegFreeWinRTInitialize)'=='true'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Those two checks are against two different variables - WindowsAppSdkUndockedRegFreeWinRTInitializeLoadLibrary & WindowsAppSdkUndockedRegFreeWinRTInitialize. The two conditions can be true at the same time.
* Rename CsWinRT Dependency Variable for Windows SDK * update Version.Details.xml * Under a .NET SDK version check, bring back our (broken) default file inclusion solution for RESW and image files (applies to non-single project MSIX apps only). (#2424) * Under a .NET SDK version check, continue to use our (broken) default file inclusion solution for RESW and image files (applies to non-single project MSIX apps only). * Fixes: use the right version number and use the right property for the version number! Tested. * add end dev library adoption section, link to community call (#2428) * Replace WAR_ prefix with WINDOWSAPPRUNTIME_ prefix (#2430) Co-authored-by: Santosh Chintalapati <sachinta@ntdev.microsoft.com> * Fix IsSelfContained() to lookup framework packagefamilyname at runtime (#2411) * Added Microsoft::WindowsAppRuntime::VersionInfo::RuntimeInformation as a (partial) runtime-equivalent WindowsAppSDK-VersionInfo.h to workaround the chicken-egg problem where we need to know the versioninfo now but it's nto defined until higher in the build tree (the Aggregator pipeline at the top) * Replaced WindowsAppRuntime_SelfContainedTestInitialize with WindowsAppRuntime_VersionInfo_TestInitialize as we moved the functionality down a level * Removed dead code * Update docs for IsSelfContained * Update test to match SelfContained/VersionInfo::TestInitialize change * Add missing #include * Fix compiler warnings (#2420) * Update WinRT contracts per specs\WinRT\WinRTAPIContracts.md (some contract names didn't match or were absent) * Fixed warnings * Use correct type to avoid warnings on some platform (#2436) Co-authored-by: Eric Langlois <erlangl@microsoft.com> * Trim Resource Id prefix from WINDOWSAPPRUNTIME_ to MSIX_ (#2442) Co-authored-by: Santosh Chintalapati <sachinta@ntdev.microsoft.com> * MddBootstrap Telemetry & TraceLogging (#2321) * MddBootStrap API telemetry * Use ThreadLoggingCallback instead of Process wide callback for wil result logging callback * Add safegaurds to call initialize and shutdown activity's StopWithResult only when the activity is running. Co-authored-by: Santosh Chintalapati <sachinta@ntdev.microsoft.com> * Update WindowsAppSDK-RunHelixTests-Job.yml (#2455) Appended windows.11.amd64.client.open.reunion to helixTargetQueuesOpen and Windows.11.Amd64.client.Reunion to helixTargetQueuesClosed. * UndockedRegFreeWinRT auto-initialization (#2452) * Remove dead code * Add URWF auto-initializer * New URFW files * Connect the dots for URFW auto-initialization support * Added missing file. Fixed compiler warnings * Simplified the C# auto-initializer. Added a comment explaining why it works the way it does * Updated C# auto-initializers to shortcircuit any work if loaded for reflecction (vs execution) * Added missing using * Fix returning a reference to a local variable in GetActivityFlags(); returns a const enum so no reason it can't be by-value and the obvious correctness reason it can't be by-ref * Added build macro WindowsAppSDKCleanIntermediateFiles=<boolean> to scrub intermediate outputs as we build. Defaults to 'true' for build pipeline else undefined and thus not acted on (e.g. dev inner-loop) * Fix prototype for GetIntegrityFlags * Move WindowsAppSDKCleanIntermediateFiles to be a parameter defined by the pipeline, for better inner-loop (for those who want to use the option) * Deploy Main and Singleton in BreakAway process when Deployment API is called from MediumILHigherIL Non-Microsoft publisher package (#2454) Create DeploymentAgent.exe and run it in a breakaway process from Deployment API when the caller is packaged process and has MediumIL/HigherIL integrity level. Co-authored-by: Santosh Chintalapati <sachinta@ntdev.microsoft.com> * Log Installer events to disk (#2460) * Log Installer events to disk (Application.evtx or Eventvwr.exe -> Windows Logs -> Application) in "WindowsAppRuntime Installer" source. Co-authored-by: Santosh Chintalapati <sachinta@ntdev.microsoft.com> * Change Singleton package Name to Microsoft.WinAppRuntime.Singleton[-shorttag] * Yet Moar CorpII * Replace WARmain with WARsingleton to point to singleton package * Update Deployment ACIDs in Framework package manifest (#2472) Update Deployment ACIDs in Framework package manifest Co-authored-by: Santosh Chintalapati <sachinta@ntdev.microsoft.com> * Fix UndockedRegFreeWinRT auto-initializer issues (#2476) * Fix bad filename * No precompiledheaders when compiling the auto-initializer * Copy DeploymentAgent executable to TestFwkPkg (#2467) * Copy DeploymentAgent executable to TestFwkPkg * Make DeploymentAgent a dependency to build Microsoft.Windows.Framework Co-authored-by: Santosh Chintalapati <sachinta@ntdev.microsoft.com> * Add PushNotificationsLongRunningTask.ProxyStub pdb to symbols dir (#2361) Co-authored-by: Eric Langlois <erlangl@microsoft.com> * Some refinements on the UndockedRegFreeWinRT self-contained and auto-initialization support (#2493) Co-authored-by: Joshua Larkin <70237359+j0shuams@users.noreply.github.com> Co-authored-by: Rohan Palaniappan <35987549+rohanp-msft@users.noreply.github.com> Co-authored-by: Scott Jones <sjones@microsoft.com> Co-authored-by: sachintaMSFT <80828309+sachintaMSFT@users.noreply.github.com> Co-authored-by: Santosh Chintalapati <sachinta@ntdev.microsoft.com> Co-authored-by: Howard Kapustein <howardk@microsoft.com> Co-authored-by: eric langlois <email@ericlanglois.com> Co-authored-by: Eric Langlois <erlangl@microsoft.com> Co-authored-by: alexlamtest <68841560+alexlamtest@users.noreply.github.com> Co-authored-by: Paul Purifoy <33183370+pmpurifoy@users.noreply.github.com>
…initialization support (#2493)
…elf-contained (#2502) * Fix UndockedRegFreeWinRT auto-initializer issues (#2476) * Fix bad filename * No precompiledheaders when compiling the auto-initializer * Some refinements on the UndockedRegFreeWinRT self-contained and auto-initialization support (#2493) * UrfwInitialize() didn't report if ExtRoLoadCatalog() errored and returned a failing HRESULT (only trapped thrown exceptions, but the implementation does both) (#2498) * Remove C# auto-initialization check for reflection (#2500) * Remove the 'if (Assembly.GetEntryAssembly() != Assembly.GetExecutingAssembly()) { return; }' shortcircuit as it catches loading for reflection AND for common test cases e.g. 'te.exe foo.dll' as auto-initialization isn't restricted to exes (i.e. it gets compiled into foo.dll) and then Entry!=Executing. Revert this for now and restore later when #2456 is addressed (by restrcting auto-init to only compile into exes) * Fix typo * Fix URFW auto-init reference to EnsureIsLoaded() (#2501) Co-authored-by: Howard Kapustein <howardk@microsoft.com>
Some refinements on the UndockedRegFreeWinRT self-contained and auto-initialization support
Testing here is a matter of modifying the nuget used by IntegrationTests in the Aggregator and then 'porting'/copying those changes from the local nuget to the actual source here. The Aggregator update is blocked until this makes it into the build
A couple of bits are less than elegant but work and can be refined later, when not so blocking/urgent.