<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>UWP on Remko's Blog</title><link>https://remkoweijnen.nl/blog/tags/uwp/</link><description>Recent content in UWP on Remko's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 22 Mar 2018 11:54:54 +0000</lastBuildDate><atom:link href="https://remkoweijnen.nl/blog/tags/uwp/index.xml" rel="self" type="application/rss+xml"/><item><title>DesktopAppConverter : error 'E_MANIFEST_USE_DEFAULT_VALUE_FAILED</title><link>https://remkoweijnen.nl/blog/2018/03/22/desktopappconverter-error-e_manifest_use_default_value_failed/</link><pubDate>Thu, 22 Mar 2018 11:54:54 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2018/03/22/desktopappconverter-error-e_manifest_use_default_value_failed/</guid><description>&lt;p&gt;I had a strange error today using the Desktop App Converter with the parameters given from the Store for Business.&lt;/p&gt;
&lt;p&gt;The conversion would fail with the following error:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2018/03/image.webp" class="glightbox" data-type="image" data-gallery="post-4302"&gt;&lt;img loading="lazy" decoding="async" style="display: inline;" title="DesktopAppConverter" src="https://remkoweijnen.nl/blog/wp-content/uploads/2018/03/image_thumb.webp" alt="DesktopAppConverter : error 'E_MANIFEST_USE_DEFAULT_VALUE_FAILED': Property 'Package.Applications.Application.Id' in AppxManifest.xml could not be set to the default value" width="436" height="73" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not sure why this fails as the PackageName is provided by the store and should be valid. An answer on stackoverflow suggested to use a different value for the PackageName parameter and then edit the manifest.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t like this method as manual modifications of the manifest often leads to errors when submitting the application to the store.&lt;/p&gt;
&lt;p&gt;So let&amp;rsquo;s have a look and see why we&amp;rsquo;re getting this error.&lt;/p&gt;
&lt;p&gt;I searched for &lt;code&gt;E_MANIFEST_USE_DEFAULT_VALUE_FAILED&lt;/code&gt; in the DesktopAppConverter folder and found 1 occurence in &lt;code&gt;ManifestOps.ps1&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;From a look at the code it wasn&amp;rsquo;t immediately clear where the validation failed so I decided to debug it.&lt;/p&gt;</description></item><item><title>signtool sign returns error 0x800700C1</title><link>https://remkoweijnen.nl/blog/2018/01/19/signtool-sign-returns-error-0x800700c1/</link><pubDate>Fri, 19 Jan 2018 17:54:49 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2018/01/19/signtool-sign-returns-error-0x800700c1/</guid><description>&lt;p&gt;I was trying to sign an .appx package that I created with the Desktop App Converter. However signtool returned the following error: Sign returned error: &lt;code&gt;0x800700C1 For more information, please see http://aka.ms/badexeformat&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2018/01/image-13.webp" class="glightbox" data-type="image" data-gallery="post-4289"&gt;&lt;img loading="lazy" decoding="async" style="display: inline;" title="Signtool: Sign returned error: 0x800700C1 | For more information, please see http://aka.ms/badexeformat" src="https://remkoweijnen.nl/blog/wp-content/uploads/2018/01/image_thumb-13.webp" alt="image" width="437" height="82" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sadly signtool doesn&amp;rsquo;t return more detailed information, even when passing the debug switch:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2018/01/image-14.webp" class="glightbox" data-type="image" data-gallery="post-4289"&gt;&lt;img loading="lazy" decoding="async" style="display: inline;" title="image" src="https://remkoweijnen.nl/blog/wp-content/uploads/2018/01/image_thumb-14.webp" alt="image" width="434" height="322" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So what&amp;rsquo;s going on?&lt;/p&gt;</description></item><item><title>How to use a comma in the Publisher field when using the Desktop App Converter</title><link>https://remkoweijnen.nl/blog/2018/01/16/use-comma-publisher-field-using-desktop-app-converter/</link><pubDate>Tue, 16 Jan 2018 14:55:51 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2018/01/16/use-comma-publisher-field-using-desktop-app-converter/</guid><description>&lt;p&gt;&lt;img style="margin: 0px 7px 0px 0px; float: left; display: inline;" src="https://docs.microsoft.com/en-us/windows/uwp/porting/images/desktop-to-uwp/dac.png" alt="DAC Icon" width="73" height="73" align="left" /&gt;When using the Desktop App Converter there&amp;rsquo;s no need to sign the resulting .appx packages with your own code signing certificate when you submit them to the Store.&lt;/p&gt;
&lt;p&gt;However if you want to test the package on a different machine or distribute it to test users you may want to sign the .appx with a certificate.&lt;/p&gt;
&lt;p&gt;One option is to use the &lt;code&gt;-sign&lt;/code&gt; parameter, in this case the Desktop App Converter generates a code signing certificate and signs the package with it. Although easy to use, it&amp;rsquo;s not very convenient if you want to distribute the .appx as you need to add the certificate to the &lt;code&gt;Trusted People&lt;/code&gt; certificates store (for each user). See &lt;a href="https://docs.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-run-desktop-app-converter#run-app" target="_blank" rel="noopener"&gt;Run the Packaged App&lt;/a&gt; in the documentation.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2018/01/image-1.webp" class="glightbox" data-type="image" data-gallery="post-4243"&gt;&lt;img loading="lazy" decoding="async" style="margin: 0px 3px 0px 0px; float: right; display: inline;" title="image" src="https://remkoweijnen.nl/blog/wp-content/uploads/2018/01/image_thumb-1.webp" alt="image" width="95" height="95" align="right" /&gt;&lt;/a&gt;If you want to sign the .appx package with a trusted certificate (e.g. issued by a trusted certificate authority such as &lt;a href="https://www.digicert.com/code-signing/" target="_blank" rel="noopener"&gt;DigiCert&lt;/a&gt;) you need to make sure that you pass the subject (the CN) from your code signing certificate to the Desktop App Converter (using the &lt;code&gt;-Publisher&lt;/code&gt; parameter).&lt;/p&gt;</description></item><item><title>Sign APPX packages with PowerShell</title><link>https://remkoweijnen.nl/blog/2017/12/20/sign-appx-packages-powershell/</link><pubDate>Wed, 20 Dec 2017 15:00:33 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2017/12/20/sign-appx-packages-powershell/</guid><description>&lt;p&gt;I have been working with Microsoft&amp;rsquo;s Desktop App Converter a lot recently. Even though there&amp;rsquo;s an option to autosign the resulting package with the &lt;code&gt;-Sign&lt;/code&gt; switch I prefer to sign APPX packages myself using signtool.&lt;/p&gt;
&lt;p&gt;The reason is that I can send UWP packages to testers for sideloading without requiring them to import the auto generated certificate (which is different on each (re)build).&lt;/p&gt;
&lt;p&gt;However I always forget the exact path to signtool.exe (this comes with the &lt;a href="https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk" target="_blank" rel="noopener"&gt;Windows SDK&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The Windows 10 SDK is installed by default in &lt;code&gt;C:\Program Files (x86)\Windows Kits\10&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Signtool.exe will be in the folder &lt;code&gt;&amp;lt;sdkpath&amp;gt;\bin\&amp;lt;version&amp;gt;\&amp;lt;platform&amp;gt;\signtool.exe&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;As there are multiple version of Windows 10 there are multiple version of the SDK and you can install those concurrently.&lt;/p&gt;
&lt;p&gt;But then I found the PowerShell cmdlet &lt;a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/resolve-path?view=powershell-3.0" target="_blank" rel="noopener"&gt;Resolve-Path&lt;/a&gt; which &amp;ldquo;Resolves the wildcard characters in a path, and displays the path contents&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;This does exactly what I need:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://remkoweijnen.nl/blog/wp-content/uploads/2017/12/image-5.webp" class="glightbox" data-type="image" data-gallery="post-4204"&gt;&lt;img loading="lazy" decoding="async" style="display: inline;" title="image" src="https://remkoweijnen.nl/blog/wp-content/uploads/2017/12/image_thumb-5.webp" alt="image" width="433" height="83" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Wow, Resolve-Path is a perfect example of the many hidden gems in PowerShell!&lt;/p&gt;
&lt;p&gt;So I decided to wrap signtool.exe in a PowerShell cmdlet as PowerShell also makes it easy to locate the correct code signing certificate from the certificate store.&lt;/p&gt;</description></item></channel></rss>