About Directive Files¶
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?¶
✔ 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.
Tip
You can create basic directive files directly from your existing project with the "Create Directive Skeleton" menu accessible from Paquet Builder's application button .
How Directive Files Work¶
Directive files follow a format similar to Windows INI configuration files.
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.pbpx
OutputDir=C:\MyWork\MyProject\output
OutputName=MyArchive.exe
Company=G.D.G. Software
EXEType=0 ; 32-bit package
IsWizard=1
StorePaths=1
Folder=C:\MyWork\Source\
SubFolders=1
Icon=C:\MyWork\MyProject\media6.ico
[Source]
0=C:\MyWork\MyProject\Source\*.*
1={$PBDIRECTPATH$}\Data Source Files\*.xml
Mandatory Sections¶
✔ [General]
– Configures the package settings (always required).
✔ [Source]
– Lists files to include (unless NoSourceSection=1
is set).
Warning
⚠️ Important: If NoSourceSection
is not set to 1
, files from a project template will be ignored.
[General] Section Parameters¶
This section defines the package configuration.
- Parameters can be specified in any order.
- Boolean values: Use 1
(true) or 0
(false).
Info
📌 If a field is missing, the default value from the template project is used.
The [General]
section defines the core settings of the package.
- All parameters are optional, unless specified otherwise.
- Boolean values: 1 = Enabled (true)
, 0 = Disabled (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 . |
ExistingArchive | Specifies the full path to an existing 7-Zip archive instead of listing files manually. |
FileDesc | Sets the file description in version info. |
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 ). |
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 ). |
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 Trusted Signing |
SignMethod | Defines the message digest method: 0=SHA-256 & SHA-1 , 1=SHA-256 only , 2=SHA-1 only . Ignored if SignCertifLocation > 2. |
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. |
TrustSignEndpoint | Defines the Azure Trusted Signing account endpoint (must match your Azure region). |
TrustSignCodeSigningAccountName | Specifies the Azure Trusted Signing account name. |
TrustSignCertificateProfileName | Defines the certificate profile name for signing with Azure Trusted Signing. |
UIModern | Enables the modern UI interface: 0=Classic UI , 1=Modern UI . Overrides IsWizard if specified. |
[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¶
[Source]
0=C:\MyWork\Project\Source\*.*
1=C:\MyWork\Project\Readme.txt
2=C:\Windows\System\cabinet.dll
3={$PBDIRECTPATH$}\Data\*.xml
💡 Use Directive Variables like {$PBDIRECTPATH$}
to avoid hardcoded paths.
[Components] Section¶
Defines optional components that users can select during installation.
Example Component Structure¶
[Components]
0=Documentation
1=Pictures
[Documentation.Source]
0=C:\Project\Help\*.chm
[Documentation.Properties]
Description=Application Documentation
Title=Documentation
StoringPath=1
- Each component requires a
[ComponentName.Source]
and[ComponentName.Properties]
section. - The Main component always exists and is defined in
[Main.Properties]
.
📖 Learn more: 👉 Component Management.
Directive Variables¶
Directive variables allow dynamic path replacement in directive files.
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¶
[Source]
0={$PBDIRECTPATH$}\Source Files\*.*
1={$PBDIRECTPATH$}\Docs\*.pdf
💡 Now, you can move the directive file without breaking file paths!
[SignToolCmd] Section – Custom SignTool Commands¶
This section allows multiple digital signatures to be applied sequentially. ⚠️ Only read if SignCertifLocation is set to 3.
Example:
[SignToolCmd]
0=sign /fd SHA256 /tr "http://timestamp.digicert.com" /td SHA256 "{$BOUTPUTFILES}"
1=sign /fd SHA1 /tr "http://timestamp.digicert.com" /td SHA1 "{$BOUTPUTFILES}"
- Each line represents one signing command.
- Executed in order (e.g., first SHA-256, then SHA-1).
Define Custom Directive Variables¶
Create your own variables inside [DirectiveVariables]
.
[DirectiveVariables]
MYVERSION=1.0
OUTPUTNAME=Installer
Use them in any section:
[General]
Title=My archive {$MYVERSION$}
OutputName={$OUTPUTNAME$} {$MYVERSION$}.exe
Example: Simple Directive File Without Source¶
; Paquet Builder Directive File
[General]
Title=My archive 1
NoSourceSection=1
OutputName=Direct2.exe
OutputDir=C:\Build\Output
ProjectTemplate=C:\Build\Template.pbpx
LiveUpdate=1
💡 Use NoSourceSection=1
if your directive modifies an existing project.
Conclusion¶
Directive files provide a powerful way to automate Paquet Builder workflows.
✔ Easily generate packages via scripts.
✔ Modify project parameters dynamically.
✔ Use variables to avoid hardcoded paths.
📖 Related Topics:
- 👉 How to Open and Execute Directives
- 👉 Working with Components