visual-studiowixregistryinstallationcodebase

WIX Heat wrong 'registryvalue' 'codebase' value


I know there are many similar questions about this theme, but none of them could give me an answer.

I'm creating a windows installer for a dll which I developed in VS2019. The installer is created and works correctly on my machine, but not on other machines. The reason for this is that all registry values named 'CodeBase' have the wrong path to the dlls. It is not the installation directory but the release directory of my VS project.

I tried

"C:\Program Files (x86)\WiX Toolset v3.11\bin\heat.exe" dir "$(TargetDir.TrimEnd('\\'))" -suid -sfrag -srd -gg -g1 -cg EA<my project name>Assemblies -var var.$(ProjectName).TargetDir -wixvar -dr INSTALLFOLDER -out "$(ProjectDir)WIX\$(TargetName).wxs"

where INSTALLFOLDER is defined in the 'Product.wxs'

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLFOLDER" Name="my product name" />
        </Directory>
    </Directory>
</Fragment>

The CodeBase regitry value lines in the generated XIX file all are looking like this:

<RegistryValue Root="HKCR" Key="CLSID\{41D3DB26-8261-303B-ACAF-F4F823FE21BE}\InprocServer32\3.1.1.0" Name="CodeBase" Value="file:///C:/Dev/C#/<my VS project path>/bin/Release/Microsoft.AspNetCore.Http.Features.dll" Type="string" Action="write" />

As you can see, the created path is not the target directory (which is C:\Program Files (x86)\my product name) but the release directory of my VS project.

I also tried replacing INSTALLFOLDER by TARGETDIR and adding the parameter -directoryid TARGETDIR (resp. INSTALLDIR) in the call of heat.exe, but nothing changed.

So I hope that I find someone here who can tell me, what I'm doing wrong. I'd appreciate any help. If you need more information, please tell me. I'm using heat version 3.11.1.2318 with VS2019 on Win10.

I apologize for the anonymization of my product but it is not my property and for now I'm not allowed to publish it.

Jörg


Solution

  • It's sad to have to say so but for me the only solution was to change to another technology and use a visual studio installer project template (imho. much easier to handle) to create my installer.