<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SignTool on Remko's Blog</title><link>https://remkoweijnen.nl/blog/tags/signtool/</link><description>Recent content in SignTool on Remko's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 19 Jan 2018 17:54:49 +0000</lastBuildDate><atom:link href="https://remkoweijnen.nl/blog/tags/signtool/index.xml" rel="self" type="application/rss+xml"/><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>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>