0

I am trying to register my COM Add-in using the RegAsm command using the WIX Setup. But am unable to do it. It is showing blank against the WixNetFxExtension's NETFRAMEWORK40FULLINSTALLROOTDIR or even NETFRAMEWORK40CLIENTINSTALLROOTDIR.

Here is the code for the custom action:

<CustomAction Id="RegisterUsingRegAsm" Directory="PROOFIX_ADDIN" Execute="deferred" Impersonate="no" Return="check"
              ExeCommand='"[NETFRAMEWORK40FULLINSTALLROOTDIR]regasm.exe" "[PROOFIX_ADDIN]Proofix.View.dll" /codebase' />

When I try to hardcode the path C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe. It works fine...

and Here is the Sequence information:

<InstallExecuteSequence>
  <Custom Action="RegisterUsingRegAsm" Before="InstallFinalize" />
</InstallExecuteSequence>

Here is the log generated for the installer:

Action: RegisterUsingRegAsm, location: C:\Users\naveed.butt\AppData\Local\Optimentor\Proofix\, command: "regasm.exe" "C:\Users\naveed.butt\AppData\Local\Optimentor\Proofix\Proofix.View.dll" /codebase

Naveed Butt
  • 2,861
  • 6
  • 32
  • 55

1 Answers1

1

First of all you are missing a PropertyRef

Like this:

<PropertyRef Id="NETFRAMEWORK40CLIENTINSTALLROOTDIR"/>

Second issue if you are on a 64 bit windows you should use the 64 bit variable:

NETFRAMEWORK40CLIENTINSTALLROOTDIR64

However you can handle 32/64 bit Windows OS with conditions. You can get inspiration from this answer: https://stackoverflow.com/a/12514596/600559

Community
  • 1
  • 1
Morten Frederiksen
  • 5,114
  • 1
  • 40
  • 72
  • I tried adding the property as well, but it didn't work. The only thing I didn't try was `64 bit` run-time, because although my OS is 64 bit but there is 32 bit run-time installed on it as well. So the question is, do I really need to change/switch to `64 bit` run-time ? – Naveed Butt Aug 10 '16 at 05:38
  • When installing (a 32 bit app) - on a 64 bit OS you need to use NETFRAMEWORK40FULLINSTALLROOTDIR64 and NETFRAMEWORK40CLIENTINSTALLROOTDIR64 – Morten Frederiksen Aug 10 '16 at 08:55