Bugs item #1753850, was opened at 2007-07-14 01:19
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1753850&group_id=105970
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Adrian Wilkins (dr_barnowl)
Assigned to: Nobody/Anonymous (nobody)
Summary: PATCH : Critical fix for TypeLib versions
Initial Comment:
Pasted from wix-devs mailing list as requested.
This patch and discussion cover and resolve the issues in (1752713, 1752728)
and also a few other things besides.
The enclosed patch helps with the pain of making a VB6 installer as
follows. The changes are based on the outputs of the VB6
DllRegisterServer routine, because that's how the heat harvester
constructs it's output.
I started off using the old Visual Studio Installer 1.1 plugin for
VS6, but on hitting build, it runs smack into an installer advertising
issue and demands the VS2005 install disk for about 10 minutes PER
MODULE, every time. Oh the irony. This makes it unworkable (which is a
shame, because it's a nice enough tool for basic use once you've
worked out the kinks).
Points marked with "*", changes to the source code with ">"
The critical fix (unchecked this can cause bad things to happen).
* The version numbers in the version subkeys of TypeLib are expressed in hex.
* The version numbers in Class/VERSION keys are decimal.
* The compiler gets this correct and exports hex in the right places.
* The component mutator did NOT get this right (and the source said
so, in a TODO). This is bad.
* Both major and minor version numbers above 9 are common, esp in
VB6 development since the IDE has full command over the TypeLib
generation process.
* All versions above 9 are treated wrongly.
* Versions with chars [a-f] are exported as RegistryValue
elements instead of in the correct location in their TypeLib element.
* Versions without chars [a-f] but above 9 are incorrectly
treated as decimal.
* This means that version 0x10 will not supersede version 0x0f
correctly because heat will emit keys for 0x0f properly. Then it will
treat version 0x10 as decimal and set the TypeLib version attribute to
"10" and light will export it as version 0x0a.Oops.
* See bug 1752728
> Mutator now treats this key as hex always.
* This also means that sub-components of TypeLib elements are now
correctly indexed below a TypeLib where the version number had a char
[a-f]
And the minor improvements (mostly about reducing workload on the VB6 developer)
* Some VB6 COM classes register multiple execution contexts (ActiveX EXEs).
* The harvester does this correctly.
* Some VB6 COM classes do not register an execution context. This
occurs where the class has been marked "PublicNotCreatable". While the
class is thus totally unnecessary from a COM standpoint as the only
thing you need is the interface (and removing it's registration
appears to have no ill effects), this is "how it is" and VB6 is
unlikely to be fixed.
> Have made [EMAIL PROTECTED] optional in wix.xsd and removed the
compiler check for it's presence. Perhaps this should be re-instated as a
warning so it can be ignored by VB6 devs using PublicNotCreatable.
* The VB self-register routine insists on registering several VB
components that can be presumed to be installed on Win2k and up
(TypeLibs from MSVBM60.dll, etc).
* These are not a part of the type library for the file.
* They have HELPDIR values directed at c:\windows\system32
> The harvester now detects this (checks to see if value is equal
to Environment.SystemDirectory) and sets the HelpDirectory attribute
correctly. This eliminates a spurious RegistryValue for each instance.
* Therefore you get spurious Class, RegistryValue and TypeLib
entries outside the File element.
* Because these are not marked as advertised and do not belong to
the file, candle treats them as errors. I thought about marking them as
advertised, but I read that it causes problems, so....
> Added -componentfilerootsonly option to FinalizeHarvesterMutator.
This iterates through the root-level children of components and removes all
non-file elements. Since the other changes in this patch roll all
remaining VB6 output into the File element, this has the effect of
eliminating the spare VB component elements. Note that in
circumstances where there are non-file items that are desired, this
will eliminate them without warnings, but I encountered none of these
in my work with 30+ VB6 dlls encompassing hundreds of classes.
* VB6 DLLs register (undocumented in MSDN) "Forward" keys in interfaces when
an interface
has been deprecated and the application should forward calls to the
new interface. This may be the result of adding members to interfaces
without changing the [EMAIL PROTECTED], which is very normal in VB6
> wix.xsd changed to allow Interface elements to nest.
> Compiler treats an Interface element nested inside another to be
an interface that forwards to the parent interface.
> Mutator nests forwarded interfaces beneath their target.
* Browsing the MSDN documentation for the previous point, could not
find documentation for the "Forward" subkey of Interface key, but did find
"BaseInterface"
key which is not implemented by WiX tools.
> Implemented BaseInterface key in compiler and schema, even though
I didn't need it personally.
This has reduced my initial pain on generating VB6 install modules
down to a one-line process, from having to manually flick through all
the output removing junk. Having the right TypeLib versions also helps
when some of your codebase has version numbers in the 30's (decimal).
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1753850&group_id=105970
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs