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]: Component[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 main uses, it can be used to find out if you are nested within a "Component" block or it can obtain the name of the "current" component.

The macro takes these parameters:

EXAMPLES

The following script uses this macro to obtain the current component, if it were not used within a component "block" then an error would result:

;----------------------------------------------------------------------------
;    MODULE NAME:   IceAddToOrca.MM
;
;        $Author:   USER "Dennis"  $
;      $Revision:   1.2  $
;          $Date:   22 Jul 2006 10:07:42  $
;       $Logfile:   C:/DBAREIS/Projects.PVCS/Win32/MakeMsi/IceAddToOrca.MM.pvcs  $
;      COPYRIGHT:   (C)opyright Dennis Bareis, Australia, 2003
;                   All rights reserved.
;
; DESCRIPTION
; ~~~~~~~~~~~
; Creates an MSI which updates ORCA's menu to include a new CUB file.
;----------------------------------------------------------------------------


;----------------------------------------------------------------------------
;--- Define validation Suite and ensure it exists ---------------------------
;----------------------------------------------------------------------------
#define CUB_FILE  out\ICE.mm\MSI\Validations Plus Custom (by Dennis Bareis).CUB
#if FileQueryExists("<$CUB_FILE>") = ''
    #error ^The CUB file "<$CUB_FILE>"{NL}doesn't exist!{NL}{NL}Have you built it using "ICE.MM" yet?^
#endif


;----------------------------------------------------------------------------
;--- Load MAKEMSI (via wrapper) ---------------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_MSINAME_SUFFIX.D       ;;"DENNIS.MMH" specified "(TEST)"
#include "DENNIS.MMH"


;----------------------------------------------------------------------------
;--- Create INSTALLDIR ------------------------------------------------------
;----------------------------------------------------------------------------
<$DirectoryTree Key="INSTALLDIR" Dir="c:\program files\<$ProdInfo.ProductName>" CHANGE="\" PrimaryFolder="Y">


;----------------------------------------------------------------------------
;--- Create a qualified component holding the file --------------------------
;----------------------------------------------------------------------------
<$Component "DBVALID.CUB" Create="Y" Directory_="INSTALLDIR">
   ;--- Add the CUB file to this component (make Keypath) -------------------
   <$Files "<$CUB_FILE>" KeyFile="*">

   ;--- Qualify this component ----------------------------------------------
   <$Table "PublishComponent">
   #(
       <$Row
              Feature_="<$Feature?>"                              ;;"Current" feature's name.
            Component_="<$Component?>"                            ;;"Current" component's name. I THINK the keypath is used by ORCA to know which ICE DB to run...
           ComponentId="{DC441E1D-3ECB-4DCF-B0A5-791F9C0F4F5B}"   ;;GUID obtained by examining the ORCA MSI
             Qualifier="<$ProdInfo.ProductName><$ProductVersion>" ;;Any (I assume unique) identifier will do...
               AppData=^Validation suite created by "ICE.MM"^     ;;Text ORCA will display in it's menu
       >
   #)
   <$/Table>
<$/Component>


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 27 Dec 2008Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: Component[Next]: /Component


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday December 27 2008 at 3:15pm
Visit MAKEMSI's Home PageThis external link was OK when tested at 7 Dec 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 27 Dec 2008