Enable app to call the boostrap based on a "local" installation #3813
-
I have two versions of my app. One, the "Self-Contained" which has a bunch of redistributables in it's directory and can use WinUI directly. This app will only load in Windows 10+ even if it doesn't use WinUI (else I get a "this app must be run within a container" error in Windows 7). The other "desktop" version can run in Windows 7 and can also use the bootstrap to load WinUI if there 's a redistributable installed. Would it be possible for the desktop app to call the bootstrap since the "local" files are already there? This will enable me a) to use only one executable and b) to avoid a redisitributable installation. No matter what I 've tried, calls to Bootstrap API fail from the "desktop" app unless the redist is installed. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
This isn't the way that self contained works. However, depending on how you handle things, it should be possible to do what you want. First of all, the app container thing comes as a side effect of using the Windows 10 application project type that the WinUI projects use. If you use dumpbin to check the executable headers:
You can see that the dll characteristics contains App Container. This may be called dll characteristics, but it also affects executables too. Anyway, this is something that is set by the linker. You can force this off if you add /APPCONTAINER:NO to the command line, as documented. Secondly, contrary to what you may think, the Windows App SDK does not use the Bootstrapper API to load when it is self contained. As documented, the Bootstrapper API is only needed when the Windows App SDK is being used as a framework package. This is because Windows 10 does not have a Dynamic Dependencies API, the Windows App SDK provides one, but you need to use a Dynamic Dependencies API to reference the Windows App SDK. |
Beta Was this translation helpful? Give feedback.
This isn't the way that self contained works. However, depending on how you handle things, it should be possible to do what you want.
First of all, the app container thing comes as a side effect of using the Windows 10 application project type that the WinUI projects use. If you use dumpbin to check the executable headers: