Kevin,

 

I don't know if it's the recommended way (it probably isn't) but here is
a brief description of what we do here:

 

We happen to use NAnt for our build scripts. You should be able to
accomplish similar results using a batch file, MSBuild or similar.

 

Our calls to Candle look something like this:

 

<exec program="${wix.candle.executable}"
workingdir=".\InstallationScripts" >

    <arg file="InstallationScripts/SomeScript.wxs" />

    <arg value="-dMajorRev=${application.revision.major}" />

    <arg value="-dMinorRev=${application.revision.minor}" />

    <arg value="-dPatchRev=${application.revision.patchlevel}" />

    <arg value="-dBuildRev=${application.revision.build}"
if="${property::exists('application.revision.build')}" />

    <arg value="-dBuildRev=0"
unless="${property::exists('application.revision.build')}" />

    <arg value="-dbuildtype=${BuildType}" />

    <arg value="-dManufacturer=Quixote Traffic Corp" />

    <arg value="-dManufacturer.Short=Quixote" />

    <arg
value="-dRedistributablePath=${path::combine(source.path,'Redistributabl
e')}" />

</exec>

 

In NAnt terminology, ${whatever} represents an item which will be filled
in when the script is executed. As you can see, we are using the -d
command line parameter to pass several variables into candle, among
which is the build type. When Candle runs, those preprocessor variables
can be accessed using $(var.VariableName) and used to populate other
elements with the correct values.

 

In the wxs file, we have something like this:

 

<Directory Id="TARGETDIR" Name="SourceDir">

            <Directory Id="QuixoteCommunicationsFolder" Name=".">

                        <Component Id="SomeComponent"
Guid="YOUR_GUID_HERE">

                                    <File Id="SomeFile"
Name="SomeFile.dll" LongName="SomeLongNamedFile.dll"
src="..\bin\$(var.buildtype)\SomeLongNamedFile.dll" />

                        </Component>

<?if $(var.buildtype) = "Debug" ?>

                        <Component Id="SomeComponentDebug"
Guid="YOUR_GUID_HERE">

                                    <File Id="SomeFilePdb"
Name="SomeFile.pdb" LongName="SomeLongNamedFile.pdb"
src="..\bin\$(var.buildtype)\SomeLongNamedFile.pdb" />

                        </Component>

<?endif?>

            </Directory>

</Directory>

 

As you can see, the src attribute on the files uses the buildtype
variable (as passed from the command line) to select the correct source
folder.

 

In addition, the preprocessor test (<?if $(var.buildtype) = "Debug" ?>)
allows us to only include the SomeComponentDebug component if we are
making a debug build.

 

Obviously, there are similar preprocessor tests around other areas to
ensure that the debug components are only included in ComponentGroup's
or Feature's for debug builds. I didn't bother including them because
the syntax is identical.

 

I hope this is helpful to you.

 

Regards,

Richard

 

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kevin
Burton
Sent: Thursday, April 19, 2007 11:53 PM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Release and debug installations.

 

I was wondering what the recommended way or even some suggestions on how
to handle building a Release and Debug installation? I have a Wix script
that builds a .msi but it takes its files from bin\debug and it includes
.pdb files that are not present in the release directory(s). I would
like to create an msbuild script that passes "configuration" information
to the Wix candle/light via the .wxs file. My roadblock now is I am not
sure how to translate a "target" in an msbuild project to a "property"
that is usable in the .wxs. I have tried <Condition> but it seems that
the property is not set. Just a simple msbuild project that I could do
something like 'msbuild MyProject.wproj Release' and it would pass the
'Release' target (as a property I guess) to Wix. Any suggestions would
be greatly appreciated. 

 

Thank you.

 

Kevin




* C O N F I D E N T I A L I T Y N O T I C E *
-----------------------------------------------------------
The content of this e-mail is intended solely for the use of the individual or 
entity to whom it is addressed. If you have received this communication in 
error, be aware that forwarding it, copying it, or in any way disclosing its 
content to any other person, is strictly prohibited. Peek Traffic Corporation 
is neither liable for the contents, nor for the proper, complete and timely 
transmission of (the information contained in) this communication. If you have 
received this communication in error, please notify the author by replying to 
this e-mail immediately and delete the material from any computer.


-------------------------------------------------------------------------
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-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to