Fishing Off the Desktop Bridge. Your AppXManifest

Start with the Documentation

The Desktop Bridge documentation has gotten better and better since the released the first preview. They have lot’s good articles, GitHub samples, snippets and guidance. I’ll try to cover some specifics and tie things together based on my experience. After you’ve brushed up on the documentation the next step is to generate an AppXManifest.xml. The AppXManifest describes the contents and meta data of a UWP AppX package.

Instead of using the Desktop App Converter (DAC), we will convert our app by hand. This way we’ll understand better what’s going on under the hood. Plus, unless your installation is exceedingly complex, doing this manually simplifies your build toolchain. Assuming that this isn’t a one time conversion, and you’ll be adding modern features to you Win32 app, you need to consider how you are going to iteratively build the project.

The DAC runs your installer in a Windows 10 VM, detects the system changes and spits out an AppX package. It looks like it does a really nice job of that but is a 3+ GB package (for the OS based image) and a bit of a black box. Depending on the needs of your deployment, the manual conversion may very well be fine.

Copy the Sample AppXManifest and Edit for Your App

Copy the sample Xml from the manual conversion documentation page in a blank AppXManifest.xml file and add it as a solution item in Visual Studio. Next, fill out all of the placeholders with the specifics of your app. You’ll end up with something that looks like:

<?xml version="1.0" encoding="utf-8"?>
  <Identity Name="3652dkackman.FishyFishyFish"
    Version="" />
    <DisplayName>Fishy Fishy Fish</DisplayName>
    <Description>Some fish. Swimming around on your screen.</Description>
    <Resource Language="en-us" />
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.14352.0" />
    <Capability Name="internetClient" />
    <rescap:Capability Name="runFullTrust"/>    
    <Application Id="FishyFishyFish" Executable="FishyFish.exe" EntryPoint="Windows.FullTrustApplication">      
         DisplayName="Fishy Fishy Fish"
         Description="Some fish. Swimming around on your screen." />       

You’ll get real values for the Name and Publisher attributes of the Identity when you reserve the app name online. In the meantime, placeholder values of your choosing are fine. You will need to provide the 150 and 44 pixel logo images. as these are required assets. If you create a blank Universal app in visual studio you can hijack those png’s and make something better later on.

And finally, any place you see REALTIVE PATH referenced in the sample xml, it is a path relative to the root of your AppX package. An AppX file is just a Zip file and since Zip’s can have folder structure, make all those paths relative to the Zip/AppX file root. My app deploy is simple enough that I just have everything in the root but you might have an assets folder or the like to better organize your packages files.

So that’s the AppXManifest. Next we’ll turn it into an AppX package.


Fishing off of the Desktop Bridge

The Desktop Bridge helps us convert Win32 apps to UWP apps without needing an immediate and massive rewrite. Microsoft is pushing developers to do all desktop application in the Universal Windows Platform (UWP) model. UWP is the latest in their application framework technologies, targeting Windows 10 across desktop, tablet and mobile versions.

Unlike UWP, which runs apps in containerized, sandboxed execution environments, previous frameworks (like WinForms) gave applications unfettered access to the operating system. Those UWP containers greatly simplify deployment, increase security and reliability. But what do you do if you have an existing app that would be difficult to convert in one fell swoop? Doing things the UWP way versus the Win32 can be dramatically different.

That’s where the Desktop Bridge (aka Project Centennial) comes in. The Desktop Bridge helps developers migrate to the UWP environment by:

  • Migrating deployment and configuration into the Windows App Store
  • Exposing modern UWP API’s to older applications
  • Running those applications in a controlled UWP container

In order to learn about the Desktop Bridge, we’re going to take a very simple WinForms application and convert it to an AppX package. The app we are going to use doesn’t do anything other than animate some fish swimming across a user’s desktop. It’s simple so that we can concentrate on the conversion. However, it does do things like make Win32 interop calls, which means it couldn’t be done as straight UWP without a full rewrite.

The end result is an app in the store called Fishy Fishy Fish, but the fun bits will be figuring out how to get it there…