The "ComPlusApp" Command |
This command defines the start of a COM+ application which ends with the "/ComPlusApp" command.
Application properties can be defined with the "ComPlusProperty" command.
This command takes these parameters:
You can use the "*" character within the user id, it gets replaced with the current machine's domain name.
This parameter should be supplied as a VBSCRIPT expression (not as literal text), so double quoted text would be valid as would the result of a call to the VbsCaCadGet routine.
This parameter should be supplied as a VBSCRIPT expression (not as literal text), so double quoted text would be valid as would the result of a call to the VbsCaCadGet routine.
The default for this parameter can be set via the DEFAULT_COMPLUS_DELETE macro. This is initially "Y".
This parameter is used to supply the name of a #data structure.
Normal MSI formatting takes place on both the name and value columns of the #data.
I recommend passing the full filenames of any DLL resources etc to be as defensive as possible to errors on your part, if you refer to a row key with "[#FileRowKey]" and it doesn't exist then you will get a validation error when you build the MSI (not a runtime error you need to debug).
Use of this parameter should now be replaced with use of the "DATA parameter.
Main COM+ Command Related Options |
Please see the "options for commands" section of the manual.
#define? DEFAULT_COMPLUS_DELETE Y ;;Delete this application on install/uninstall? #define? COMPLUS_INSTALL_CA_COND <$CONDITION_INSTALL_ONLY> #define? COMPLUS_UNINSTALL_CA_COND <$CONDITION_UNINSTALL_ONLY> #define? COMPLUS_VBSCRIPT_CONSTANTS ;;Any constants, variables or initialization code (executed for install AND uninstall)... #define? COMPLUS_VBSCRIPT_FUNCTIONS ;;You can define your own VBSCRIPT Subroutines+Functions if you wish #define? COMPLUS_CAD_SYMBOL_START (* ;;(*CadSymbolName*) #define? COMPLUS_CAD_SYMBOL_END *) ;;(*CadSymbolName*) #define? COMPLUS_SEQUENCE_INSTALL RegisterComPlus-RegisterUser #define? COMPLUS_SEQUENCE_UNINSTALL RegisterComPlus-RegisterUser
EXAMPLE |
This example shows an application being created. MAKEMSI is choosing the ID (a guid) and it will use the same one for any subsequent build. Both Application and component properties are being set.
;--- Include MAKEMSI -------------------------------------------------------- #include "ME.MMH" ;--- Define installation directory (INSTALLDIR) ----------------------------- <$DirectoryTree Key="INSTALLDIR" Dir="[ProgramFilesFolder]\SomeDirectory" CHANGE="\" PrimaryFolder="Y"> ;--- I'm using any handy DLLs for this sample (I don't expect it to work...) --- #define FILE_SRC_DIR C:\Program Files\makemsi #define SAMPLE_COM+DLL_#1 MakeMSI.DLL #define SAMPLE_COM+DLL_#2 Reg4mm.dll ;--- Add the files (MSI components auto-generated) -------------------------- <$File RowKey="<$SAMPLE_COM+DLL_#1>" SOURCE="<$FILE_SRC_DIR>\<$SAMPLE_COM+DLL_#1>" Destination="[INSTALLDIR]\<$SAMPLE_COM+DLL_#1>"> <$File RowKey="<$SAMPLE_COM+DLL_#2>" SOURCE="<$FILE_SRC_DIR>\<$SAMPLE_COM+DLL_#2>" Destination="[INSTALLDIR]\<$SAMPLE_COM+DLL_#2>"> ;--- Create properties for USERID/PASSWORD (could create dialog to ask user) --- <$Property "USERID" Value="Fred"> ;;Can override on command line if wanted <$Property "PASSWORD" Value="abc"> ;;Can override on command line if wanted ;--- Define the COM+ Application -------------------------------------------- #data 'CaData' 2 ;--- Pass installation directory and install time DLL names ------------- "INSTALLDIR" "[INSTALLDIR]" ;;Location of installation directory "COMPLUS_DLL_1" "[#<$SAMPLE_COM+DLL_#1>]" ;;Want full install time location of specified file "RowKey" "COMPLUS_DLL_2" "[#<$SAMPLE_COM+DLL_#2>]" ;--- Pass UserId and Password ------------------------------------------- "USERID" "[USERID]" "PASSWORD" "[PASSWORD]" #data #( <$ComPlusApp "DennisBareisTest" DELETE="Y" Data="CaData" User=^VbsCaCadGet("USERID")^ PassWord=^VbsCaCadGet("PASSWORD")^ ; User=^"Dennis"^ PassWord=^"abc"^ ; ID="{47819B72-386A-4400-830C-1D0172EBF456}" > #) ;--- Set some Application attributes ------------------------------------- <$ComPlusProperty "Description" VALUE=^"Test Application created by TestMsi.MM"^> <$ComPlusProperty "AccessChecksLevel" VALUE="COMAdminAccessChecksApplicationComponentLevel"> <$ComPlusProperty "ApplicationAccessChecksEnabled" VALUE="True"> ;--- Create some application ROLES --------------------------------------- <$ComPlusRole "DennisBareisTestUsers" Description="Users for the DennisBareisTest test application" USERS="Everyone;Dennis"> ;--- Add components (note that a single DLL can have more than 1 component!) ------------------------- <$ComPlusComp DLL=^(*COMPLUS_DLL_1*)^> ;;Filenames passed in Custom Action data (correct no matter where user installed them) <$ComPlusComp DLL=^(*COMPLUS_DLL_2*)^> ;--- Update the component(s) --------------------------------------------- <$ComPlusCompUpdate> ;;Update all components (PROGID not supplied) ;--- Assign ROLES to the COMPONENT ----------------------------------- <$ComPlusRole "DennisBareisTestUsers"> <$ComPlusProperty "ComponentAccessChecksEnabled" VALUE="True"> <$/ComPlusCompUpdate> ;--- Try some exporting -------------------------------------------------- <$ComPlusExport MSI="out\ExportedCom-App.msi" PROXY="N"> <$ComPlusExport MSI="out\ExportedCom-Proxy.msi" PROXY="Y"> <$/ComPlusApp>