About Directive Files
Introduction to Directive Files
Section titled “Introduction to Directive Files”Paquet Builder introduces a specific file type called “directive file”, using the .pbd extension.
These text-based files contain instructions for Paquet Builder to create or modify a package/installer.
Why Use Directive Files?
Section titled “Why Use Directive Files?”- Automate Package Creation — Useful for external applications needing to generate packages dynamically.
- Modify Existing Projects — Enables automated transformations of existing projects.
- Shell Extension Support — The Paquet Builder shell extension works with directive files.
Recommended Format: Save directive files in UTF-8 (with or without BOM).
Learn More: How to Open and Execute Directives.
How Directive Files Work
Section titled “How Directive Files Work”Directive files follow a format similar to Windows INI configuration files.
Example of a Directive File (.pbd)
Section titled “Example of a Directive File (.pbd)”; Paquet Builder Directive File; Version 1.1
[DirectiveVariables]MYVERSION=1.0
[General]Title=My archive {$MYVERSION$}ProjectTemplate=C:\MyWork\MyProject\baseproj.pbpxOutputDir=C:\MyWork\MyProject\outputOutputName=MyArchive.exeCompany=G.D.G. SoftwareEXEType=0 ; 32-bit package (0=32-bit, 1=64-bit, 2=ARM64)IsWizard=1StorePaths=1Folder=C:\MyWork\Source\SubFolders=1Icon=C:\MyWork\MyProject\media6.ico
[Source]0=C:\MyWork\MyProject\Source\*.*1={$PBDIRECTPATH$}\Data Source Files\*.xmlMandatory Sections
Section titled “Mandatory Sections”[General]— Configures the package settings (always required).[Source]— Lists files to include (unlessNoSourceSection=1is set).
[General] Section Parameters
Section titled “[General] Section Parameters”This section defines the package configuration.
- Parameters can be specified in any order.
- Boolean values: Use
1(true) or0(false).
| Parameter | Description |
|---|---|
| BinFolder | Defines the root folder for temporary output files. |
| CheckRights | Checks for administrative rights (1=Yes, 0=No). |
| Company | Defines the company name. Mandatory if using the command-line compiler. |
| CompressionCPUThreads | Number of CPU threads used for compression (LZMA2 required). |
| CompressionEngine | Defines the unpacking engine: 0=Auto, 1=Small engine, 2=Full-featured engine. |
| CompressionLevel | Compression level for 7-Zip (0=No compression, 4=Ultra compression). |
| CompressionLZMA2 | Enables LZMA2 compression instead of LZMA (1=Yes, 0=No). |
| CompressionSolid | Enables solid compression (1=Yes, 0=No). |
| Copyright | Defines the copyright string in the installer. |
| CryptFilenames | Encrypts filenames in the archive (1=Yes, 0=No). |
| DestFolder | Defines the destination folder for extracted files (do not use for Setup projects). |
| DigitalSign | Enables digital signing (1=Yes, 0=No). |
| Specifies the company’s email address. | |
| EncryptFiles | Encrypts files during compression (1=Yes, 0=No). |
| EndPrompt | Custom message shown at the end of the package execution. |
| EXEType | Defines bitness: 0=32-bit (default), 1=64-bit, 2=ARM64. |
| ExistingArchive | Specifies the full path to an existing 7-Zip archive instead of listing files manually. |
| FileDesc | Sets the file description in version info. |
| ForceIntegrity | Forces integrity check on signed executables (1=Yes, 0=No). Default: 0. |
| FileDescUninst | Sets the uninstaller file description in version info. |
| FileVerNum | Sets the file version number in version info. |
| Folder | Defines the root folder for storing path information. |
| HideProgress | Hides the extraction progress window (1=Yes, 0=No). |
| Homepage | Specifies the company’s website URL. |
| Icon | Path to the package icon file. |
| IconUninst | Path to the uninstaller icon file. |
| InstallMSI | Indicates whether the file in SetupExec is a Windows Installer MSI file (1=Yes, 0=No). |
| InstallScope | Defines the installation scope mode: -1=None (legacy), 0=Current User, 1=All Users, 2=User Choice, 3=Automatic. See Installation Scope. |
| IsWizard | Enables the wizard-style interface (1=Wizard UI, 0=Standard UI). |
| KeepExistingProjectFiles | If using ProjectTemplate, retains existing files (1=Yes, 0=No). |
| KeyProtect | Defines the password used for encrypting files. |
| LiveUpdate | Enables live update when using ProjectTemplate (1=Yes, 0=No). |
| MinimumElevatedRights | Required elevation level if RequestElevatedRights=1: 0=Require Admin, 1=Highest Available. |
| MinimumUserRights | Required user rights if CheckRights=1: 0=Admin, 1=Power User. |
| MultiVolumeArc | Creates a multi-volume archive (1=Yes, 0=No). |
| NoSourceSection | Disables the [Source] section (1=Yes, 0=No). |
| OutputDir (Required) | Specifies the output directory for the generated package. |
| OutputName (Required) | Defines the package filename (e.g., Setup.exe). |
| OverwriteReadOnly | Allows overwriting read-only files (1=Yes, 0=No). |
| PackMode (Required) | Specifies package type: 0=Standard, 1=Setup, 2=Archive. |
| PasswordToAsk | Defines the password required to extract or install the package. |
| PFXFile | Path to the PFX file for digital signing (ignored if SignCertifLocation=1). |
| PFXKey | Password for the PFX file (if required). |
| ProdVerNum | Defines the product version number in version info. |
| Project | Path to the project file (.pbpx) that Paquet Builder should create. |
| ProjectTemplate | Uses an existing project template and modifies it dynamically. |
| ReplaceStartup | Enables file replacement at Windows startup (1=Yes, 0=No). |
| RequestElevatedRights | Requests UAC elevation (1=Yes, 0=No). |
| ScopeFailOnAdmin | Fail if admin rights cannot be obtained when scope requires them (1=Yes, 0=No). Default: 0. Only applies when InstallScope is set. |
| ScopeRequestUAC | Request UAC elevation for All Users scope (1=Yes, 0=No). Default: 1. Only applies when InstallScope is set. |
| SetupExec | Path to the setup loader for installer-type projects. |
| SetupParams | Command-line parameters for the setup loader. |
| ShowCompSelDlg | Displays the Select Components dialog (1=Yes, 0=No). |
| SignCertifLocation | Defines where to get the code signing certificate or the signing method: 0=PFX, 1=Windows Store, 2=Thumbprint, 3=SignTool Commands, 4=Azure Artifact Signing, 5=JSign (see JSignCmd section below). |
| SignDlls | Also sign embedded DLLs (1=Yes, 0=No). Default: 1. |
| SignMethod | Defines the message digest method: 0=SHA-256 & SHA-1, 1=SHA-256 only, 2=SHA-1 only. Ignored if SignCertifLocation > 2. |
| SignUninst | Also sign the uninstaller executable (1=Yes, 0=No). Default: 1. |
| Silent | Enables silent mode (1=Yes, 0=No). |
| SizeCheck | Activates size checking (1=Yes, 0=No). |
| StartPrompt | Defines a custom startup prompt. |
| StorePaths | Defines whether path information is stored (1=Yes, 0=No). |
| SubFolders | Includes subfolders when adding files (1=Yes, 0=No). |
| Title (Required) | Sets the title of the package. |
| ArtifactSignEndpoint | Defines the Azure Artifact Signing account endpoint (must match your Azure region). Old name TrustSignEndpoint is still accepted. |
| ArtifactSignCodeSigningAccountName | Specifies the Azure Artifact Signing account name. Old name TrustSignCodeSigningAccountName is still accepted. |
| ArtifactSignCertificateProfileName | Defines the certificate profile name for signing with Azure Artifact Signing. Old name TrustSignCertificateProfileName is still accepted. |
| UIModern | Enables the modern UI interface: 0=Classic UI, 1=Modern UI. Overrides IsWizard if specified. |
[Source] Section
Section titled “[Source] Section”This section lists files to be included in the package.
- Supports wildcards (e.g.,
*.exe,*.xml). - Allows absolute or relative paths using directive variables.
Example Source Section
Section titled “Example Source Section”[Source]0=C:\MyWork\Project\Source\*.*1=C:\MyWork\Project\Readme.txt2=C:\Windows\System\cabinet.dll3={$PBDIRECTPATH$}\Data\*.xmlUse directive variables like {$PBDIRECTPATH$} to avoid hardcoded paths.
[Components] Section
Section titled “[Components] Section”Defines optional components that users can select during installation.
Example Component Structure
Section titled “Example Component Structure”[Components]0=Documentation1=Pictures
[Documentation.Source]0=C:\Project\Help\*.chm
[Documentation.Properties]Description=Application DocumentationTitle=DocumentationStoringPath=1
[Pictures.Source]0=C:\Project\Media\*.png1=C:\Project\Media\*.jpg
[Pictures.Properties]Title=PicturesDescription=Sample picturesRequired=0InstallDef=1SourceLinked=1SourceFolder=C:\Project\MediaIncSubFolders=1- Each component requires a
[ComponentName.Source]and[ComponentName.Properties]section. - The Main component always exists and is defined in
[Main.Properties].
Component Properties Reference
Section titled “Component Properties Reference”| Property | Description |
|---|---|
| Title | Display name of the component in the selection dialog. |
| Description | Description shown to the user during installation. |
| Variable | Runtime variable name for this component (e.g., %VCOMPDOCUMENTATION%). Auto-generated if not specified. |
| Required | Component is required and cannot be unchecked (1=Yes, 0=No). Default: 0. |
| InstallDef | Component is checked by default (1=Yes, 0=No). Default: 1. |
| NoDisplay | Hide the component from the selection dialog (1=Yes, 0=No). Default: 0. |
| SourceLinked | Link to a source folder for live updates (1=Yes, 0=No). Default: 0. |
| SourceFolder | Path to the source folder when SourceLinked=1. |
| CustomDestinationFolder | Override the destination folder for this component’s files. |
| IncSubFolders | Include subfolders when scanning source folder (1=Yes, 0=No). Default: 0. |
| ExcludeComponent | Exclude this component from the build (1=Yes, 0=No). Default: 0. |
| FileMaskInclude | Wildcard mask for including files (e.g., *.dll;*.exe). |
| FileMaskExclude | Wildcard mask for excluding files (e.g., *.pdb;*.log). |
| StoringPath | How file paths are stored: 0=Default, 1=Absolute, 2=No path (flat), 3=Relative. |
| RootFolder | Root folder for relative path storage (StoringPath=3). |
Learn more: Component Management.
Directive Variables
Section titled “Directive Variables”Directive variables allow dynamic path replacement in directive files.
Built-in Variables
Section titled “Built-in Variables”| Variable | Meaning |
|---|---|
{$PBDIRECTPATH$} | Path to the directive file folder. |
{$PBTEMPLATEPATH$} | Path to the template project folder. |
{$PBDOCPATH$} | Path to the user’s Documents folder. |
Example Usage
Section titled “Example Usage”[Source]0={$PBDIRECTPATH$}\Source Files\*.*1={$PBDIRECTPATH$}\Docs\*.pdfThis way, you can move the directive file without breaking file paths.
[Templates] Section — Screen Content
Section titled “[Templates] Section — Screen Content”This section allows you to load HTML content into the installer’s screens (Welcome, License Agreement, Readme, Final screen).
[Templates]Welcome=C:\MyProject\screens\welcome.htmlLicAg=C:\MyProject\screens\license.htmlStartReadme=C:\MyProject\screens\readme_start.htmlEndReadme=C:\MyProject\screens\readme_end.htmlEnd=C:\MyProject\screens\final.html| Template Key | Screen |
|---|---|
Welcome | Welcome screen |
LicAg | License / End-User Agreement |
StartReadme | Readme shown before installation |
EndReadme | Readme shown after installation |
End | Final screen |
- Values can be absolute paths or relative filenames (looked up in the
Templates\folder next to PBuilder.exe). - Files can be HTML or legacy RTF (automatically converted to HTML).
- Template variables like
[ARCHIVETITLE],[COMPANYNAME],[COMPANYEMAIL],[HOMEPAGE],[COPYRIGHT],[DESCRIPTION],[PRODNUM],[FILENUM]are replaced with project values.
[SignToolCmd] Section — Custom SignTool Commands
Section titled “[SignToolCmd] Section — Custom SignTool Commands”This section allows multiple digital signatures to be applied sequentially.
Only used when SignCertifLocation is set to 3.
Example:
[SignToolCmd]0=sign /fd SHA256 /tr "http://timestamp.digicert.com" /td SHA256 "{$PBOUTPUTFILE$}"1=sign /fd SHA1 /tr "http://timestamp.digicert.com" /td SHA1 "{$PBOUTPUTFILE$}"- Each line represents one signing command.
- Commands are executed in order (e.g., first SHA-256, then SHA-1).
[JSignCmd] Section — JSign Commands
Section titled “[JSignCmd] Section — JSign Commands”This section defines JSign signing commands when SignCertifLocation is set to 5.
JSign is a free, open-source Java-based code signing tool supporting PFX/PKCS#12, hardware tokens (ETOKEN, YUBIKEY), Azure Key Vault, AWS KMS, Google Cloud KMS, and more.
Example:
[JSignCmd]0=sign --keystore "certificate.p12" --storepass "mypass" --tsaurl http://timestamp.sectigo.com --tsmode RFC3161 --digest-algorithm SHA-256 "{$PBOUTPUTFILE$}"Available Placeholders
Section titled “Available Placeholders”| Placeholder | Replaced with |
|---|---|
{$PBOUTPUTFILE$} | Full path to the output file being signed. |
{$PBOUTPUTFOLDER$} | Path to the output folder. |
Define Custom Directive Variables
Section titled “Define Custom Directive Variables”Create your own variables inside [DirectiveVariables].
[DirectiveVariables]MYVERSION=1.0OUTPUTNAME=InstallerUse them in any section:
[General]Title=My archive {$MYVERSION$}OutputName={$OUTPUTNAME$} {$MYVERSION$}.exeExample: Simple Directive File Without Source
Section titled “Example: Simple Directive File Without Source”; Paquet Builder Directive File[General]Title=My archive 1NoSourceSection=1OutputName=Direct2.exeOutputDir=C:\Build\OutputProjectTemplate=C:\Build\Template.pbpxLiveUpdate=1Use NoSourceSection=1 if your directive modifies an existing project without changing its file list.