wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
129 stars 36 forks source link

Heat fails to harvest MFC-based DLLs created with VS2012 #4250

Open wixbot opened 10 years ago

wixbot commented 10 years ago

After upgrading from VS2010 to VS2012 I cannot longer harvest COM server DLLs because heat.exe fails with an exception:

Example:

"%WIX%bin\heat" file psaprv.dll -o psaprv.wxs
Windows Installer XML Toolset Toolset Harvester version 3.8.1128.0
Copyright (c) Outercurve Foundation. All rights reserved.

heat.exe : error HEAT0001 : Illegales Zeichen im Pfad.

Exception Type: System.ArgumentException

Stack Trace:
   bei System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
   bei System.IO.Path.GetFileName(String path)
   bei Microsoft.Tools.WindowsInstallerXml.Extensions.UtilFinalizeHarvesterMutator.MutateComponents()
   bei Microsoft.Tools.WindowsInstallerXml.Extensions.UtilFinalizeHarvesterMutator.Mutate(Wix wix)
   bei Microsoft.Tools.WindowsInstallerXml.Mutator.Mutate(Wix wix)
   bei Microsoft.Tools.WindowsInstallerXml.Tools.Heat.Run(String[] args)

The german error messages translates to "illegal character in path"...

Since the only thing I changed was the tool (VS2010 --> VS2012) leaving sources and explicit project settings unchanged, so there must be a change in the implementation of MFC's AfxOleRegisterServerClass() function which I use in DllRegisterServer(). And indeed, path specifications are now unconditionally quoted:

In a string like "CLSID\\%1\\InprocServer32\0%3" the MFC function AfxOleRegisterServerClass() replaces each "%3" with the path to the module. And this path is now always in the form "\"path_to_the_file\"", i.e. always starting and ending with a quote character. This is what "heat" dislikes...

If I avoid this by replacing the "%3" placeholders by myself before I call AfxOleRegisterServerClass() then "heat" creates the output file as expected. But this requires code changes in every COM module so it would be nice if "heat" could deal with that new behaviour of AfxOleRegisterServerClass().

Originally opened by hendel.tom

wixbot commented 10 years ago

Originally changed by hendel.tom Area changed from compiler to

wixbot commented 10 years ago

Originally changed by barnson Release changed from v3.8 to v3.x

wixbot commented 10 years ago

Originally changed by bmurri AssignedTo set to wixsupport

zoli13 commented 6 years ago

I want to fix this bug. Title can be changed to "Heat fails to harvest if registry path is in quotes" or similar

rseanhall commented 6 years ago

Thanks for volunteering! In order to assign you this bug, I have to add you as a collaborator to this repo. Look for a confirmation email from GitHub for this. Also, make sure to check out our development page for how to get started.

rseanhall commented 6 years ago

@BMurri It looks like you were assigned this bug in our old bug tracker. Did you make any progress?

BMurri commented 6 years ago

I had started by trying to add a repo to the test code (to catch future versions of this class of issues) and was distracted by combination of the broken tests and by my day job at the time (which was sucking all of my available time). Later, when the bug tracker changed (and there was no easy way to re-claim bugs), I didn't find an easy way to identify all the bugs i had claimed. This one slipped through.

I could pick this back up, or @zoli13 could take it. It'll be at least a couple of weeks before I look deeply at this as I'm trying to catch up after being sidelined with a kidney stone the past few weeks.

zoli13 commented 6 years ago

It seems a simple fix (at least, we faced this problem, and my local changes in wix source fixed it, and now we can harvest COM DLL's compiled with newer VC++ on my local build). So I thought to make my changes public, thus I applied for this fix.