<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sweta jha on Medium]]></title>
        <description><![CDATA[Stories by Sweta jha on Medium]]></description>
        <link>https://medium.com/@sweta.j?source=rss-b5a1755bab13------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EWea27i55MUYa1QPVU4R2g.png</url>
            <title>Stories by Sweta jha on Medium</title>
            <link>https://medium.com/@sweta.j?source=rss-b5a1755bab13------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:31:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sweta.j/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[WIX Installer Setup Creation]]></title>
            <link>https://medium.com/simform-engineering/wix-installer-setup-creation-26634ce24e60?source=rss-b5a1755bab13------2</link>
            <guid isPermaLink="false">https://medium.com/p/26634ce24e60</guid>
            <dc:creator><![CDATA[Sweta jha]]></dc:creator>
            <pubDate>Thu, 17 Oct 2024 09:18:13 GMT</pubDate>
            <atom:updated>2024-10-17T09:18:13.357Z</atom:updated>
            <content:encoded><![CDATA[<h4>Creating MSI Installation Packages Using the WiX Toolset</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uhx8zZQZzn2xQtfzjCQqUA.png" /></figure><p><strong>WiX </strong>(<em>Windows Installer XML</em>) is an open-source toolset that enables developers to build Windows installation packages (<em>MSI files</em>) through XML-based configurations.</p><p>It provides a declarative way of defining an installer for Windows applications, giving fine-grained control over the installation process, including file placement, registry entries, environment variables and custom actions.</p><p><strong>WiX </strong>simplifies the creation of MSI packages by allowing developers to describe the installation behavior in an XML file and then compile it into an MSI. It integrates well with build tools like MSBuild and Visual Studio, making it popular for enterprise-level installations or custom installer requirements.</p><h3>Key Features of the WiX Installer Toolset</h3><ol><li><strong>Declarative Syntax:</strong> Uses XML to define how files, services, shortcuts and other elements are installed on the target machine.</li><li><strong>Custom Actions:</strong> Allows execution of custom scripts or code during installation (such as running database migrations or registering services).</li><li><strong>Upgrades and Patching:</strong> Handles versioning and upgrading of installed software, ensuring smooth transitions between software versions.</li><li><strong>Upgrades and Patching:</strong> Handles versioning and upgrading of installed software, ensuring smooth transitions between software versions.</li><li><strong>Integration with Visual Studio:</strong> Provides templates and a seamless experience in Visual Studio for creating setup projects.</li></ol><h3><strong>Advantages </strong>of the WiX Installer Toolset</h3><ol><li><strong>Fine-Grained Control:</strong> Detailed control over the installation process, including file locations and system settings.</li><li><strong>Flexibility:</strong> Allows complex installation scenarios that may not be possible with standard installer technologies.</li><li><strong>Enterprise-Ready:</strong> Suitable for enterprise-level software installations requiring robust and customizable installers.</li><li><strong>Integration:</strong> Seamless integration with Visual Studio and build tools like MS Build.</li></ol><h3><strong>Use Cases</strong></h3><ol><li><strong>Precise Control:</strong> When detailed control over the installation process is required.</li><li><strong>Enterprise Software:</strong> For robust installation routines in enterprise environments.</li><li><strong>Custom Installers:</strong> When standard installer technologies like Visual Studio Setup Projects do not provide enough flexibility.</li></ol><h3><strong>Example Code</strong></h3><h4><strong>Prerequisites:</strong></h4><h4><strong>1. Create WPF Application</strong></h4><ul><li>Launch Visual Studio and navigate to <strong>File &gt; New &gt; Project</strong>.</li><li>In the “Create a new project” window, search for <strong>WPF App</strong>, select it, and then click <strong>Next</strong>.</li></ul><h4><strong>2. Download WiX Toolset:</strong></h4><ul><li>Download from the <a href="https://wixtoolset.org/docs/wix3/">WiX Toolset Portal</a>.</li><li>Launch the downloaded installer and follow the on-screen instructions to finish the installation.</li></ul><h3><strong>Steps to Create an MSI Setup Installer:</strong></h3><h4><strong>1. Create WIX Setup Application</strong></h4><p>Open Visual Studio, select “Create a new project” and choose the <strong>Setup Project</strong> template for <em>Wix</em>. Click <strong>Next</strong> then set the Project Name and configure any additional settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*R6ny_IyniZHcjhdY4KAeRA.png" /><figcaption>Setup Project Template Creation</figcaption></figure><p>The project will include a default <em>Product.wxs</em> file, which outlines the fundamental structure of the installer, such as the product ID, version, and manufacturer details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*eD-L8KXtq980Lp2hVZqFEw.png" /><figcaption>Default Project structure after creating Wix Setup &amp; WPF Project</figcaption></figure><p>The default content of the <em>Product.wxs</em> file looks something like this:</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;Wix xmlns=&quot;http://schemas.microsoft.com/wix/2006/wi&quot;&gt;<br> &lt;Product Id=&quot;*&quot; Name=&quot;Sample.WixSetupInstaller&quot; Language=&quot;1033&quot; Version=&quot;1.0.0.0&quot; Manufacturer=&quot;&quot; UpgradeCode=&quot;fe6443d2-e860-4743-b23a-3430f1f24390&quot;&gt;<br>  &lt;Package InstallerVersion=&quot;200&quot; Compressed=&quot;yes&quot; InstallScope=&quot;perMachine&quot; /&gt;<br><br>  &lt;MajorUpgrade DowngradeErrorMessage=&quot;A newer version of [ProductName] is already installed.&quot; /&gt;<br>  &lt;MediaTemplate /&gt;<br><br>  &lt;Feature Id=&quot;ProductFeature&quot; Title=&quot;Sample.WixSetupInstaller&quot; Level=&quot;1&quot;&gt;<br>   &lt;ComponentGroupRef Id=&quot;ProductComponents&quot; /&gt;<br>  &lt;/Feature&gt;<br> &lt;/Product&gt;<br><br> &lt;Fragment&gt;<br>  &lt;Directory Id=&quot;TARGETDIR&quot; Name=&quot;SourceDir&quot;&gt;<br>   &lt;Directory Id=&quot;ProgramFilesFolder&quot;&gt;<br>    &lt;Directory Id=&quot;INSTALLFOLDER&quot; Name=&quot;Sample.WixSetupInstaller&quot; /&gt;<br>   &lt;/Directory&gt;<br>  &lt;/Directory&gt;<br> &lt;/Fragment&gt;<br><br> &lt;Fragment&gt;<br>  &lt;ComponentGroup Id=&quot;ProductComponents&quot; Directory=&quot;INSTALLFOLDER&quot;&gt;<br>   &lt;!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. --&gt;<br>   &lt;!-- &lt;Component Id=&quot;ProductComponent&quot;&gt; --&gt;<br>    &lt;!-- TODO: Insert files, registry keys, and other resources here. --&gt;<br>   &lt;!-- &lt;/Component&gt; --&gt;<br>  &lt;/ComponentGroup&gt;<br> &lt;/Fragment&gt;<br>&lt;/Wix&gt;</pre><ul><li><strong>&lt;Product&gt;:</strong> Defines the product’s metadata (ID, name, language, version, manufacturer) and upgrade rules.</li><li><strong>&lt;Package&gt;: </strong>Specifies packaging options like installer version, compression, and install scope.</li><li><strong>&lt;MajorUpgrade&gt;</strong>: Manages upgrades, preventing installation of older versions over newer ones.</li><li><strong>&lt;MediaTemplate&gt;:</strong> Defines how the media (files) for the installer is created and stored.</li><li><strong>&lt;Feature&gt;:</strong> Groups components under “ProductFeature” that are installed together.</li><li><strong>&lt;ComponentGroupRef&gt;</strong>: References the ComponentGroup that includes the components to be installed.</li><li><strong>&lt;Fragment&gt;:</strong> Breaks the WiX file into reusable parts; defines directories and components.</li><li><strong>&lt;Directory&gt;: </strong>Specifies the directory structure for installation, with “INSTALLFOLDER” under ProgramFilesFolder.</li><li><strong>&lt;ComponentGroup&gt;: </strong>Placeholder for the components (files, registry keys, etc.) to be installed in the “INSTALLFOLDER.”</li></ul><h4><strong>2. Include a project reference for the WPF application in the setup installer project.</strong></h4><ul><li><strong>Right-click</strong> on the <strong>setup installer project</strong> in Solution Explorer.</li><li>Select “<strong>Add</strong>” and then “<strong>Reference</strong>” from the context menu.</li><li>In the <strong>Reference Manager</strong> window, go to the <strong>Projects</strong> tab.</li><li>Choose the WPF application project from the list of available options.</li><li>Click <strong>OK</strong> to add the reference.</li></ul><p>This will include the WPF application in the installer project, ensuring it can be packaged and deployed with the setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*hl3B6Bg4o6O1qXQbNnmRBA.png" /><figcaption>Add Project Reference to your setup project</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*T04uInDl3bwDLisrcGusAw.png" /></figure><h4><strong>3. Unload the Setup Installer Project</strong></h4><p>To unload the setup installer project and access the .<em>wixproj </em>file for predefined configurations, follow these steps:</p><ul><li><strong>Right-click</strong> on the <strong>setup installer project</strong> in Solution Explorer.</li><li>Select <strong>Unload </strong>Project from the context menu.</li><li>Once unloaded, <strong>right-click</strong> again on the project and select <strong>Edit <em>[ProjectName].wixpro</em>j</strong>.</li></ul><p>This will open the .<em>wixproj </em>file, where you can view and modify predefined configurations for the installer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*39g9EQekaT8zpRy0jO-jRg.png" /><figcaption>Unload Setup Project</figcaption></figure><h4><strong>4. Configuring Harvesting:</strong></h4><p>The default configuration for a WiX project is set up in the &lt;Project&gt; XML element, including basic project properties and MSBuild settings:</p><h4><strong>Default Configurations:</strong></h4><ul><li><strong>Project Properties</strong>: Sets the default configuration to Debug, platform to x86 and specifies output paths and product details.</li><li><strong>Import Statements</strong>: Includes WiX targets for building the project and checks for the installation of the WiX Toolset.</li></ul><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; <br><br>&lt;Project ToolsVersion=&quot;4.0&quot; DefaultTargets=&quot;Build&quot; InitialTargets=&quot;EnsureWixToolsetInstalled&quot; <br><br>         xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt; <br><br>  &lt;PropertyGroup&gt; <br><br>    &lt;Configuration Condition=&quot; &#39;$(Configuration)&#39; == &#39;&#39; &quot;&gt;Debug&lt;/Configuration&gt; <br><br>    &lt;Platform Condition=&quot; &#39;$(Platform)&#39; == &#39;&#39; &quot;&gt;x86&lt;/Platform&gt; <br><br>    &lt;ProductVersion&gt;3.10&lt;/ProductVersion&gt; <br><br>    &lt;ProjectGuid&gt;1900d58f-d6b4-400f-a262-a2717d7389ec&lt;/ProjectGuid&gt; <br><br>    &lt;SchemaVersion&gt;2.0&lt;/SchemaVersion&gt; <br><br>    &lt;OutputName&gt;Sample.WixSetupInstaller&lt;/OutputName&gt; <br><br>    &lt;OutputType&gt;Package&lt;/OutputType&gt; <br><br>  &lt;/PropertyGroup&gt; <br><br>  &lt;PropertyGroup Condition=&quot; &#39;$(Configuration)|$(Platform)&#39; == &#39;Debug|x86&#39; &quot;&gt; <br><br>    &lt;OutputPath&gt;bin\$(Configuration)\&lt;/OutputPath&gt; <br><br>    &lt;IntermediateOutputPath&gt;obj\$(Configuration)\&lt;/IntermediateOutputPath&gt; <br><br>    &lt;DefineConstants&gt;Debug&lt;/DefineConstants&gt; <br><br>  &lt;/PropertyGroup&gt; <br><br>  &lt;PropertyGroup Condition=&quot; &#39;$(Configuration)|$(Platform)&#39; == &#39;Release|x86&#39; &quot;&gt; <br><br>    &lt;OutputPath&gt;bin\$(Configuration)\&lt;/OutputPath&gt; <br><br>    &lt;IntermediateOutputPath&gt;obj\$(Configuration)\&lt;/IntermediateOutputPath&gt; <br><br>  &lt;/PropertyGroup&gt; <br><br>  &lt;ItemGroup&gt; <br><br>    &lt;Compile Include=&quot;Product.wxs&quot; /&gt; <br><br>  &lt;/ItemGroup&gt; <br><br>  &lt;Import Project=&quot;$(WixTargetsPath)&quot; Condition=&quot; &#39;$(WixTargetsPath)&#39; != &#39;&#39; &quot; /&gt; <br><br>  &lt;Import Project=&quot;$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets&quot; <br><br>          Condition=&quot; &#39;$(WixTargetsPath)&#39; == &#39;&#39; AND Exists(&#39;$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets&#39;) &quot; /&gt; <br><br>  &lt;Target Name=&quot;EnsureWixToolsetInstalled&quot; Condition=&quot; &#39;$(WixTargetsImported)&#39; != &#39;true&#39; &quot;&gt; <br><br>    &lt;Error Text=&quot;The WiX Toolset v3.11 build tools must be installed to build this project. <br><br>           To download the WiX Toolset, see https://wixtoolset.org/releases/v3.11/stable&quot; /&gt; <br><br>  &lt;/Target&gt; <br><br>&lt;/Project&gt; </pre><h4><strong>Added Harvesting Configurations:</strong></h4><pre>&lt;Target Name=&quot;BeforeBuild&quot;&gt; <br><br>  &lt;!-- Use HeatDirectory to harvest files from the specified directory --&gt; <br><br>  &lt;HeatDirectory OutputFile=&quot;$(ProjectDir)\ProductInstallFiles.wxs&quot; RunAsSeparateProcess=&quot;true&quot; <br><br>                 Directory=&quot;$(HarvestDirectory)&quot; ComponentGroupName=&quot;ProductFilesComponentGroup&quot; <br><br>                 DirectoryRefId=&quot;INSTALLFOLDER&quot; AutogenerateGuids=&quot;true&quot; SuppressRegistry=&quot;true&quot; <br><br>                 SuppressRootDirectory=&quot;true&quot; ToolPath=&quot;$(WixToolPath)&quot; NoLogo=&quot;true&quot; /&gt; <br><br>  &lt;!-- Extract assembly version from the specified DLL --&gt; <br><br>  &lt;GetAssemblyIdentity AssemblyFiles=&quot;..\WpfApplication\bin\Release\net8.0-windows\publish\WPFSampleApplication.dll&quot;&gt; <br><br>    &lt;Output TaskParameter=&quot;Assemblies&quot; ItemName=&quot;AssemblyVersion&quot; /&gt; <br><br>  &lt;/GetAssemblyIdentity&gt; <br><br>  &lt;!-- Define constants for use in the WiX script --&gt; <br><br>  &lt;PropertyGroup&gt; <br><br>    &lt;DefineConstants&gt;$(DefineConstants);BuildVersion=%(AssemblyVersion.Version);BasePath=..\WPFSampleApplication\bin\Release\net8.0-windows\publish&lt;/DefineConstants&gt; <br><br>  &lt;/PropertyGroup&gt; <br><br>&lt;/Target&gt; <br><br>&lt;PropertyGroup&gt; <br><br>  &lt;!-- Specify the directory to harvest files from --&gt; <br><br>  &lt;HarvestDirectory&gt;..\WPFSampleApplication\bin\Release\net8.0-windows\publish&lt;/HarvestDirectory&gt; <br><br>  &lt;!-- Define additional constants for Release configuration targeting x64 --&gt; <br><br>  &lt;DefineConstants Condition=&quot; &#39;$(Configuration)|$(Platform)&#39; == &#39;Release|x64&#39; &quot;&gt;HarvestPath=..\WPFSampleApplication\bin\Release\net8.0-windows\publish&lt;/DefineConstants&gt; <br><br>&lt;/PropertyGroup&gt; </pre><h4><strong>Added Configurations:</strong></h4><ul><li><strong>HeatDirectory Task</strong>: Harvests files from the specified HarvestDirectory (the publish folder of the WPF application) and generates a .<em>wxs </em>file to include in the installer.</li><li><strong>GetAssemblyIdentity Task</strong>: Extract the version of the <em>WPFSampleApplication.dll</em> to use in the installer script.</li><li><strong>DefineConstants PropertyGroup</strong>: Sets constants such as BuildVersion and BasePath based on the extracted assembly version and directory path.</li><li><strong>HarvestDirectory PropertyGroup</strong>: Specifies the directory for harvesting files and defines additional constants for different build configurations (e.g., targeting x64).</li></ul><p>Ensure <em>ProductInstallFiles.wxs</em> is included in the WiX setup to package all necessary files.</p><p>These configurations ensure the WiX project can dynamically include files from the WPF application’s publish folder and correctly configure versioning and paths in the installer script.</p><h4><strong>5. Add References and Configure Build Settings</strong></h4><ul><li><strong>Add References</strong>: In your Visual Studio solution, add references to the WiX Toolset binaries. Locate the WiX Toolset installation directory (e.g., C:\Program Files (x86)\WiX Toolset v3.x\bin) and add references to <em>WixUIExtension.dll </em>and <em>WixUtilExtension.dll</em>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*qF4BCgrGaP4Q4tW-y1LkdA.png" /><figcaption>Adding Dll’s References</figcaption></figure><ul><li><strong>Configure Build Settings</strong>: Open the Configuration Manager in Visual Studio and ensure that your project’s build configuration is set to either x86 or x64, depending on your target platform.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*6F1mywHP-SpWUxK-g57E_w.png" /><figcaption>Set the build configuration depending on your target platform</figcaption></figure><ul><li><strong>Verify and Build</strong>: Double-check your <em>Product.wxs</em> file and other WiX configuration files for accuracy. Then, build the solution to generate the MSI installer, including the harvested files and configured settings.</li></ul><h4><strong>6. Update Product.wxs File to Configure Installer Features.</strong></h4><p>Update your <em>Product.wxs</em> file to include configuration for the installer directory, program menu, shortcut, app icon, and custom actions for launching the application. Here is the updated XML configuration:</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; <br><br>&lt;Wix xmlns=&quot;http://schemas.microsoft.com/wix/2006/wi&quot;&gt; <br><br>    &lt;Product Id=&quot;*&quot; Name=&quot;Sample.WixSetupInstaller&quot; Language=&quot;1033&quot; Version=&quot;1.0.0.0&quot; Manufacturer=&quot;Sample Wix Demo Creator&quot; UpgradeCode=&quot;46DE355E-FB28-4D6F-9972-0DBD83BFF146&quot;&gt; <br><br>        &lt;!-- Define package details --&gt; <br><br>        &lt;Package InstallerVersion=&quot;500&quot; Compressed=&quot;yes&quot; InstallScope=&quot;perMachine&quot; /&gt; <br><br>        &lt;!-- Handle major upgrades --&gt; <br><br>        &lt;MajorUpgrade AllowDowngrades=&quot;no&quot; IgnoreRemoveFailure=&quot;no&quot; Schedule=&quot;afterInstallInitialize&quot; DowngradeErrorMessage=&quot;A newer version of [ProductName] is already installed.&quot; /&gt; <br><br>        &lt;!-- Include .cab file into .msi file --&gt; <br><br>        &lt;MediaTemplate EmbedCab=&quot;yes&quot;/&gt; <br><br>        &lt;!-- Define main app icon --&gt; <br><br>        &lt;Icon Id=&quot;AppIcon&quot; SourceFile=&quot;$(var.WPFSampleApplication.ProjectDir)AppIcon.ico&quot; /&gt; <br><br>        &lt;!-- Set the installer icon to appear in Add/Remove programs --&gt; <br><br>        &lt;Property Id=&quot;ARPPRODUCTICON&quot; Value=&quot;AppIcon&quot; /&gt; <br><br>        &lt;!-- Create a basic UI for the installer --&gt; <br><br>        &lt;UI&gt; <br><br>            &lt;UIRef Id=&quot;WixUI_Minimal&quot; /&gt; <br><br>            &lt;Publish Dialog=&quot;ExitDialog&quot; Control=&quot;Finish&quot; Event=&quot;DoAction&quot; Value=&quot;LaunchApplication&quot;&gt;WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed&lt;/Publish&gt; <br><br>        &lt;/UI&gt; <br><br>        &lt;Property Id=&quot;WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT&quot; Value=&quot;Launch Application&quot; /&gt; <br><br>        &lt;!-- Define custom action for launching the application --&gt; <br><br>        &lt;Property Id=&quot;WixShellExecTarget&quot; Value=&quot;[INSTALLFOLDER]WPFSampleApplication.exe&quot; /&gt; <br><br>        &lt;CustomAction Id=&quot;LaunchApplication&quot; BinaryKey=&quot;WixCA&quot; DllEntry=&quot;WixShellExec&quot; Impersonate=&quot;yes&quot; /&gt; <br><br>        &lt;!-- Define the product features --&gt; <br><br>        &lt;Feature Id=&quot;MainApplicationFeature&quot; Title=&quot;WPF Application Installer&quot; Level=&quot;1&quot;&gt; <br><br>            &lt;ComponentGroupRef Id=&quot;ProductFilesComponentGroup&quot; /&gt; <br><br>            &lt;ComponentRef Id=&quot;DesktopShortcut&quot; /&gt; <br><br>            &lt;!-- Create a feature for the Program Menu shortcuts --&gt; <br><br>            &lt;Feature Id=&quot;ProgramMenuFeature&quot; Title=&quot;Program Menu Shortcuts&quot; Level=&quot;1&quot;&gt; <br><br>                &lt;ComponentRef Id=&quot;ProgramMenuShortcut&quot; /&gt; <br><br>            &lt;/Feature&gt; <br><br>        &lt;/Feature&gt; <br><br>    &lt;/Product&gt; <br><br>    &lt;!-- Directory structure definition --&gt; <br><br>    &lt;Fragment&gt; <br><br>        &lt;Directory Id=&quot;TARGETDIR&quot; Name=&quot;SourceDir&quot;&gt; <br><br>            &lt;Directory Id=&quot;ProgramFiles64Folder&quot;&gt; <br><br>                &lt;Directory Id=&quot;INSTALLFOLDER&quot; Name=&quot;WPF Application&quot;&gt; <br><br>                    &lt;Directory Id=&quot;ProductFilesComponentGroup&quot;&gt;&lt;/Directory&gt; <br><br>                &lt;/Directory&gt; <br><br>            &lt;/Directory&gt; <br><br>            &lt;Directory Id=&quot;DesktopFolder&quot; Name=&quot;Desktop&quot; /&gt; <br><br>            &lt;!-- Create a shortcut for Program Menu --&gt; <br><br>            &lt;Directory Id=&quot;ProgramMenuFolder&quot; Name=&quot;Programs&quot;&gt; <br><br>                &lt;Directory Id=&quot;ApplicationProgramsFolder&quot; Name=&quot;WPFApplication&quot;&gt; <br><br>                    &lt;Component Id=&quot;ProgramMenuShortcut&quot; Guid=&quot;261D09F5-2925-4723-8B2D-0ABFE2B1910A&quot;&gt; <br><br>                        &lt;Shortcut Id=&quot;ProgramMenuShortcut&quot; Name=&quot;WPFApplication&quot; Description=&quot;WPF Application Demo Installer&quot; Target=&quot;[INSTALLFOLDER]WPFSampleApplication.exe&quot; WorkingDirectory=&quot;INSTALLFOLDER&quot;&gt; <br><br>                            &lt;Icon Id=&quot;ProgramMenuIcon&quot; SourceFile=&quot;$(var.WPFSampleApplication.ProjectDir)AppIcon.ico&quot; /&gt; <br><br>                        &lt;/Shortcut&gt; <br><br>                        &lt;RemoveFolder Id=&quot;ProgramMenuShortcut&quot; On=&quot;uninstall&quot; /&gt; <br><br>                        &lt;RegistryValue Root=&quot;HKCU&quot; Key=&quot;Software\WPFSampleApplication&quot; Name=&quot;installed&quot; Type=&quot;integer&quot; Value=&quot;1&quot; KeyPath=&quot;yes&quot; /&gt; <br><br>                    &lt;/Component&gt; <br><br>                &lt;/Directory&gt; <br><br>            &lt;/Directory&gt; <br><br>        &lt;/Directory&gt; <br><br>    &lt;/Fragment&gt; <br><br>    &lt;!-- Create a shortcut for desktop --&gt; <br><br>    &lt;Fragment&gt; <br><br>        &lt;DirectoryRef Id=&quot;DesktopFolder&quot;&gt; <br><br>            &lt;Component Id=&quot;DesktopShortcut&quot; Guid=&quot;cde1e030-eb64-49a5-b7b8-400b379c2d1a&quot;&gt; <br><br>                &lt;Shortcut Id=&quot;DesktopShortcut&quot; Name=&quot;WPFApplication&quot; Description=&quot;WPF Application Demo Installer&quot; Target=&quot;[INSTALLFOLDER]WPFSampleApplication.exe&quot; WorkingDirectory=&quot;INSTALLFOLDER&quot;&gt; <br><br>                    &lt;Icon Id=&quot;DesktopIcon&quot; SourceFile=&quot;$(var.WPFSampleApplication.ProjectDir)AppIcon.ico&quot; /&gt; <br><br>                &lt;/Shortcut&gt; <br><br>                &lt;RegistryValue Root=&quot;HKCU&quot; Key=&quot;Software\WPFSampleApplication&quot; Name=&quot;installed&quot; Type=&quot;integer&quot; Value=&quot;1&quot; KeyPath=&quot;yes&quot; /&gt; <br><br>            &lt;/Component&gt; <br><br>        &lt;/DirectoryRef&gt; <br><br>    &lt;/Fragment&gt; <br><br>&lt;/Wix&gt; </pre><h3><strong>Key Configuration Elements:</strong></h3><h4><strong>Product Definition</strong>:</h4><ul><li>Specifies product attributes such as ID, Name, Version, Manufacturer and UpgradeCode.</li><li>The Package element indicates that the installer is compressed and targeted for machine-wide installation.</li></ul><h4><strong>Major Upgrades</strong>:</h4><ul><li>Manages upgrades to ensure older versions are automatically upgraded and prevents downgrades.</li></ul><h4><strong>MediaTemplate</strong>:</h4><ul><li>Embeds .cab files into the .msi installer to ensure a self-contained package.</li></ul><h4><strong>App Icon and ARP Icon</strong>:</h4><ul><li>Defines the application’s icon for both the installer and the Add/Remove Programs list.</li></ul><h4><strong>UI Customization</strong>:</h4><ul><li>Sets up a basic UI and adds a checkbox to launch the application upon installation.</li></ul><h4><strong>Custom Action</strong>:</h4><ul><li>Configures a custom action to launch the application post-installation.</li></ul><h4><strong>Feature Definitions</strong>:</h4><ul><li>Organizes installation features, including the application files and shortcuts for both the desktop and program menu.</li></ul><h4><strong>Directory Structure</strong>:</h4><ul><li>Defines where files will be installed, including creating shortcuts in the desktop and program menu and setting up registry entries for tracking the installation status.</li></ul><p>These configurations ensure a smooth installation experience, with properly set up directories, shortcuts, and application launching post-installation.</p><h4><strong>7. Build your installer</strong></h4><ul><li><strong>Build the Setup Project</strong>: In Visual Studio, build your setup project to generate the installer files.</li><li><strong>Find the MSI Files</strong>: Go to your project’s bin directory to locate the .msi installer files.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*u1_8I0LTYhEBx-oe66C5Qw.png" /><figcaption>Msi File creation inside your project bin folder</figcaption></figure><h4><strong>Verify Installation</strong>:</h4><ul><li>Check the <strong>Control Panel</strong> to ensure the application appears under <strong>Programs and Features</strong>.</li><li>Verify that shortcuts are created on the <strong>Desktop</strong> and in the <strong>Program Menu</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*kw0PKgDL6IMQew33EjewxA.png" /><figcaption>Demo app installed using MSI shows inside your system’s Installed Apps</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*0p0asdiH8zQFVM2VUn-8gQ.png" /><figcaption>Demo app installed using MSI appears under the Control Panel</figcaption></figure><h3><strong>Conclusion</strong></h3><p>WiX Toolset offers a powerful and flexible solution for creating MSI installation packages, allowing developers to customize the installation process extensively. It is especially useful in scenarios where complex installation requirements are needed or when integration with enterprise-level systems is necessary.</p><p>To explore more or get started, you can check out the <a href="https://github.com/dotnet-simformsolutions/wix-installer-dotnet"><strong>GitHub repository</strong></a><strong>.</strong></p><blockquote><strong>For more updates on the latest tools and technologies, follow the </strong><a href="https://medium.com/simform-engineering"><strong>Simform Engineering</strong></a><strong> blog.</strong></blockquote><blockquote><strong>Follow us: </strong><a href="https://twitter.com/simform"><strong>Twitter</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/simform/"><strong>LinkedIn</strong></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26634ce24e60" width="1" height="1" alt=""><hr><p><a href="https://medium.com/simform-engineering/wix-installer-setup-creation-26634ce24e60">WIX Installer Setup Creation</a> was originally published in <a href="https://medium.com/simform-engineering">Simform Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>