Android and IoS are better than Windows at dealing with applications — it’s straightforward to install or delete an app, and safer too. Traditional Desktop applications need to be replaced with a modern alternative. With Universal Apps Windows reigned in bullshit that has been going on, and after November 2017 UWP apps finally have enough APIs to address SeriousBusiness™ applications. However Windows Store policies towards background execution are too restrictive, and we look at how to get round that. If you are not interested in overview, scroll down to “Assuming Direct ” section.

Traditional Desktop Apps must die

In the old days… I mean, Today each ‘normal’ Windows app needs it’s own installer, it’s own updater, it’s own uninstaller and often admin rights to install. It will then put files wherever it feels like. And then it will stick crap in the registry and never delete any of it. Currently I have programs that decided to nest in:

\%username%\AppData\Local

Program Files (x86)

ProgramData

C:\

User has basically no control over how well the app uninstalls, how often it runs, how much memory or battery it consumes. Case in point — Slack:

Taking 300MB and 6 processes for a texting app should be a crime.

This Swine-house of crap is also a burden to maintain, I have never in my life seen an uninstaller that does not leave bits of the app lying around the system, which then cause problems when you update or re-install.

Universal Windows Apps come with a single packaging system that cleanly installs and removes the app. The UI performance, touch controls and font rendering have all been substantially improved. The OS also puts the user in control of the app behaviour.

Windows 10 apps are much more controllable from the user’s perspective.

Despite these advantages hardly anyone uses the platform and Microsoft Store is mostly devoid of life. Why?

Microsoft shot Store in the foot, Twice

Of the few decent apps that are on Windows Store, the majority are converted desktop apps. Learning a new platform and making an app is a lot of work, and ‘Lightweights’ such as social networks are well served by webapps already.

Desktop apps shine when it comes to SeriousBusiness™ that can’t be done on tablets and webapps — work that takes a lot of compute power, unlimited internet connection, loads of screen space, terabytes of disk space, must run for hours on end, even 24/7. The problem is that Store-based Universal Windows App can’t support SeriousBusiness™.

Until recently the API set available to UWP developers was far too restricted, many libraries were incompatible, there was no way to accept SSL/TLS connections! With the arrival of .Net Standard 2.0 on November 2017, this is mostly a solved issue, only 2.5 years after release of Windows 10.

Windows Store places many restrictions on the developer — things you are not allowed to do. Most of them are justifiable, but in their fight against battery-sucking pests that are background apps they went too far. As it stands, Windows 10 may decide to suspend your app whenever it’s minimised or is otherwise in the background to free up RAM or conserve battery. You can ask Windows to postpone it, but there is it no guarantee. There are background tasks, but they will get suspended too, even on a desktop machine! You as a developer and even as a user have no control over the process. And that’s idiotic.

Why suspending is such a big deal

There is an API to opt out of suspending entirely, but your app will be banned form the store. With this single decision, most apps that have a reason to exist on desktop can’t be brought to the store:

Video Editing tools often take hours to process a video. Normally that does not stop you from using the computer for browsing / Word and other lightweight work. However if you use a UWP video editing tool and switch to a web browser, Windows will suspend the Video Editor. You would have to sit there for hours staring at the progress bar like an idiot, or use a different computer.

3D rendering tools like Blender3D can take days or weeks to render 3D movies.

Torrent clients such as Torrex get interrupted during downloading and seeding.

Bitcoin and other cryptocurrency clients — I wanted to build a cryptocurrency wallet for the store before realising that they need to constantly communicate with the network and a store based one would be rendered useless.

Dropbox or OneDrive. The ones in the store can’t sync your files in real time.

An Iot Dashboard app like my current Quickbird App

Countless other applications that nobody has imagined yet

Taking back Control

You can remove constrains on your UWP application by adding following lines to the package manifest. This will make your application ineligible for store distribution.

<Package …> …

<Capabilities>

<rescap:Capability Name=”extendedExecutionUnconstrained”/>

</Capabilities>

</Package>

This will allow your application to use extended execution session with

ExtendedExecutionForegroundReason.Unconstrained;

Implementing this functionality will yield ‘normal’ desktop application behaviour — the app will be running until terminated by the user using the ‘X’ in the upper right corner. You can also use this method to create background tasks that are always on. See this guidance for more detail.

Distributing apps without Windows Store

Visual Studio will produce an Appxbundle that can be installed on any computer using the AppInstaller, avaliable from Windows Store. However the app must be signed with a valid certificate. Unsigned apps are not allowed at all, and In my opinion that’s a good decision — acquiring certificates is not difficult, and placing the developer name on the package at least establishes a minimal responsibility and security.

By default Windows 10 allows sideloading

You need to buy a CodeSigning certificate, but there is no need to shell out for an EV version — I got a Comodo certificate from Leadertelecom.nl for less than £100. You might, however, need to have a registered company.

Visual Studio can be instructed d to sign the AppxBundle, but for some inexplicable reason it will not time stamp it.

Timestamping is essential — each certificate has an expiration date, typically a year or two. Without a timestamp, Certificates are validated against current date, so your application will become invalid after a year or so.

You can use SignTool, usually found with Windows 10 SDK in