No, there is no built-in functionality to accomplish that.

But the bigger question is why you want to create such components. Ideally, you 
would have file KeyPaths. Random component guids are usually bad  for servicing 
scenarios. What are you doing with these components? Giving us more details 
about the use case would help us identify a solution.

-----Original Message-----
From: Maillet, Ed [mailto:email...@unum.com] 
Sent: Monday, August 31, 2009 8:53 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Preprocessor and Component Guids

Hey all,
  I hope I'm missing something obvious. Is there a way for the preprocessor to 
generate a guid value for a variable? (without making my own custom extension).

Something like <?define guid = $(Guid.NewGuid) ?>

I'm trying to create multiple conditional components like:

<?define environments=DEVELOPMENT;PRODUCTION;STRESS?>
 <?foreach env in $(var.environments)?>
        <!-- Environment specific Component -->
        <Component Id="MyWebSite_$(var.env)"
                   Guid="My_AUTO_GUID">
                <!-- Rest of the component details here -->
          <Condition>
            <![CDATA[%ENVIRONMENT = "$(var.env)"]]>
          </Condition>
        </Component>
 <?endforeach?>  

I can't use Guid="*" since I also don't have a KeyPath in components. (I can 
make it work with KeyPath but how could I do it without?)


----- Ed



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with Crystal 
Reports now.  http://p.sf.net/sfu/bobj-july 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to