<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Msix on kenji.blog</title><link>http://kenji.blog/en/tags/msix/</link><description>Recent content in Msix on kenji.blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>kenjinote</copyright><lastBuildDate>Sat, 30 Aug 2025 04:18:04 +0900</lastBuildDate><atom:link href="http://kenji.blog/en/tags/msix/index.xml" rel="self" type="application/rss+xml"/><item><title>Installing an MSIX with a Self-Signed Certificate</title><link>http://kenji.blog/en/p/msix%E3%81%AB%E8%87%AA%E5%B7%B1%E8%A8%BC%E6%98%8E%E6%9B%B8%E3%82%92%E3%81%A4%E3%81%91%E3%81%A6%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%A7%E3%81%8D%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E3%81%99%E3%82%8B/</link><pubDate>Sat, 30 Aug 2025 04:18:04 +0900</pubDate><guid>http://kenji.blog/en/p/msix%E3%81%AB%E8%87%AA%E5%B7%B1%E8%A8%BC%E6%98%8E%E6%9B%B8%E3%82%92%E3%81%A4%E3%81%91%E3%81%A6%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%A7%E3%81%8D%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E3%81%99%E3%82%8B/</guid><description>&lt;img src="http://kenji.blog/p/msix%E3%81%AB%E8%87%AA%E5%B7%B1%E8%A8%BC%E6%98%8E%E6%9B%B8%E3%82%92%E3%81%A4%E3%81%91%E3%81%A6%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%A7%E3%81%8D%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E3%81%99%E3%82%8B/img.png" alt="Featured image of post Installing an MSIX with a Self-Signed Certificate" />&lt;h1 id="installing-an-msix-with-a-self-signed-certificate">Installing an MSIX with a Self-Signed Certificate
&lt;/h1>&lt;p>When distributing apps on Windows, using &lt;strong>MSIX packages&lt;/strong> is convenient because it unifies the installation and update mechanisms. However, MSIX has a restriction that it requires a &amp;ldquo;must be signed&amp;rdquo; certificate.
There may be situations where you want to test-distribute an app developed for a company or individually, but &amp;ldquo;purchasing a commercial code signing certificate is too much.&amp;rdquo;&lt;/p>
&lt;p>This is where a &lt;strong>Self-Signed Certificate&lt;/strong> comes in handy. In this article, we will summarize the steps to attach a self-signed certificate to an MSIX and make it installable in a local environment.&lt;/p>
&lt;hr>
&lt;h2 id="1-create-a-self-signed-certificate">1. Create a Self-Signed Certificate
&lt;/h2>&lt;p>First, launch PowerShell in administrator mode and run the following command.&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-powershell" data-lang="powershell">&lt;span class="line">&lt;span class="cl">&lt;span class="p">//&lt;/span> &lt;span class="n">Create&lt;/span> &lt;span class="n">a&lt;/span> &lt;span class="nb">self-signed&lt;/span> &lt;span class="n">certificate&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">New-SelfSignedCertificate&lt;/span> &lt;span class="n">-Type&lt;/span> &lt;span class="n">CodeSigningCert&lt;/span> &lt;span class="n">-Subject&lt;/span> &lt;span class="s2">&amp;#34;CN=035A9AAC-915B-4CE1-AE39-1A101BED42F5&amp;#34;&lt;/span> &lt;span class="n">-CertStoreLocation&lt;/span> &lt;span class="n">Cert&lt;/span>&lt;span class="err">:&lt;/span>&lt;span class="p">\&lt;/span>&lt;span class="n">CurrentUser&lt;/span>&lt;span class="p">\&lt;/span>&lt;span class="n">My&lt;/span> &lt;span class="n">-NotAfter&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nb">Get-Date&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="py">AddYears&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mf">10&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="n">-KeyUsage&lt;/span> &lt;span class="n">DigitalSignature&lt;/span> &lt;span class="n">-FriendlyName&lt;/span> &lt;span class="s2">&amp;#34;kenjinote&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>This creates a certificate for &amp;ldquo;code signing&amp;rdquo;.&lt;/p>
&lt;ul>
&lt;li>Giving it a descriptive name with &lt;code>-FriendlyName&lt;/code> makes it easier to find later.&lt;/li>
&lt;li>You can adjust the expiration date with &lt;code>-NotAfter&lt;/code>. Here it&amp;rsquo;s set to 10 years.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="2-export-the-pfx-file">2. Export the PFX File
&lt;/h2>&lt;p>Export the created certificate in PFX format so it can be used with &lt;code>signtool&lt;/code>.&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-powershell" data-lang="powershell">&lt;span class="line">&lt;span class="cl">&lt;span class="p">//&lt;/span> &lt;span class="n">Create&lt;/span> &lt;span class="n">pfx&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">$cert&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="nb">Get-ChildItem&lt;/span> &lt;span class="n">Cert&lt;/span>&lt;span class="err">:&lt;/span>&lt;span class="p">\&lt;/span>&lt;span class="n">CurrentUser&lt;/span>&lt;span class="p">\&lt;/span>&lt;span class="n">My&lt;/span> &lt;span class="p">|&lt;/span> &lt;span class="nb">Where-Object&lt;/span> &lt;span class="p">{&lt;/span> &lt;span class="nv">$_&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="py">FriendlyName&lt;/span> &lt;span class="o">-eq&lt;/span> &lt;span class="s2">&amp;#34;kenjinote&amp;#34;&lt;/span> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">$password&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="nb">ConvertTo-SecureString&lt;/span> &lt;span class="n">-String&lt;/span> &lt;span class="s2">&amp;#34;password&amp;#34;&lt;/span> &lt;span class="n">-Force&lt;/span> &lt;span class="n">-AsPlainText&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">Export-PfxCertificate&lt;/span> &lt;span class="n">-Cert&lt;/span> &lt;span class="nv">$cert&lt;/span> &lt;span class="n">-FilePath&lt;/span> &lt;span class="s2">&amp;#34;D:\pfx\cert.pfx&amp;#34;&lt;/span> &lt;span class="n">-Password&lt;/span> &lt;span class="nv">$password&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>The password set here (e.g., &lt;code>password&lt;/code>) will be required later for signing operations.&lt;/p>
&lt;hr>
&lt;h2 id="3-install-the-self-signed-certificate-to-trusted-root-certification-authorities">3. Install the Self-Signed Certificate to Trusted Root Certification Authorities
&lt;/h2>&lt;p>The created certificate won&amp;rsquo;t be trusted by Windows as is. To install it, you need to import it into &lt;strong>[Trusted Root Certification Authorities] -&amp;gt; [Certificates]&lt;/strong> from &lt;code>certmgr.msc&lt;/code>.&lt;/p>
&lt;p>If you import the exported certificate (&lt;code>.cer&lt;/code> or &lt;code>.pfx&lt;/code>), it will be treated as a trusted certificate on the target PC.
This prevents the &amp;ldquo;untrusted certificate&amp;rdquo; warning when signing an MSIX.&lt;/p>
&lt;hr>
&lt;h2 id="4-sign-the-installer-msix">4. Sign the Installer (MSIX)
&lt;/h2>&lt;p>Finally, use the created PFX certificate to sign the MSIX. &lt;code>signtool&lt;/code> is included with Visual Studio and the Windows SDK.&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-powershell" data-lang="powershell">&lt;span class="line">&lt;span class="cl">&lt;span class="p">//&lt;/span> &lt;span class="n">Sign&lt;/span> &lt;span class="n">the&lt;/span> &lt;span class="n">installer&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">signtool&lt;/span> &lt;span class="n">sign&lt;/span> &lt;span class="p">/&lt;/span>&lt;span class="n">fd&lt;/span> &lt;span class="n">SHA256&lt;/span> &lt;span class="p">/&lt;/span>&lt;span class="n">f&lt;/span> &lt;span class="s2">&amp;#34;D:\pfx\cert.pfx&amp;#34;&lt;/span> &lt;span class="p">/&lt;/span>&lt;span class="n">p&lt;/span> &lt;span class="s2">&amp;#34;password&amp;#34;&lt;/span> &lt;span class="s2">&amp;#34;C:\installer\installer.msix&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;ul>
&lt;li>&lt;code>/fd SHA256&lt;/code> specifies the signature algorithm.&lt;/li>
&lt;li>&lt;code>/f&lt;/code> specifies the PFX file, and &lt;code>/p&lt;/code> passes the password.&lt;/li>
&lt;li>Finally, specify the path to the MSIX file.&lt;/li>
&lt;li>If signtool is not in your path, specify the full path. In my environment, it was in the following location:&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-gdscript3" data-lang="gdscript3">&lt;span class="line">&lt;span class="cl">&lt;span class="s2">&amp;#34;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\microsoft.windows.sdk.buildtools&lt;/span>&lt;span class="se">\10&lt;/span>&lt;span class="s2">.0.26100.1742&lt;/span>&lt;span class="se">\b&lt;/span>&lt;span class="s2">in&lt;/span>&lt;span class="se">\10&lt;/span>&lt;span class="s2">.0.26100.0&lt;/span>&lt;span class="se">\x64&lt;/span>&lt;span class="s2">\signtool.exe&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>This completes the signing, and the installable MSIX for the target PC is ready.&lt;/p>
&lt;hr>
&lt;h2 id="summary">Summary
&lt;/h2>&lt;ul>
&lt;li>Create a self-signed certificate with &lt;strong>New-SelfSignedCertificate&lt;/strong>&lt;/li>
&lt;li>Export the PFX with &lt;strong>Export-PfxCertificate&lt;/strong>&lt;/li>
&lt;li>Install the certificate in &lt;strong>Trusted Root Certification Authorities&lt;/strong>&lt;/li>
&lt;li>Sign the MSIX with &lt;strong>signtool&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>By following this flow, you can test operations and distribute locally without buying a commercial certificate.
Of course, a certificate issued by a Certificate Authority is essential for actual commercial distribution, but this method is very convenient during the development and verification stages.&lt;/p>
&lt;hr>
&lt;p>👉 In this example, we used installer.msix, but the same procedure applies to your own custom apps.&lt;/p>
&lt;hr></description></item></channel></rss>