Yes you have to modify the Directory identifiers in the Fragment
generated by heat in your example. You don't need to use the Fragment
Element if you don't want to, you can copy the code into your Directory
tree if you wish. Personally I only use 1 Product/Fragment per file to
separate my WiX projects into discrete chunks as you would with classes
in C++ or C# but that's probably because I was a C++ & C# developer
before I started using WiX. There's no reason (other than ease of
use/readability) why you can't have 1 file with a Product Element &
multiple Fragment Elements, it really depends on how large/complex your
installation is.

I suggest re-running heat.exe with the -suid switch. It will generate
much more readable code with regards to the dir, file & component ID's.
I also tend to use -gg rather than -ag as I prefer to know when my GUIDs
are changing (suffered broken patching in the past due to unnoticed GUID
changes) but that's a separate issue.

Also you need to add those generated Components to a Feature using
ComponentRef's for it to be installed if you haven't already. There's no
Feature Tree in your pasted code so I can't tell if you've done this
already & omitted it from the paste to keep the message size down.

Palbinder Sandher 
Software Deployment & IT Administrator
T: +44 (0) 141 945 8500 
F: +44 (0) 141 945 8501 

http://www.iesve.com 
**Design, Simulate + Innovate with the <Virtual Environment>**
Integrated Environmental Solutions Limited. Registered in Scotland No.
SC151456 
Registered Office - Helix Building, West Of Scotland Science Park,
Glasgow G20 0SP
Email Disclaimer

-----Original Message-----
From: s...@pacaccess.com [mailto:s...@pacaccess.com] 
Sent: 29 March 2010 17:22
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Registering a COM DLL

There is registration information but I didn't include the registration
information portion in the posting because it didn't seem like the
values themselves were the issue - it was getting them written to the
registry. 
If it helps, here is the entire fragment section which was generated
from
heat:

<Fragment>
    <DirectoryRef Id="TARGETDIR">
        <Directory Id="dir97176AEC31E49EAABA96A880A1E2D08E" Name="Full
Release" />
    </DirectoryRef>
</Fragment>
<Fragment>
    <DirectoryRef Id="dir97176AEC31E49EAABA96A880A1E2D08E">
        <Component Id="cmp294312A740872F38057FC7053FF85C0D" Guid="*">
            <File Id="fil47F0AB91FEDF117C1BF54D9F25EC8F88" KeyPath="yes"
Source="SourceDir\Full Release\MyDLL.dll">
                <TypeLib Id="{85FCE81C-EE74-4AC3-889F-3ADCD66855B7}"
Description="MyDLL 1.0 Type Library"
                    HelpDirectory="dir97176AEC31E49EAABA96A880A1E2D08E"
Language="0" MajorVersion="1" MinorVersion="0">
                    <AppId Description="MyDLL"
Id="{D7F48FAA-E7DA-4222-9986-CB222D5C608F}">
                        <Class
Id="{0893E729-5E25-471B-9836-A1A708F8A3F2}"
Context="InprocServer32"
                            Description="MyDLLBHO Class"
ThreadingModel="apartment" Programmable="yes">
                            <ProgId Id="MyDLL.MyDLLBHO.1"
Description="MyDLLBHO Class">
                                <ProgId Id="MyDLL.MyDLLBHO"
Description="MyDLLBHO Class" />
                            </ProgId>
                        </Class>
                    </AppId>
                    <Interface
Id="{E387D600-52D2-4984-A98A-50B30FDEB54D}"
Name="IMyDLLBHO"
 
ProxyStubClassId="{00020424-0000-0000-C000-000000000046}"
 
ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}"
/>
                </TypeLib>
            </File>
            <RegistryValue Root="HKCR" Key="AppID\MyDLL.DLL"
Name="AppID"
                Value="{D7F48FAA-E7DA-4222-9986-CB222D5C608F}"
