<< Click to Display Table of Contents >> RayPack > 7.3 u6 > User Guide > PackDesigner > MSI / MST / RPP Based Projects > Advanced Mode > User Interface > Adding New Dialogs Defining Custom Dialog Templates |
Note: This is a topic for advanced users. |
The dialogs available in Predefined Dialogs browser can be customized and extended. RayPack looks for the dialog definitions in the following folder:
<PackPointDir>\Dialogs
By default the C:\RayPack\PackPoint\Dialogs directory is being used.
Each dialog is defined using at least two files:
•A small *.xml file, defining the basic dialog properties: name, description, manufacturer and the source file.
Optionally, themes can be defined for each dialog as well.
•An *.rpd file containing the necessary dialog data, images, actions, events etc.
For example, the SetupCompleteError dialog is defined in a following way:
<?xml version="1.0" encoding="utf-8" ?>
<Dialog IsStandard="false" Name="SetupCompleteError" Author="Raynet"
Source="SetupCompleteError\SetupCompleteError.rpd">
<Description><![CDATA[A dialog for SetupCompleteError configuration.]]>
</Description>
</Dialog>
•The Source attribute defines a relative location of a file, containing the dialog and controls definition.
•The IsStandard attribute can be either true or false and affects whether the dialog is displayed as a custom
one or as a standard one in the predefined dialog browser.
The *.rpd files are simple MSI databases with just extension changed. They do not contain the full structure of an
MSI schema, usually only the following tables are present inside:
•Binary
•Control
•Dialog
•ControlCondition
•ControlEvent
•TextStyle
When the dialog is added to the project, the content of all tables are merged with the content of the current project. If any conflict appears (for example trying to add a binary resource that already exist in the package) it is silently ignored. This is to make sure that any kind of customization is preserved when importing a dialog. There is a special handling for the SecureCustomProperties property. Its value is merged with the base one using semicolon as separator. For any other MSI Property, the value present in the current project wins.
Preparing a Custom Template
In order to prepare a custom template:
1.Create a subfolder in the <PackPointDir>\Dialogs folder (by default C:\RayPack\PackPoint\Dialogs), for example MyDialog.
2.Create a new project in RayPack, use the User interface editor to create a custom dialog
3.Build the project as MSI into the subfolder created in the first point. By convention, the name of the file should be the same as the name of its folder, but you can enforce your own naming conventions.
4.Remove any unnecessary leftovers from the project.
a.Anything that has nothing to do with the dialog should be removed. Ideally, only the tables mentioned above should be left inside, and only rows describing the new dialog should be left.
b.Remove the entries from the Binary and Icon table that are not required by the dialog
5.Save the MSI file, and rename its extension to .rpd
6.Create an XML file in <PackPointDir>\Dialogs. By convention its name should be the same as the name of the .rpd file, but you can enforce your own naming conventions.
7.Copy the sample from this section, update the necessary attributes (name, description and author)
8.Update the Source attribute to correctly reference the path you saved in point 5.
9.The changes are applied as soon as the Predefined Dialogs window is shown.
Creating Themes
A theme is a simple MST transform with .rpdt extension. In order to create a theme for a dialog:
1.Pick up a dialog or create a new one using the previous steps.
2.Create an MST transform to the original .rpd file
3.The transform should change the necessary parameters, add required images etc.
4.Save the transform in the subfolder where the original .rpd file is
5.Adjust the XML file containing the dialog definition. For example, the sample below defines two themes:
<?xml version="1.0" encoding="utf-8" ?>
<Dialog IsStandard="false" Name="DB Configuration dialog" Author="Raynet" Source="db\db.rpd">
<Description><![CDATA[A dialog for DB configuration.]]></Description>
<Themes>
<Transform Name="Wide" Source="db\Wide.rpdt" />
<Transform Name="Modern" Source="db\Modern.rpdt" />
</Themes>
</Dialog>
6.The changes are applied as soon as the Predefined Dialogs window is shown.