MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: Compile Options[Next]: Component?
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->Commands->Component

The "Component" Command

This command has two distinct purposes, it creates or updates a component or makes a component the default for other commands.

The command can be nested and a block must be terminated with "/Component". Any other MAKEMSI commands that have a "component" parameter will use the "current" component details by default.

The macro takes these parameters:

EXAMPLE 1

;--- Create Feature (a number of items defaulting) --------------------------
<$Feature "F_Dennis" Title=^Dennis' "Feature"^ Attributes="3+4+5">
   ;--- Create Component (assign to feature) --------------------------------
   <$Component "C_Dennis" Directory_="WindowsFolder">
       ;--- Do stuff --------------------------------------------------------
       ;...
   <$/Component>

   ;--- Create SUB-Feature --------------------------------------------------
   <$Feature "F_Under_Dennis" CREATE="Y">  ;;CREATE="Y" REQUIRED here as no attributes supplied
       <$Component "C_Under_Dennis" ComponentId="" Directory_="WindowsFolder">
           ;--- Do stuff ----------------------------------------------------
           ;...
       <$/Component>
   <$/Feature>
<$/Feature>


;--- Update feature ---------------------------------------------------------
<$Feature "F_Dennis" Level="99" CREATE="N"><$/Feature>

;--- Reference existing feature ---------------------------------------------
<$Feature "Fred">
   'Just a reference (becomes default feature)
<$/Feature>

EXAMPLE 2 - In Multiple Features

;-----------------------------------------------------------------------------------------------------
;--- SAMPLE METHOD #1: Create Component (not nested "within" a feature) , add to multiple features ---
;-----------------------------------------------------------------------------------------------------
<$Component "This.Component.Is.In.Mult.Features" FEATURE="Files_TryMe,Files_TryMeWithNoRootFeature.MM" Create="Y" Directory_="INSTALLDIR" LM="Y">
    ;--- Whatever here ------------------------------------------------------
<$/Component>


;----------------------------------------------------------------------------
;--- SAMPLE METHOD #2: Map existing component to one or more features -------
;----------------------------------------------------------------------------
<$Feature "YetAnotherFeature1" Title=^SAMPLE METHOD #2 - Feature 1^>
    ;--- Add existing component to "enclosing" feature ----------------------
    <$Component "This.Component.Is.In.Mult.Features" CREATE="N"><$/Component>
<$/Feature>
<$Feature "YetAnotherFeature2" Title=^SAMPLE METHOD #2 - Feature 2^>
<$/Feature>
<$Feature "YetAnotherFeature3" Title=^SAMPLE METHOD #2 - Feature 3^>
    ;--- Add existing component to current plus a named feature -------------
    <$Component "This.Component.Is.In.Mult.Features" FEATURE=".,YetAnotherFeature2" CREATE="N"><$/Component>
<$/Feature>


;----------------------------------------------------------------------------
;--- SAMPLE METHOD #3: Table/Row to update assignment directly --------------
;----------------------------------------------------------------------------
<$Table "FeatureComponents">
    <$Row Feature_=^<$COMPANY_HTMLRPT_FEATURE>^ Component_=^This.Component.Is.In.Mult.Features^>
<$/Table>


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006 & 2007 for the Windows SDK (Windows Installer) area.This external link was OK when tested at 25 Jun 2008Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: Compile Options[Next]: Component?


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday July 06 2008 at 11:25am
Visit MAKEMSI's Home PageThis external link was OK when tested at 21 Jun 2008

HTML page dated Mon, 29 Jan 2007 00:11:11 GMT
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006 & 2007 for the Windows SDK (Windows Installer) area.This external link was OK when tested at 25 Jun 2008