Type="string" Action="write" />
            <RegistryValue Root="HKLM"
                Key="SOFTWARE\Microsoft\Internet
Explorer\Extensions\{85FCE81C-EE74-4AC3-889F-3ADCD66855B7}"
                Name="CLSID"
Value="{1FBA04EE-3024-11D2-8F1F-0000F87ABD16}"
Type="string" Action="write" />
            <RegistryValue Root="HKLM"
                Key="SOFTWARE\Microsoft\Internet
Explorer\Extensions\{85FCE81C-EE74-4AC3-889F-3ADCD66855B7}"
                Name="MenuText" Value="MyDLL..." Type="string"
Action="write" />
            <RegistryValue Root="HKLM"
                Key="SOFTWARE\Microsoft\Internet
Explorer\Extensions\{85FCE81C-EE74-4AC3-889F-3ADCD66855B7}"
                Name="ClsIDExtension"
Value="{0893E729-5E25-471B-9836-A1A708F8A3F2}"
Type="string" Action="write" />
            <RegistryValue Root="HKLM"
 
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser
Helper Objects\{0893E729-5E25-471B-9836-A1A708F8A3F2}"
                Value="MyDLL" Type="string" Action="write" />
            <RegistryValue Root="HKLM"
 
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser
Helper Objects\{0893E729-5E25-471B-9836-A1A708F8A3F2}"
                Name="NoExplorer" Value="1" Type="integer"
Action="write" />
        </Component>
    </DirectoryRef>
</Fragment>


I added what was generated by heat and appended it to my wxs file, and
the outline of my Product.wxs file is now:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
    <Product>
        <DirectoryRef Id="TARGETDIR">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLLOCATION" Name="MyDLL">
                    ...
                </Directory>
            </Directory>
        </DirectoryRef>
    </Product>

    <Fragment>
        <DirectoryRef Id="TARGETDIR">
            <Directory Id="dir97176AEC31E49EAABA96A880A1E2D08E"
                Name="Full Release" />
        </DirectoryRef>
    </Fragment>
    <Fragment>
        <DirectoryRef Id="dir97176AEC31E49EAABA96A880A1E2D08E">
            <Component Id="cmp294312A740872F38057FC7053FF85C0D"
Guid="*">
                ...
            </Component>
        </DirectoryRef>
    </Fragment>
</Wix>


Please note that where I have '...' represents clipped code which has
been removed (for the sake of clarity).

I hope this helps.  Basically, I've added what was generated by heat,
yet after I install my product the DLL isn't registered.  If I manually
run
regsvr32 on the DLL, it works fine.

I'm not very familiar with <Fragment>.  My suspicion is that some of the
IDs within the Fragment blocks need to be changed to some of the IDs in
the Product block.  I've read about Fragment but I'm not seeing what I'm
doing wrong.

Thanks,

Jeff










