Table of contents
Collapse the table of content
Expand the table of content

Manually convert your app to UWP using the Desktop Bridge

Last Updated: 12/6/2016

Using the Desktop App Converter (DAC) is convenient and automatic, and it's useful if there's any uncertainty about what your installer does. But if your app is installed by using xcopy, or if you're familiar with the changes that your app's installer makes to the system, you may want to create an app package and manifest manually. This article contains the steps for getting started. It also explains how to add unplated assets to your app, which is not covered by the DAC.

Here's how to get started:

Create a manifest by hand

Your appxmanifest.xml file needs to have the following content (at the minimum). Change placeholders that are formatted like ***THIS*** to actual values for your application.

    <?xml version="1.0" encoding="utf-8"?>
      <Identity Name="***YOUR_PACKAGE_NAME_HERE***"
        Publisher="CN=***COMPANY_NAME***, O=***ORGANIZATION_NAME***, L=***CITY***, S=***STATE***, C=***COUNTRY***"
        Version="***YOUR_PACKAGE_VERSION_HERE***" />
        <Description>No description entered</Description>
        <Resource Language="en-us" />
        <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.14316.0" />
        <rescap:Capability Name="runFullTrust"/>
        <Application Id="***YOUR_PRAID_HERE***" Executable="***YOUR_PACKAGE_RELATIVE_EXE_PATH_HERE***" EntryPoint="Windows.FullTrustApplication">
           Description="***YOUR_APP_DESCRIPTION_HERE***" />

Have unplated assets you'd like to add? See the section on unplated assets later in this article for details on how.

Run the MakeAppX tool

Use the App packager (MakeAppx.exe) to generate an AppX for your project. MakeAppx.exe is included with the Windows 10 SDK.

To run MakeAppx, first ensure you've created an manifest file as described above.

Next, create a mapping file. The file should start with [Files], then list each of your source files on disk followed by their destination path in the package. Here's an example:

"C:\MyApp\StartPage.htm"     "default.html"
"C:\MyApp\readme.txt"        "doc\readme.txt"
"\\MyServer\path\icon.png"   "icon.png"
"MyCustomManifest.xml"       "AppxManifest.xml"

Finally, run the following command:

MakeAppx.exe pack /f mapping_filepath /p filepath.appx

Sign your AppX package

The Add-AppxPackage cmdlet requires that the application package (.appx) being deployed must be signed. Use SignTool.exe, which ships in the Microsoft Windows 10 SDK, to sign the .appx package.

Example usage:

C:\> MakeCert.exe -r -h 0 -n "CN=<publisher_name>" -eku -pe -sv <my.pvk> <my.cer>
C:\> pvk2pfx.exe -pvk <my.pvk> -spc <my.cer> -pfx <my.pfx>
C:\> signtool.exe sign -f <my.pfx> -fd SHA256 -v .\<outputAppX>.appx

When you run MakeCert.exe and you're asked to enter a password, select none. For more info on certificates and signing, see the following:

Add unplated assets

Here's how to optionally configure the 44x44 assets for your app that show up on the taskbar.

  1. Obtain the correct 44x44 images and copy them into the folder that contains your images (i.e., Assets).

  2. For each 44x44 image, create a copy in the same folder and append .targetsize-44_altform-unplated to the file name. You should have two copies of each icon, each named in a specific way. For example, after completing the process, your assets folder might contain MYAPP_44x44.png and MYAPP_44x44.targetsize-44_altform-unplated.png (note: the former is the icon referenced in the appxmanifest under VisualElements attribute Square44x44Logo).

  3. In the AppXManifest, set the BackgroundColor for every icon you are fixing to transparent. This attribute can be found under VisualElements for each application.

  4. Open CMD, change directory to the package's root folder, and create a priconfig.xml file by running the command makepri createconfig /cf priconfig.xml /dq en-US.

  5. Using CMD, staying in the package’s root folder, create the resources.pri file(s) using the command makepri new /pr <PHYSICAL_PATH_TO_FOLDER> /cf <PHYSICAL_PATH_TO_FOLDER>\priconfig.xml. For example, the command for your app might look like makepri new /pr c:\MYAPP /cf c:\MYAPP\priconfig.xml.

  6. Package your AppX using the instructions in the next step to see the results.

© 2017 Microsoft