How to Use Wix / vsto Addin load dlls from install folder instead of appdata

Salaheddine ALSHAWWA 0 Reputation points
2025-03-10T09:54:49.9666667+00:00

I have created an Outlook VSTO COM addin. Used Wix to generte MSI for Distribution , but the dll always gets loaded from the adddata/local/assembly. i am trying to make them get loaded from the installation folder . this is my wix components.wxs :

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <Fragment>
    <!-- Product Components -->
    <ComponentGroup Id="ProductComponents">
      <!-- Registry Action -->
      <ComponentRef Id="RegisteryAction"/>
    </ComponentGroup>

    <!-- Installed files -->
    <DirectoryRef Id="INSTALLFOLDER" FileSource="..\PhishingReport_v3\bin\Release\$(var.Platform)">
      <Component Id="RegisteryAction" Guid="{0995664D-AE63-4DD6-B894-708A99611370}">
        <RegistryKey Root="HKLM"
                     Key="Software\Microsoft\Office\Outlook\Addins\PhishingReport_v3"
                     Action="createAndRemoveOnUninstall"
                     ForceCreateOnInstall="yes">
          <RegistryValue Type="string" Name="Description" Value="BeamSec / Phishing Report" />
          <RegistryValue Type="string" Name="FriendlyName" Value="Phishing Report" />
          <RegistryValue Type="integer" Name="LoadBehavior" Value="3" />
          <!-- Updated Manifest entry -->
          <RegistryValue Type="string" Name="Manifest" Value="[INSTALLFOLDER]PhishingReport_v3.vsto|vstolocal" KeyPath="yes" />
        </RegistryKey>

        <!-- Registry entries for Office 2016/2019 -->
        <RegistryKey Root="HKLM"
                     Key="Software\Microsoft\Office\16.0\Outlook\Resiliency\AddinList"
                     Action="createAndRemoveOnUninstall"
                     ForceCreateOnInstall="yes">
          <RegistryValue Type="integer" Name="PhishingReport_v3" Value="1"/>
        </RegistryKey>

        <RegistryKey Root="HKLM"
                     Key="Software\Microsoft\Office\16.0\Outlook\Resiliency\DoNotDisableAddinList"
                     Action="createAndRemoveOnUninstall"
                     ForceCreateOnInstall="yes">
          <RegistryValue Type="integer" Name="PhishingReport_v3" Value="1"/>
        </RegistryKey>

        <RemoveRegistryKey Root="HKLM"
                           Key="Software\Microsoft\Office\16.0\Outlook\Resiliency\DisabledItems"
                           Action="removeOnInstall">
        </RemoveRegistryKey >

        <RemoveRegistryKey Root="HKLM"
                           Key="Software\Microsoft\Office\16.0\Outlook\Resiliency\CrashingAddinList"
                           Action="removeOnInstall">
        </RemoveRegistryKey >

        <!-- Office 2013 -->
        <RegistryKey Root="HKLM"
                     Key="Software\Microsoft\Office\15.0\Outlook\Resiliency\AddinList"
                     Action="createAndRemoveOnUninstall"
                     ForceCreateOnInstall="yes">
          <RegistryValue Type="integer" Name="PhishingReport_v3" Value="1"/>
        </RegistryKey>

        <RegistryKey Root="HKLM"
                     Key="Software\Microsoft\Office\15.0\Outlook\Resiliency\DoNotDisableAddinList"
                     Action="createAndRemoveOnUninstall"
                     ForceCreateOnInstall="yes">
          <RegistryValue Type="integer" Name="PhishingReport_v3" Value="1"/>
        </RegistryKey>

        <RemoveRegistryKey Root="HKLM"
                           Key="Software\Microsoft\Office\15.0\Outlook\Resiliency\DisabledItems"
                           Action="removeOnInstall">
        </RemoveRegistryKey >

        <RemoveRegistryKey Root="HKLM"
                           Key="Software\Microsoft\Office\15.0\Outlook\Resiliency\CrashingAddinList"
                           Action="removeOnInstall">
        </RemoveRegistryKey >
      </Component>
    </DirectoryRef>
  </Fragment>
</Wix>

My dlls are all code signed.

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,313 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.