Microsoft’s strategy for filling in the holes that its app store currently has is a tri-fold approach. Using its Universal Windows Platform as the glue holding it all together, Microsoft is enticing developers from mobile, desktop, and the web to bring their experiences to Windows.
We’ve spoken at length about how mobile developers can port or build apps for Windows and to a lesser degree we’ve covered how web developers can find a home in Windows 10, but now Microsoft is helping devs forge a 5-step path from maintaining desktop apps to creating UWP apps.
At its Building Apps for Windows blog, the Windows team does a quick walk through of how to repackage desktops apps into fully functional and modern UWP ones.
Today, we will follow up with a walkthrough of a concrete coding example that takes an existing desktop app and gradually migrates and enhances it with the Desktop Bridge into a full Universal Windows Platform (UWP) app that can run on all Windows 10 devices—such as Xbox One, HoloLens, phones, et cetera—and take full advantage of the platform.
The key to Windows development simplicity lies with an updated version of the Desktop App Converter. With the use of the Desktop App Converter, developers can target apps that are using .MSI (or similar) much more easily. Even those apps which do not use .MSI or, perhaps, something a bit more complex can choose to use a third-party solution as the Desktop Bridge to UWP supports a ton.
After converting, the next two steps show developers how they can enhance their apps by injecting UWP specific code. The UWP code enables apps to tap into Live Tile, Action Center and new install and uninstall processes within Windows 10 APIs.
In addition to calling more UWP APIs, we can now also add UWP components to our app package to take advantage of other exciting UWP features. Examples of this include adding App Services, becoming a sharing target or a file picker, or adding background tasks.
With background tasks, an app can respond to triggers to execute code even when the app is not running—even if the device is in connected stand-by mode. This way, you can always keep your app up to date and create an experience of an app that is always alive. To illustrate this in our example, we want to use the TimeTrigger to periodically check the status and notify the user via a toast notification.
Steps four and five round out the rough edges of a Win32 app compared to a UWP one, with tips on how to migrate UIs, framework, and replacing registry-based states with UWP compliant ApplicationData API.
The whole process culminates with a desktop app now ready to be deployed in the Windows Store as a native Windows 10 app primed for use on the Xbox, HoloLens, and other Windows devices.
Visit Microsoft’s Building Apps for Windows blog for more detail, code samples and other guided steps on processing a desktop to a more modern UWP one.