Templates

Master Packager Templates feature is designed to allow automate repetitive tasks application packagers perform on MSI/MST. Templates can work also as one-place storage for your favorite Custom Actions that can be applied with one click. PowerShell support allows to create and store custom PowerShell scripts that will be executed when the Template is being applied adding returned PowerShell Script value to the MSI table.

Master Packager Team occasionally add custom predefined templates as samples and a great source for automation.

Template feature support automation for the following tables:

  • Property table
  • Registry table
    • Component table
  • Custom Action table
    • InstallExecuteSequence table
    • Binary table
  • Summary Information
     

How to create a custom template?

For Properties

  1. Open MSI and go to the Property table
  2. Select one or more Property table rows that need to be added to the template
  3. Right-click on one of the selected rows and press "Add to Template" button
  4. Create a new template name and press the arrow button in the left textbox
  5. Or choose an existing template in the right side dropdown
  6. Double-click on Operation and Apply On columns to choose the settings needed when applying the template
  7. Press the Add button to create/modify the template

For Registries

  1. Open MSI and go to the Registry table
  2. Select one or more Registry table rows that need to be added to the template
  3. Right-click on one of the selected rows and press "Add to Template" button
  4. Create a new template name and press the arrow button in the left textbox
  5. Or choose an existing template in the right side dropdown
  6. Press the Add button to create/modify the template

For Custom Actions

  1. Open MSI and go to the Custom Action table
  2. Select one or more Custom Action table rows that need to be added to the template
  3. Right-click on one of the selected rows and press "Add to Template" button
  4. Create a new template name and press the arrow button in the left textbox
  5. Or choose an existing template in the right side dropdown
  6. Press the Add button to create/modify the template

If selected Custom Actions are using rows in binary table, no extra steps are needed as Template feature will see it and save binaries as well.

For Summary Information

Select in which situation to apply Summary Information changes using Apply On dropdown and edit rest of the values. 

 

How to add automation for Templates?

Delete Summary Information entry:

To delete the value from Summary Information use: <delete>
Applying this Template to the MSI or MST it will delete the value and will leave it blank.

Example:

 

Take value from Property table:

[PROPERTY_property_table_name]

Example:
[PROPERTY_COMPANYNAME] will be resolve value of COMPANYNAME property in the Property table when Template is applied.

 

Do NOT resolve Property value

There could be a situation when property value needs to be resolved only on MSI installation, not on the moment the template is applied. To do that use square brackets and template will not resolve Property value. 

Example:

[COMPANYNAME] will be resolved as [COMPANYNAME]

 

Resolve custom PowerShell returned value

To use custom PowerShell script return value use PowerShell script name in square brackets.

Example:
For PowerShell script with name PS_COMPANYNAME use [PS_COMPANYNAME] in the template.

 

Subscribe to our newsletters