<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hocine Abdellatif Houari</title>
    <description>The latest articles on DEV Community by Hocine Abdellatif Houari (@hahouari).</description>
    <link>https://dev.to/hahouari</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F874972%2F4a128696-661a-4aee-a66b-2dc53b338759.jpeg</url>
      <title>DEV Community: Hocine Abdellatif Houari</title>
      <link>https://dev.to/hahouari</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hahouari"/>
    <language>en</language>
    <item>
      <title>Creating Easy Windows Installers for Flutter Apps with Inno Bundle</title>
      <dc:creator>Hocine Abdellatif Houari</dc:creator>
      <pubDate>Thu, 21 Dec 2023 04:33:54 +0000</pubDate>
      <link>https://dev.to/hahouari/creating-easy-windows-installer-for-flutter-apps-using-inno-bundle-5df3</link>
      <guid>https://dev.to/hahouari/creating-easy-windows-installer-for-flutter-apps-using-inno-bundle-5df3</guid>
      <description>&lt;p&gt;Every Flutter project follows a familiar journey: coding, designing, testing, and sharing that masterpiece with the world. That final step however differs for every platform. On Android, we used to build APK or AAB files that are either distributed as is or uploaded to Play Store. With IOS and AppStore is a similar story. But when it comes to Desktop, specifically Windows which holds ~69% of &lt;a href="https://gs.statcounter.com/os-market-share/desktop/worldwide" rel="noopener noreferrer"&gt;Desktop Market share worldwide&lt;/a&gt;, this step presents a hurdle. Enter the world of desktop Installer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying MSIX: Powerful, But My Simple EXE Cried
&lt;/h2&gt;

&lt;p&gt;MSIX seemed to be the only option that stands out for building Windows Installers. The docs were a treat. But when crafting the Installer for my client, the complexity left me scratching my head.&lt;/p&gt;

&lt;p&gt;It's a great pick for those targeting Microsoft Store, for its customization and adhering to Windows Standards. My biggest pain with it was the Signed certificates! Unfortunately, Windows Home edition (my case) doesn't allow creating certificates, yet they are required (Security measures) for other users to be able to use my installer, and the commands to generate them are not friendly at all. The decision was made to look for alternatives, to find none, so I had to create one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Welcome Inno Bundle
&lt;/h2&gt;

&lt;p&gt;Inno Bundle is a command-line tool that simplifies bundling your app into an EXE installer for Microsoft Windows. The package will figure out the metadata like app version and description, etc. With friendly customizability, and easy steps to follow.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Download Inno Setup
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Option 1: Using winget&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;

&lt;span class="nf"&gt;winget&lt;/span&gt; &lt;span class="nf"&gt;install&lt;/span&gt; &lt;span class="nf"&gt;-e&lt;/span&gt; &lt;span class="nf"&gt;--id&lt;/span&gt; &lt;span class="nf"&gt;JRSoftware.InnoSetup&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Option 2: Download installer from website&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Visit &lt;a href="https://jrsoftware.org/isdl.php" rel="noopener noreferrer"&gt;the official Inno Setup website&lt;/a&gt;.&lt;br&gt;
Download the latest version (tested with 6.2.2) and install it on your machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Add &lt;code&gt;inno_bundle&lt;/code&gt; package to your project
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

dart pub add dev:inno_bundle


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  3. Give Your App a Unique Identity
&lt;/h3&gt;

&lt;p&gt;To generate a random id run:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

dart run inno_bundle:id


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Or base it upon a namespace:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

dart run inno_bundle:id &lt;span class="nt"&gt;--ns&lt;/span&gt; &lt;span class="s2"&gt;"www.example.com"&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The output id is going to be something similar to this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;f887d5f0-4690-1e07-8efc-d16ea7711bfb&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Copy &amp;amp; Paste the output to your &lt;code&gt;pubspec.yaml&lt;/code&gt; as shown in the next step. &lt;/p&gt;

&lt;h3&gt;
  
  
  4. Set up the Configuration
&lt;/h3&gt;

&lt;p&gt;Add your configuration to your &lt;code&gt;pubspec.yaml&lt;/code&gt;. example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;

&lt;span class="na"&gt;inno_bundle&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;&amp;nbsp;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;f887d5f0-4690-1e07-8efc-d16ea7711bfb&lt;/span&gt; &lt;span class="c1"&gt;# &amp;lt;-- Put your own generated id here&lt;/span&gt;
&lt;span class="na"&gt;&amp;nbsp;publisher&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Your Name&lt;/span&gt; &lt;span class="c1"&gt;# Optional, but recommended.&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Make sure you do not change your id after first deployment, if you do, when the end-user tries to update your app, his machine will recognize the update as a different app due to different AppId, he will have later to uninstall the old version manually.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  5. Build Time
&lt;/h3&gt;

&lt;p&gt;With configuration in place, let the magic happen:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

dart run inno_bundle:build &lt;span class="nt"&gt;--release&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The command will build the app, then build the installer. The installer should generate on &lt;code&gt;&amp;lt;project-dir&amp;gt;\build\windows\x64\installer\Release&lt;/code&gt; folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Feature
&lt;/h2&gt;

&lt;p&gt;All flutter apps on windows face an issue to run on end users machine that are missing MS C++ Visual Redistributable. The issue will appear as some DLL files missing:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcbvex3sexv2c7vto6mk8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcbvex3sexv2c7vto6mk8.png" alt="vcruntime140d.dll is missing"&gt;&lt;/a&gt;&lt;br&gt;
These DLL files &lt;code&gt;msvcp140.dll&lt;/code&gt;, &lt;code&gt;vcruntime140.dll&lt;/code&gt;, &lt;code&gt;vcruntime140_1.dll&lt;/code&gt; are also bundled automatically with the app when creating the installer, saving you a precious time.&lt;/p&gt;

&lt;p&gt;For more customized installer, checkout &lt;a href="https://github.com/hahouari/inno_bundle#other-configuration-examples" rel="noopener noreferrer"&gt;available attributes&lt;/a&gt;, and &lt;a href="https://github.com/hahouari/inno_bundle#other-configuration-examples" rel="noopener noreferrer"&gt;other configuration examples&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That's it! Hope this package provides better experience to Flutter developers. If you find it useful please hit the ❤️ button&lt;br&gt;
Cheers.&lt;/p&gt;

&lt;h2&gt;
  
  
  About the Author
&lt;/h2&gt;

&lt;p&gt;A Flutter and Web apps developer, Member of Web development team, and a lead developer on Flutter team. Giving back to community on free time. Answering for the unaddressed, for the sake of a shared future.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>package</category>
      <category>windows</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