> Considering there's absolutely no registration information in your 
> fragment I'm not surprised it's not registering the DLL.
>
> Heat will only harvest what DLLRegisterServer does. If your DLL 
> doesn't export that function & uses some random custom method for COM 
> registration instead then heat has no idea what you're talking about. 
> If you can't register your DLL using regsvr32.exe, heat can't harvest
it.
>
> The fragments aren't your problem, the registration method is.
>
> Palbinder Sandher
> Software Deployment & IT Administrator
> T: +44 (0) 141 945 8500
> F: +44 (0) 141 945 8501
>
> http://www.iesve.com
> **Design, Simulate + Innovate with the <Virtual Environment>** 
> Integrated Environmental Solutions Limited. Registered in Scotland No.
> SC151456
> Registered Office - Helix Building, West Of Scotland Science Park, 
> Glasgow G20 0SP Email Disclaimer
>
> -----Original Message-----
> From: s...@pacaccess.com [mailto:s...@pacaccess.com]
> Sent: 29 March 2010 05:13
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Registering a COM DLL
>
> I also meant to add, in my Product.wxs file I essentially have:
>
> <Product>
>     <Directory Id="TARGETDIR" Name="SourceDir"> </Product> <Fragment>
>     <DirectoryRef Id="TARGETDIR">
>         ...
>     </DirectoryRef>
> </Fragment>
> <Fragment>
>     <DirectoryRef Id="dir97176AEC31E49EAABA96A880A1E2D08E">
>         ...
>     </DirectoryRef>
> </Fragment>
>
>
> Do any of the IDs in the <Fragment> sections need to match with the 
> IDs in the <Product> section?  I've essentially copied the entire 
> output which was generated by heat and added it verbatim to my 
> Product.wxs file.
>
> Jeff
>
>
>> This isn't working for me.  I'm harvesting the COM registration info
> with:
>>
>> heat file MyDLL.dll -template:fragment -ag -out fragment.wxs
>>
>> And I have appended my Product.wxs file with the generated output.  
>> My
>
>> Product.wxs is now along the lines of:
>>
>> <?xml version="1.0" encoding="UTF-8"?> <Wix 
>> xmlns="http://schemas.microsoft.com/wix/2006/wi";>
>>     <Product ...>
>>         ...
>>     </Product>
>>     <Fragment>
>>         <DirectoryRef Id="TARGETDIR">
>>            <Directory Id="dir97176AEC31E49EAABA96A880A1E2D08E"
>> Name="Full Release" />
>>         </DirectoryRef>
>>     <Fragment>
>>     <Fragment>
>>         <DirectoryRef Id="dir97176AEC31E49EAABA96A880A1E2D08E">
>>             <Component Id="cmp294312A740872F38057FC7053FF85C0D"
> Guid="*">
>>                 <File Id="fil47F0AB91FEDF117C1BF54D9F25EC8F88"
>> KeyPath="yes" Source="SourceDir\Full Release\MyDLL.dll">
>>                     ...
>>                 </File>
>>             </Component>
>>         </DirectoryRef>
>>     <Fragment>
>> </Wix>
>>
>>
>> This compiles fine, and runs, but after the installer is completed, 
>> my
>
>> DLL hasn't been registered.  I'm not very familiar with the Fragment 
>> node.  Is there anything else I need to do to get the registry values
> to be set?
>>
>> Thanks,
>>
>> Jeff
>>
>>
>>> The recommended way now is typically to run heat.exe to "harvest" 
>>> the
>
>>> com registration information out of your DLL. This way it won't 
>>> actually run the code from the DLL at install-time (which is more 
>>> likely to fail, won't handle all of MSI's transactionality 
>>> appropriately, and is generally a non-recommended solution) and 
>>> instead will figure out what exactly what registry keys your DLL 
>>> needs, and put that information into the MSI (the recommended, more 
>>> robust way).
>>>
>>> Generally you run the tool something like this:
>>>     Heat file -template:fragment file.dll -out fragment.wxs
>>>
>>> This should generate some registry, etc. fragments which you can 
>>> reference from the rest of your authoring via ComponentRef or 
>>> ComponentGroupRef elements.
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> -
>> -------- Download Intel&#174; Parallel Studio Eval Try the new 
>> software tools for yourself. Speed compiling, find bugs proactively, 
>> and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> _______________________________________________
>> WiX-users mailing list
>> WiX-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wix-users
>>
>>
>
>
>
> ----------------------------------------------------------------------
> --
> ------
> Download Intel&#174; Parallel Studio Eval Try the new software tools 
> for yourself. Speed compiling, find bugs proactively, and fine-tune 
> applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
> ----------------------------------------------------------------------
> -------- Download Intel&#174; Parallel Studio Eval Try the new 
> software tools for yourself. Speed compiling, find bugs proactively, 
> and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>



------------------------------------------------------------------------
------
Download Intel&#174; Parallel Studio Eval Try the new software tools for
yourself. Speed compiling, find bugs proactively, and fine-tune
applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to