UWP detect if Desktop Bridge app is running - process

I have a UWP that also contains a desktop bridge component. The UWP contains the interactive code, including handling session management (login and logout). The desktop app runs in the background - it displays no UI most of the time - but must always be running when the app's user is signed in (the UWP and desktop components share auth). If the desktop app is not running when the UWP starts, but the app is signed in, the UWP needs to start the desktop app. Similarly, whenever the UWP signs in a user, it needs to start the desktop component (if it isn't already running). Signing out a user doesn't strictly require exiting the desktop app, though it wouldn't hurt. Critically, the desktop component must not (automatically) exit when the UWP exits, so there's no guarantee on launch of the UWP whether the desktop app was launched by a previous instance (and is still running) or not.
The problem is, I can't find a way for a UWP to detect whether its desktop bridge component is already running, or to kill an already-running instance. The methods in FullTrustProcessLauncher do not return a Process object or any other way to monitor the desktop app.
How can a UWP detect if its desktop bridge component is running? If it is running, can the UWP stop the desktop bridge app?

Related

Session state service failed- UWP

I am building a UWP application, also i am using desktop bridge which allows the UWP app to launch a win32 application and to communicate with it, to process some data that the UWP app can't give me its result.
The usual behavior of the is that the win32 app is launched for the UWP app, it process the data and then send the response to the UWP app and then it closes.
If for some reason the win32 app opens mutiple times in row, the UWP app crashes(it disappears) when i try to reopen the app, for example while debugging, it takes me to the App.g.i.cs, and say that there is a Session state service failed exception.
For some research i saw that this exception is related to prism, but i explained the behavior above in case it will have any effect on this exception.
Is it possible to know what is the source of this exception so we may able to handle it?

Questions about Windows App (Metro) Tiles/Icons for desktop applications

I have an application written in VB.NET that I want to move to Win10. It will always be a desktop application, however I would like it to have a start icon / tile in Win 10. Looking around I found this exact question which suggests to create a Metro App (now I believe called Windows App) which launches the desktop app. This is also discussed in this thread. So the questions;
These threads are a little old is the best way in Win10 to give a desktop app a Windows App Tile by using a Windows App as the Launcher for the desktop app?
It appears that in Win10 Microsoft has now allowed non-store apps to be installed in Update Security > SideloadApps. This needs to be enabled to install the App, but does this need to be always enabled. For example what happens after install if the user turns it off, will the app then not start?
For example I see in this link that there are 2 Registry keys to change, basically AllowAllTrustedApps and AllowDevelopmentWithoutDevLicense. Is it possible for my desktop installer to change these keys, install the Windows App (and everything else) and then change the keys back again?
Uninstalling? If I created a Windows App which only launched my desktop app then there is a possibility that the user uninstalls or deletes the Windows App, meaning my desktop app would be orphaned and lost. Any suggestion on solving this?
According to your description, I think what you need is Desktop Bridge. There is no need to use a Windows App as the Launcher for the desktop app.
You can try with Desktop App Converter, with this you can bring your existing desktop apps written for .NET 4.6.1 or Win32 to the Universal Windows Platform (UWP).
And after converting, you can replace the Assets generated by Desktop App Converter (DAC) automatically to provide custom Tiles/Icons. For more, you can refer to Manually convert your app to UWP using the Desktop Bridge.

Click on Toast Notification Launch new instance of app when application already started? - Migration from 81. app to UWP

I have migrated my application from 8.1 to Win 10 UWP app. When I click on Toast Notification and application is already running, the click launches the new instance of the app and goes back to loading the 1st page of the app.
Is there any reason for this? I dnt see any thing wrong in the codebase.

Disable auto snapping

i have a next question:
In Windows 8 when i tried to launch my other app from another app - there was no snapping by default, 1 application went to background and other went to front.
In windows 8.1 the application that lauched an URI goes to filled mode, but launchable app goes to snap - how to prevent this, and make it work like in Windows 8?
The Launcher that you use to invoke the second app accepts a LauncherOptions parameter. Use the DesiredRemainingView property to control the launch with regards to size.
By default it's the app that launches another app that controls how the view will be shared. It might be possible to override this behavior. Windows grants apps the option to enlarge themselves when requiring more space. It might be possible to invoke this method to enlarge a launched app.

Give permissions to a Windows 8 app to block another app

I'm trying to make my windows 8 app block another app from being launched or launch another app depending on user settings. For example block a browser from opening and launch a media player.
Is this possible?
No, Windows Store apps are running in sandboxed environment and you definitely cannot block any app from being used from another app.