If you are using MSBuild...

In the first <PropertyGroup> ... add a

                <DefineConstants>
                        $(DefineConstants);
                        Foo=$(Foo);
                        Bar=$(Bar);
                </DefineConstants>

And then in your 

        <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 
'Debug|x86' ">

Add or update
                <DefineConstants>$(DefineConstants);Debug;</DefineConstants>
(and similar for release mode).


>From there, you can use MSBuild to read from INI or XML files to prepopulate 
>your information, or you can define them as constants in the first 
>PropertyGroup.


If you just want a single spot to define constants, and you don't need the 
available to MSBuild, you can create a wxi file.

<?xml version="1.0" encoding="utf-8"?>
<Include>
  <!-- Platform specific variables -->
  <?if $(var.Platform) = x64 ?>
  <!-- Product name as you want it to appear in Add/Remove Programs-->
  <?define ProductName = "BlahBlah 64 Bit [Live]" ?>
  <?else ?>
  <?define ProductName =  "BlahBlah [Live]" ?>
  <?endif ?>
</Include>

To include the WXI into your product, then simply use <?include Config.wxi?>
Jacob
-----Original Message-----
From: Monty Shaw [mailto:[email protected]] 
Sent: Thursday, September 06, 2012 3:46 PM
To: [email protected]
Subject: [WiX-users] variables in wsx files?

Hi

I have a bunch of files that need to go into my .msi. I am using Wix 3.6 and 
VS2012. So all my files have release in the path to the source. I have seen 
uses of things like $(var.foo) but I can't for the life of me figure out how to 
set them. I'd like to save myself potential problems by creating a variable for 
the build configuration so I can put it into all the source file paths for my 
files.

So I need something like this:

<variable name=FOO>release</variable> <= part I cannot find in the schema 
reference or the tutorial

:
:
<Component Id="C__2134E2C4B1417DD6D8122E1831D917DD"
Guid="{532B4785-BBB8-68E5-C7AD-66967CE47B20}">
              <File Id="_2134E2C4B1417DD6D8122E1831D917DD"
Name="ConfigEdit.exe.config" KeyPath="yes"  DiskId="1"
Source="..\ConfigEdit\bin\$(var.FOO)\ConfigEdit.exe.config" />
            </Component>
:
:

Thanks for any help and sorry for the dumb question, but I really need 
something even more basic than the tutorial. The tutorial is a good, but 
sometimes I felt like some of the explanations of the elements left out which 
element this one could be inside of. The tutorial needs to show the entire 
section of XML so the new user (me) gets a clue as to where to put it.

]Monty[
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat 
landscape has changed and how IT managers can respond. Discussions will include 
endpoint security, mobile security and the latest in malware threats. 
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to