Bugs item #1639812, was opened at 2007-01-19 19:43
Message generated for change (Comment added) made by barnson
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1639812&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: candle
Group: v3.0
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Private: No
Submitted By: duanej (duanejoh)
Assigned to: Nobody/Anonymous (nobody)
Summary: Preprocessor has parsing problems

Initial Comment:
I'm trying to modify my wxs files to handle both 32 and 64 bit installs using 
the Preprocessor ifdef's.  I wrote somthing like the following:

<Fragment>
    <DirectoryRef Id="INSTALLDIR">
    <?if $(env.RELEASE64)=1 ?>
        <Component Id="bvPwd.exe" Guid="{ACAE461E-0D51-4731-9186-9FEB25A75A55}" 
Win64="yes">
    <?else?> 
        <Component Id="bvPwd.exe" Guid="{74D63A0E-7ED7-4FD3-91D0-F56356085723}" 
>
    <?endif?>
            <File Id="bvPwd.exe" Name="bvPwd.exe" KeyPath="yes" DiskId="1" 
Source="$(env.SOURCEDIR)\bvPwd.exe" />
        </Component>
    </DirectoryRef>
</Fragment>

which gave the following error:

C:\rsit\server\SSH2\WixInstall\winsshd_files.wxs(71) : error CNDL0104 : Not a va
lid source file; detail: The 'Component' start tag on line 65 does not match the
 end tag of 'DirectoryRef'. Line 71, position 7.

Line 65 is the first Component line.  It looks like candle can't handle the 
fact that my Component line doesn't contain an end tag.  I endind up using the 
following which does compile:

<Fragment>
    <DirectoryRef Id="INSTALLDIR">
    <?if $(env.RELEASE64)=1 ?>
        <Component Id="migrate.dll" 
Guid="{C910BE9B-3FF3-4179-BDAA-64CD2D013251}" Win64="yes">
            <File Id="migrate.dll" Name="migrate.dll" KeyPath="yes" DiskId="1" 
Source="$(env.SOURCEDIR)\migrate.dll" />
        </Component>
    <?else?> 
        <Component Id="migrate.dll" 
Guid="{1F3A8E42-0A47-4395-BF32-23EAB456CC2E}">
            <File Id="migrate.dll" Name="migrate.dll" KeyPath="yes" DiskId="1" 
Source="$(env.SOURCEDIR)\migrate.dll" />
        </Component>
    <?endif?>
    </DirectoryRef>
</Fragment>


While this works, it makes the code hard to maintain as there are many 
duplicated File references. That's OK for this small project that I an 
currently working on, but I've got a large project coming up with many hundreds 
of files.  I don't look forward to duplicating code on a large scale.



----------------------------------------------------------------------

>Comment By: Bob Arnson (barnson)
Date: 2007-01-19 20:20

Message:
Logged In: YES 
user_id=26581
Originator: NO

The preprocessor doesn't let you do partial elements, by design. But
rather than using preprocessor conditionals everywhere, use preprocessor
variables:

<Component Id="migrate.dll" Guid="$(var.migrateDllComponentGuid)"
Win64="$(var.Win64YesNo)">

Then you can keep your variables in one included file with a single
?if/?else/?endif. Plus it'll look much cleaner.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1639812&group_id=105970

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs

Reply via email to