title: Can't register dll using WiX - error code "hresult -2147024770"
body: <p>I am developing an IME (Input Method Editor) for Windows so I compiled this sample from microsoft: <a href="https://code.msdn.microsoft.com/windowsdesktop/Input-Method-Editor-IME-b1610980/view/Discussions/1" rel="nofollow noreferrer">https://code.msdn.microsoft.com/windowsdesktop/Input-Method-Editor-IME-b1610980/view/Discussions/1</a> using Visual Studio 2015 and packaged it using WiX.<br>
  It installs fine on the computer on which I compiled it, but it seems like I cannot get regsvr32 to register the dll/ime on my other computer (both running windows 10).  I get this error </p>
  
  <p><img src="https://i.stack.imgur.com/XQUtc.png" alt="I get this error"></p>
  
  <p>, and manually registering the dll through cmd doesn't work either.  My guess is that I am missing a dependency?  Does anyone know what I am doing wrong?
  Here is the .wxs packaging code from WiX: </p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt;
      &lt;Product Id="*" Name="WiXSetup" Language="1033" Version="1.0.0.0" Manufacturer="lwrnc" UpgradeCode="5973bdd3-dea7-4924-a303-4e881386e030"&gt;
  
      &lt;Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /&gt;
  
          &lt;MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /&gt;
          &lt;MediaTemplate /&gt;    
          &lt;Feature Id="ProductFeature" Title="WiXSetup" Level="1"&gt;            
        &lt;ComponentGroupRef Id="StartMenuComponents" /&gt;
        &lt;!--&lt;ComponentGroupRef Id="IMEComponentsx86" /&gt;--&gt;
        &lt;ComponentGroupRef Id="IMEComponentsx64" /&gt;
          &lt;/Feature&gt;
      &lt;/Product&gt;
  
    &lt;!--Directory Structure--&gt;
      &lt;Fragment&gt;
          &lt;Directory Id="TARGETDIR" Name="SourceDir"&gt;             
        &lt;!--Start Menu Shortcut--&gt;
        &lt;Directory Id="ProgramMenuFolder"&gt;
          &lt;Directory Id="MyShortcutsDir" Name="WiXSetup"&gt;          
          &lt;/Directory&gt;
        &lt;/Directory&gt;
        &lt;!--x86 Version--&gt;
        &lt;Directory Id="ProgramFilesFolder"&gt;
          &lt;Directory Id="IMEINSTALLFOLDERx86" Name="WiXSetup"&gt;          
          &lt;/Directory&gt;
        &lt;/Directory&gt;
        &lt;!--x64 Version--&gt;
        &lt;Directory Id="ProgramFiles64Folder"&gt;
          &lt;Directory Id="IMEINSTALLFOLDERx64" Name="WiXSetup"&gt;
          &lt;/Directory&gt;
        &lt;/Directory&gt;
          &lt;/Directory&gt;
      &lt;/Fragment&gt;  
  
    &lt;!--Components--&gt;
      &lt;Fragment&gt;  
  
      &lt;!--x86 IME--&gt;
      &lt;!--&lt;ComponentGroup Id="IMEComponentsx86" Directory="IMEINSTALLFOLDERx86"&gt;
        &lt;Component Id="CMP_IMEx86" Guid="{0CB17F8D-26FF-4E29-A428-710791CDE1EB}"&gt;
          &lt;File Id="FILE_IMEINSTALLFOLDER_SampleIMEx86DLL" Source="SampleIMEx86.dll" KeyPath="yes" SelfRegCost="1" /&gt;
        &lt;/Component&gt;
        &lt;Component Id="CMP_DICTx86" Guid="{66474BE0-ABE5-4B22-8F9B-EB894C6A6218}"&gt;
          &lt;File Id="FILE_IMEINSTALLFOLDER_SampleIMESimplifiedQuanPinx86TXT" Source="SampleIMESimplifiedQuanPin.txt" KeyPath="yes"/&gt;
        &lt;/Component&gt;
      &lt;/ComponentGroup&gt;--&gt;
  
      &lt;!--x64 IME--&gt;
      &lt;ComponentGroup Id="IMEComponentsx64" Directory="IMEINSTALLFOLDERx64"&gt;
        &lt;Component Id="CMP_IMEx64" Guid="{AEDC5FB8-6BB9-4A9F-B920-D6D8244BB837}"&gt;
          &lt;File Id="FILE_IMEINSTALLFOLDER_SampleIMEx64DLL" Source="SampleIMEx64.dll" KeyPath="yes" SelfRegCost="1" /&gt;
        &lt;/Component&gt;
        &lt;Component Id="CMP_DICT" Guid="{C555385F-4848-48B4-90A8-EB0E722605EB}"&gt;
          &lt;File Id="FILE_IMEINSTALLFOLDER_SampleIMESimplifiedQuanPinx64TXT" Source="SampleIMESimplifiedQuanPin.txt" KeyPath="yes"/&gt;
        &lt;/Component&gt;
      &lt;/ComponentGroup&gt;
  
      &lt;!--Start Menu Components--&gt;
      &lt;ComponentGroup Id="StartMenuComponents" Directory="MyShortcutsDir"&gt;
        &lt;Component Id="CMP_DocumentationShortcut" Guid="{4EFD00CD-2297-4A9D-A0A5-47C26897E223}"&gt;
          &lt;Shortcut Id="WiXSetupDoc" Name="WiXSetup Doc" Description="Read this please" Target="[INSTALLFOLDER]lwrnc.txt" /&gt;        
          &lt;Shortcut Id="UninstallShortcut" Name="Uninstall WS" Description="uninstall wixsetup practice" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]" /&gt;
          &lt;RemoveFolder Id="RemoveMyShortcutsDir" On="uninstall"/&gt;
          &lt;RegistryValue Root="HKCU" Key="Software\Microsoft\WiXSetup" Name="installed" Type="integer" Value="1" KeyPath="yes"/&gt;
        &lt;/Component&gt;            
      &lt;/ComponentGroup&gt;
      &lt;/Fragment&gt;
  &lt;/Wix&gt;
  </code></pre>