May 17, 2016 10:00 am

Bringing your existing desktop apps to UWP

At Build 2016, we showed you how to use the Desktop App Converter to bring your existing desktop applications to the universal .appx packaging format as a first step to bringing your application to the Universal Windows Platform (UWP). Once on UWP, your apps are easier for users to manage and install, and you can integrate engaging UWP functionality and reach customers across the Windows 10 platform, including on IoT devices, Xbox One and HoloLens. We’d like to take this opportunity to further provide some context about the converter and other tooling involved (previously part of Project “Centennial”), and help you get started with the Desktop Bridge.

Since the release of the initial preview in early April, we’ve already seen hundreds of apps being converted and deployed for early testing. With the latest Windows 10 Insider Preview Build 14342, you can now run the Desktop App Converter on the Professional version of Windows, alongside the Enterprise edition that was previously enabled. Now is a great time to get started with converting your existing desktop applications to bring them to UWP!

What is the Desktop Bridge?

The Desktop Bridge brings a number of important improvements to the Windows platform for all developers. First, you can convert existing Windows desktop apps or games to .appx packages, so your users will be able to install them easily and experience seamless updates, be it through the Windows Store or any distribution channel of your choice.

Once converted to the UWP application model, the desktop app has access to new UWP APIs, including Live Tiles, push notifications and local/roaming app data, which previously were inaccessible to desktop apps. With this conversion process, your existing code continues to run with minimal changes and UWP deployment ensures that whatever state the app writes to the PC is isolated and easily cleaned up on uninstall – addressing a major pain point users have had with desktop apps in the past. Additionally, the app can now expose App Services, run Background Tasks, and have a XAML UI by adding a UWP app container process to the same app package.

With your existing code now running in the UWP application model, it’s straightforward to add additional functionality over time, gradually migrating  existing Win32/.NET code to move functionality into the app container. Running your code in the app container benefits the security of your user’s machine, and at the end of the migration results in a UWP app that can run on PCs, Phones, IoT devices, Xbox One and HoloLens.

DAC

  • Convert – Create an .appx deployment package for your desktop application
  • Enhance – Call new UWP APIs from your desktop application
  • Extend – Add new functionality, such as UWP App Services and Background Tasks
  • Migrate – Move more code into the app container part of your package, such as a XAML UI frontend
  • Expand – Finish the migration of all code to the app container and expand your reach to all Windows devices

Getting Started

To get started, you need the current Windows 10 Insider Preview Build 14342 (or higher), and the Windows 10 Anniversary SDK Preview Build 14332 (or higher). Please keep this installation separate from your production environment, as this build does not output valid app package for Store deployment. Next you’ll need the latest Desktop App Converter to complete your development environment. This tool converts your desktop app installer (such as MSI) to an .appx package that can be deployed to a Windows 10 Anniversary Edition desktop. If you’re trialing Visual Studio “15” Preview 2, you can also take a look at the packaging and debug support for projects that are using the Desktop Bridge.  For more information, please read the Visual Studio blog post on Visual Studio “15” support with the Desktop Bridge.

If your desktop application does not have an installer (e.g. deployment just consists of file copy operations), or you want to explore the Desktop Bridge with a simple example first, you can check out our sample repo on GitHub. Using the Basic Desktop Bridge App sample as a template, you can replace the sample .exe with your binaries, adjust the respective entries in the manifest according to the documentation and you are done with the conversion. You don’t even need to install and run the Desktop App Converter for this type of project!

Test, Update, Enhance and Extend your converted app

Once you have successfully converted your desktop app (either with the Desktop App Converter or manually), you are ready to deploy, test and enhance your app. Now that your app is in the UWP app model and has an .appx package, the methods for doing this are the same as for any UWP app. Check out our Deploy and Debug documentation for detailed steps on side-loading and debugging. Note that your converted app may need some code changes in some cases. Be sure to read the Preparing Your Desktop App for Conversion to UWP topic on the Windows Dev Center.

You can now iterate on your code and start enhancing your app with exciting new UWP features that were previously not available to desktop apps. Add background tasks and app services. Add a UWP process to your package to host a UWP XAML UI frontend, and so much more. We will continue to update the Desktop Bridge sample repo on GitHub to demonstrate many of these great UWP features consumed by converted desktop applications, as we are getting closer to the final release of the Windows 10 Anniversary Update.

Over the coming months, we’ll be sharing more in-depth information about these approaches, what the end-to-end developer process looks like and how to add new functionality to your existing app.

Help us improve the bridge

