Custom Action Overview

Custom actions are powerful features that extend the capabilities of standard actions provided by Paquet Builder; custom actions do not require special programming skills and let you customize the behavior of the package.

All custom actions are visually managed by the custom action editor you can see below. No scripting is required!

Paquet Builder's custom actions are objects that control the behavior of the package: each action actually executes a specific task it was designed for. For example you have actions that will display additional dialog boxes (user queries, readmes...); other that manipulate files or work with the Windows registry...

You just need to create a list of actions and Paquet Builder will do the rest of the job. Now these actions have properties: to customize the behavior of a given custom action, you will need to change its properties.

Actions are added to specific phases of the package's execution called events; Paquet Builder uses four events: Initialization, Before File Extraction, After File Extraction and Finalization. When an event is triggered, its actions are executed in the order in which they appear in the event's action list.

For a list of all custom actions, click here.

Managing custom actions

  • To add an action to the list, press the Add Action button: see below.
  • To remove an action from the list, select it and press the Remove button. You will need to confirm your choice.
  • To modify an action’s settings, select the field and press the Edit button (you can also double-click on it). 
  • To reorder the actions, you can use drag/drop operations or work with the Move Up and Move Down button.
  • The Custom Action Editor has also its own mouse context menu: click with the mouse's right button on the action list and a context menu with several additional commands will appear. You can perform clipboard operations like cut, copy and paste actions; the last feature is especially useful if you wish to add the same action type several times and just modify one property.

  • You can import/export custom actions from/to external files using the Import/Export commands from the File menu.

    • When you export custom actions, Paquet Builder will display a list of all custom actions in the selected event:



      Highlight the custom actions that you want to export (use your mouse and the SHIFT or CTRL keys to select/unselect custom actions). Only highlighted custom actions will be exported. By default all custom actions of the event are selected.
      Then press Export and you will be prompted to select the file which selected actions will be saved to. Paquet Builder Action files are given the .PBA extension.

    • When you import custom actions, Paquet Builder will ask you to select the external action file (.PBA) to import. Then it will show you the same dialog box as above, except that this time you will have to select the actions you want to import into the selected event.
      Once your actions are selected, press Import and they will be imported into the current event. Please note that existing custom actions are not overwritten, even if they have the same name (and purpose).

  • You can copy a block of custom actions: Paquet Builder only allows a single action to be selected each time. If you want to copy several actions in one time (instead of selecting all actions one per one and copy/paste them), use the "Edition|Copy a block of actions" menu command. Paquet Builder will display a list of all custom actions in the current event (like on the previous screenshot): then highlight the custom actions that you want to copy (use your mouse and the SHIFT or CTRL keys to select/unselect custom actions). Only highlighted custom actions will be copied. By default all custom actions of the event are selected.
    Then press Copy and Paquet Builder will save custom actions to an internal clipboard. Note that the default Windows clipboard is not used.

  • After having copied a block of custom actions, you can paste it: select "Edition|Paste a block of actions" menu command. Paquet Builder will show you the same dialog box as above, except that you will have to select the actions you want to import into the selected event.
    Once your actions are selected, press Paste and they will be imported into the current event. Please note that existing custom actions are not overwritten, even if they have the same name (and purpose). You can then modify these new actions.

  • The custom action editor's window may be resized: its state and size are saved and automatically restored.

  • If you want to print your custom actions, you can use "File|Export HTML". The list of all custom actions in the current event will be saved to the selected HTML file: you can then open it in your default Web browser and select 'Print'.

Note: all common operations have shortcuts: CTRL+A will add a new action, CTRL+C will copy the custom action to the clipboard, PAGE KEY DOWN will jump to the next event. Look at the Edition menu command to know the available shortcuts.

Adding custom actions

  1. First you need to select the appropriate event in the Edit Event list.
  2. After pressing the Add Action button, a dialog box with the list of all available custom actions will appear. In that list select the action you would like to add to the selected event. Then click OK.



    On this screen shot we are going to add a new "Create a folder" custom action.

  3. The Action Properties Editor appears and lets you set up the different properties of your action.

    Through its value a property tells the package how the custom action should work. Just see this sample: take the Create a folder action, it contains the property called "FolderName". You set the value of this property to the folder that the custom action will create. So when the package runs, it sees the custom action "Create a folder", so it knows it should create a new folder; but which folder? It finds the answer by reading the value of the "FolderName" property. Now it can create the folder and continue its execution.

  4. Finally press OK and the new custom action will appear in the action sequence list of the selected event.

Important notes about custom actions

  • It is not necessary to work with actions: Paquet Builder's other steps already allow you to configure many facets of your package. However actions give you the total control over your package's behavior.

  • Paquet Builder does only check whether all required properties were filled when you add or edit new actions. It does not check whether the action will work correctly or not. For example, if you add a "Conditional Begin If/Then", do not forget to add the other part "Conditional End If".

  • You can add several actions that have the same properties: for example, if you need to execute the same file twice. Paquet Builder also supports actions that have the same names in the editor and in different events.

  • You can fill in the properties of the custom actions with variables and resource strings.

  • Important: once again, Begin Conditional If/Then must always be followed later by an End Conditional If/Then.

  • Some action properties are optional: when you discover a new action, please refer to the related Help topic before using it! Important information is available sometimes about the action properties. You can press the Help button that will display the help topic related to this action.

  • Some actions have no properties (like the Exit Package action). Consequently the Action Properties Editor is not displayed (double-clicking on these actions to edit them will do nothing).

  • To add comments to your action list, use the special "User comment" action.

Check the forum for help and samples related to custom actions.

 


  Paquet Builder Help - Copyright © G.D.G. Software. All rights reserved.