The Desktop Bridge offers an exciting path to migrate your existing desktop apps to UWP. It enables you to gradually move across the bridge at your own pace while keeping your existing code investments running at all times along the way.

As you explore the tools on current preview builds, we’re very keen on hearing about your experiences and receiving your feedback. The best place to make feature suggestions is on the Windows Developer UserVoice site. For questions and bug reports, please head over to the Developing Universal Windows apps forums.

Additional resources

Written by Stefan Wick, Principal Program Manager Lead for the Desktop Bridge

Updated May 17, 2016 11:30 am

Join the conversation

  1. Admittedly, I have lots of misconceptions about UWP apps, but when I think about converting my app to UWP, here are the stumbling blocks that come to my mind:

    1. Update size: My app is 18 GB in size. Users often receive updates between 5 MB to 28 MB. If I convert to UWP, all my updates will become 18 GB. That’s a dealbreaker.
    2. Extensibility: My app accepts plug-ins and there is very small community for them. I don’t want to lose that but if I convert to UWP, I must say goodbye to extensibility.
    3. Windows Store: I already have a distribution channel. If I convert to UWP, I must publish on Windows Store and share part of my profit with Microsoft. What do I get in return to justify it?
    4. Document storage location: My app creates documents that are sometimes as small as 1.2 MB but sometimes as big as 502 MB. My users need to be able to save them in a separate partition with a custom backup strategy or on a network location. But if Windows Voice Recorder is any indication, after converting to UWP, my users’ documents get trapped in a sandbox somewhere on drive C. This is a huge dealbreaker.
    5. Reputation: Windows Store apps have a very bad reputation already.
    6. What I get in return: In exchange for super-huge update sizes, loss of extensibility, having to share profit with Microsoft, and the inconvenience of getting user documents trapped in some sandbox, what do I get? It seems the answer is just a little convenience of not having to write the state-of-the-art installer and uninstaller that I have already written.

    • Hi John,
      Let me address your concerns:

      #1: The UWP deployment pipeline is designed to do delta updates. This means if there are only small changes in your 18GB package, the update that gets deployed to the user would only consist of the changed blocks (64kb chunks).

      #2: With the Windows Anniversary Update we are introducing App Extensibility for UWP (see our App Extensibility //BUILD/2016 session: https://channel9.msdn.com/Events/Build/2016/B808). Moreover, after converting your Win32 app via the Desktop Bridge you will be able to still run your existing plug-ins.

      #3: Windows Store is one option for you to distribute your UWP app. You can distribute UWP apps via the channel of your choice, and with the Windows Anniversary Update users will be able to just double-click on your signed .appx package file to install it on their machine. See our AppModel //BUILD/2016 session for some more details: https://channel9.msdn.com/Events/Build/2016/B809

      #4: UWP apps can save to the location of the user’s choice, including other drives or network locations. Check out our FilePicker sample app on GitHub: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/FilePicker

      #5: With the Desktop Bridge to UWP and the various other improvements in the upcoming Windows Anniversary Update, we are working to get many high quality apps into the Windows Store that users love and expect to be able to acquire from the Windows Store in a safe and convenient way.

      #6: Moving to UWP brings a number of great benefits for both the end-user and you, the app developer:
      -The end-user will enjoy single-click acquisition and automatic app updates, highly reliable install/uninstall without having side-effects on their system (like DLL hell, or registry bloat), improved security and confidence because the acquired app runs in an app container.
      -The app developer will benefit from having a modern deployment technology, access to Universal Windows Platform features like Live Tiles, App Services or XAML UI, the option to distribute via Windows Store, as well as the opportunity to target the larger Windows 10 ecosystem incl. Xbox, Hololens, etc. for increased reach and monetization.

      Thanks!
      Stefan Wick

  2. We have many users automating our application via OLE automation in a production situation. Will our typelibs and COM servers still be visible to third party OLE clients?

  3. John – really great questions. These plague me also.

    Stefan – even BETTER answers! I for one am very excited about this and look forward to giving the bridge a shot.

  4. I want to know wheather the data recovery applications can convert to the uwp?

  5. Maybe good to have a Online version for “Desktop App Converter”. Old hardware without HyperV. Upload desktop app installer MSI to OneDrive then converted App saved back to OneDrive, something like this. Ok?

  6. I was excited about Centennial since the first announcement but looking at bridge tutorials looks more like cracking software. It should be as easy as publishing ClickOnce apps, directly from Visual Studio. I am probably not the only one who thinks that invested time to make appx from my sln and publishing to the store outweighs the end benefits, especially for free programs. I am the still waiting for a GUI 1-minute process.