About Directive Files

This page is designed for advanced users: it describes how you can use Paquet Builder to create packages (even silently) without navigating through the steps, but with command line switches.

What is a switch?

All switches are specified with a forward slash and are sometimes followed by a value.
Example of valid switch: /C

Please note that if you are specifying files or folders with spaces in them, you should enclose them in quotation marks.
Example of switch: /U "http://www.gdgsoft.com" /C

Command line options to manage project files

You can indicate project files to Paquet Builder thanks to the command line. When you launch Paquet Builder manually (for instance with the "Run" command from the Windows Start menu), you can pass parameters to the program.

The following command line opens a project file: PBUILDER.EXE "c:\mywork\myproject\myproject.pbp". Paquet Builder will be opened and it will read the settings from Paquet Builder. All you have to do is to press the Compile button and the package will be created.

Paquet Builder supports command line switches for the project files:

  • /b will load the project and show the Compilation page.
  • /c forces Paquet Builder to compile the package silently according to the project file specified previously.
  • /q will force Paquet Builder to exit after a successful compilation.
  • /l causes Paquet Builder to perform a live update of all files & components when the project is loaded and before any other operation such as compilation.

Remember that you have options for live update in the Environment Options.

You can of course make some combinations with the preceding switches. For example,
PBUILDER.EXE "c:\mywork\myproject\file.pbd" /c/q will force Paquet Builder to compile the package silently and then exit.

Introduction to directive files

Paquet Builder introduces a specific file type called "directive file": Paquet Builder's directive files are given the extension .pbd. They are text based and they contain instructions for Paquet Builder in order to create a package. Directive files are useful for external applications which need to create packages (for instance, the Paquet Builder's shell extension works with directive files) or modify existing projects (transforms).

How do directive files work?

Directives files work like the old Windows configuration (.ini extension) files. Below you can see an example:

; Paquet Builder Directive File
; Version 1.1

[General]
Title=My archive 1
ProjectTemplate=c:\mywork\myproject\baseproj.pbp
Output=c:\mywork\myproject\output\myarc.exe
IsWizard=1
StorePaths=1
Folder=c:\mywork\source\
SubFolders=1
OutputLog=c:\mywork\myproject\output\result.rtf
Icon=c:\mywork\myproject\media6.ico

[Source]
0=c:\mywork\myproject\source\*.*

They must contain the "General" section but you can also have several additional sections like "Source", "Templates", "Components", etc...

The "Source" section is mandatory too unless NoSourceSection is turned on (see below).

General Section

The "General" section contains parameters that configure the package. If a parameter is not specified, then the default value is used (or the one of the template project). Parameters can be specified in any order you wish.

  • Title (required): defines the title for the package.
  • Project: specifies the path to the project file that Paquet Builder should create when compiling the package. Leave the field blank if you do not want Paquet Builder to create a project file.
  • Output (required): defines the path to the executable file that Paquet Builder will create (i.e. the package filename).
  • NoSourceSection: indicates that there is no Source section in the directive file. Boolean type: 1 means true, 0 means false. You should use this property only if you also specify a project template with ProjectTemplate.
  • ProjectTemplate: if you would like to use an existing project and modify its parameters, then specify the full path to this project file. Paquet Builder will open it first, read all of these settings, then it will perform the changes indicated by the directive file and finally optionally compile the package. This property is useful if you wish to create similar packages but with different components, files or parameters.
  • LiveUpdate: causes Paquet Builder to perform a live update of all files & components when the template project is loaded. Only works if ProjectTemplate is specified. Boolean type.
  • PackMode (required): specifies the type of project to create. Remember that if you create a Setup type, you need to specify the setup loader at least. Values: 0: Standard ; 1: Setup ; 2: Archive ; 3: Media.
  • Compression (required): defines the compression to be used. Values: 0: Zip ; 1: Cabinet ; 2: 7-Zip. Required.
  • ExistingArchive: instead of listing files to be compressed, you can specify the full path to an existing archive (Zip or Cabinet). Be sure the compression method corresponds to the type of archive. If you use this property, then the "Source" section becomes useless, but you can still use it.
  • SubFolders: defines whether Paquet Builder should include sub-folders when adding folders and wildcards. Boolean type: 1 means true, 0 means false.
  • StorePaths: defines whether Paquet Builder stores path information or not. Be sure to specify the relative folder if necessary. Boolean type.
  • Folder: indicates the folder to be used as the root folder for storing path information.
  • KeepExistingProjectFiles: if you work with the ProjectTemplate property and your project did contain files, this property tells Paquet Builder whether it should keep the existing files or reset the files list when adding files specified by the directive file. This property is ignored if NoSourceSection is set to "1".
  • OutputLog: if you would like to save the compilation log to a RTF file, then specify the full path to this file.
  • SetupExec: if a "Package for Setup" or a Media Package are created, then you must specify the name of the installation loader/multimedia program. Otherwise use this property to specify a document or program file to be run after the files extraction.
  • SetupParams: specify the command line parameters to pass to the run program (SetupExec).
  • StartPrompt: modify the prompt to be displayed at startup.
  • EndPrompt: modify the prompt to be displayed at end.
  • DestFolder: defines the destination folder for files. Do not use it if you create a Setup package. For a Media package, specifies the temporary folder to be used (generally %TMP%\YourCompanyName).
  • Icon: full path to the icon file to be used for the package.
  • Copyright: changes the legal copyright text for your package. Otherwise the default one is used.
  • IsWizard: boolean type (two values 1 (true) or 0 (false)). Indicates whether the package's user interface should have a wizard theme or a standard theme.
  • WizSplash: indicates the splash picture to be used if you create a wizard package. Refer to user interface.
  • WizBanner: indicates the bitmap to be used for the wizard banner if you create a wizard package. Refer to user interface.
  • FileDesc: sets the package's file description in the Version Information resource.
  • FileVerNum: sets the package's file version number in the Version Information resource.
  • ProdVerNum: sets the package's file product number in the Version Information resource.
  • ShowCompSelDlg: indicates whether the Select Components dialog box should be displayed or not. Boolean type.
  • OverwriteReadOnly: indicates whether files with read-only attribute should be overwritten. Boolean type.
  • ReplaceStartup: defines if locked files have to be replaced at Windows startup. Boolean type.
  • Silent: activates the silent mode or not. Boolean type.
  • CanStopExtraction: defines if the end user can stop the extraction process. Boolean type.
  • HideProgress: indicates whether the progress indicator is displayed or not. Boolean type.
  • CheckRights: if you want to check for administrative or power user rights. Boolean type.
  • MinimumUserRights: only read if CheckRights is set to "1". 0 = administrative ; 1 = power user rights.
  • RequestElevatedRights: if you want to request elevated rights on Windows Vista. Boolean type.
  • MinimumElevatedRights: only read if RequestElevatedRights is set to "1". 0 = Require Administrator ; 1 = Highest Available.
  • SizeCheck: activates the size check or not. Boolean type.
  • IntegrityCheck: activates the package integrity check or not. Boolean type.
  • DigitalSign: indicates whether the package should be digitally signed. Boolean type.
  • PFXFile: path to the PFX file used for digital signing with SignTool (or SPC with SignCode).
  • PFXKey: optional password for the PFX file (SignTool) or path to the PVK file (SignCode).
  • SignURL: optional URL to an information page about the package.
  • CryptFilenames: tells Paquet Builder to encrypt file names when compressing files. Boolean type and only read if Compression is set to 7-Zip.

Source Section

The "Source" section is the list of files that should be included. It can contain wildcards. It must be an ordered list: each entry begins with its number in the list and points to a path or a file.
Allowed: single files, wildcards (*. + extension ; *.* for instance). Paquet Builder can include sub directories when adding an entire folder: use the "SubFolders" property described above.

Example:

[Source]
0=c:\mywork\myproject\source\*.*
1=c:\mywork\myproject\readme.txt
2=c:\windows\system\cabinet.dll
3=c:\mywork\myproject\shared\*.obj

Components Section

This section lets you create components or configure the properties of existing ones. Please first refer to the Component Overview help topic before using this section.

The Components section is a list of the components that should be created. It must be an ordered list: each entry begins with its number in the list and points to the component name.

Example:

[Components]
0=Documentation
1=Pictures
2=SystemData

When processing a Component entry of the "Components" section, Paquet Builder will look for two other sections associated to the component. These sections are called "{Component Name}.Source" and "{Component Name}.Properties", where {Component Name} designates the name of the component in the "Components" section. For example, if the component name is "Documentation", the two sections should be "Documentation.Source" and "Documentation.Properties".

The "Main" component is always created and the "Source" section above actually corresponds to the files that should be added to the Main component. You can however still configure the properties of the Main component using the section "Main.Properties" (see the last example below).

{Component Name}.Source Section

Indicates the list of files that should be added to the component "{Component Name}" (must be referenced in the Components section). It works exactly like the "Source" section above so please refer to this paragraph for further information.

{Component Name}.Properties Section

Defines the properties of the associated component "{Component Name}". This section is optional.

Includes the following parameters:

  • Variable: name of the variable associated to the component. Must begin by VCOMP and enclosed into two % symbols. By default: %VCOMP{component name}%.
  • Description: description associated with the component.
  • Title: title of the component which should appear in the Select Components dialog box.
  • Required: indicates whether end users can turn on/off the component or not. Boolean type.
  • InstallDef: indicates whether the component is installed by default or not. Boolean type.
  • NoDisplay: if set to "1" (true), the component is not displayed in the Select Components dialog box. Boolean type.
  • SourceLinked: is the component linked to a source folder? Boolean type. If true, you must specify the source folder.
  • SourceFolder: the path to the source folder if the component is linked to it.
  • StoringPath: three possible values (0, 1 or 2) - 0 by default. Defines how path information should be stored for the files inside the component.
    • 0: uses global settings (that you can also configure in the General section above).
    • 1: uses the root folder specified by RootFolder.
    • 2: no path information should be stored, only filenames.
    • 3: uses the component's source folder specified by SourceFolder.
  • RootFolder: if StoringPath is set to "1", RootFolder must indicate the path of the root folder.

Templates Section

The "Templates" section includes the list of rich text files that should be used with specific dialogs like Welcome Screen, Readme, License Agreement or Final Screen. An entry should be the name of the dialog followed by = and then by the full path to the rich text file to be used.

  • Welcome: indicates the RTF file to be used for the Welcome screen.
  • StartReadme: indicates the RTF file to be used for the Starting Readme.
  • EndReadme: indicates the RTF file to be used for the After Extraction Readme.
  • End: indicates the RTF file to be used for the End screen.
  • LicAg: indicates the RTF file to be used for the license agreement.

Some entries are ignored if you do not create a Wizard package (refer to user interface).

Example:

[Templates]
Welcome=c:\mywork\myproject\welcom1.rtf
StartReadme=c:\mywork\myproject\readme.rtf
End=c:\mywork\myproject\final.rtf

Example of directive file with components

The following directive file creates two components called "Documentation" and "Pictures" in addition to the "Main" one. It will also display the Select Components dialog box to allow end users to choose which components they wish to install.

; Paquet Builder Directive File
; Version 1.1

[General]
Title=My archive 1
Output=C:\My Documents\pb\Output\direct1.exe
IsWizard=1
StorePaths=0
SubFolders=0
OutputLog=C:\My Documents\pb\Output\result.rtf
Icon=C:\My Documents\pb\installer.ico
ShowCompSelDlg=1

[Components]
0=Documentation
1=Pictures

[Source]
0=C:\My Documents\Works\Application Demo\bin\*.*

[Main.Properties]
Description=Main Application Files
NoDisplay=1
; This component is installed by default. No need to show it to end users.

[Documentation.Source]
0=C:\My Documents\Works\Application Demo\help\*.chm

[Documentation.Properties]
Description=Installs the documentation of the application (recommended)
Title=Documentation
StoringPath=1
RootFolder=C:\My Documents\Works\Application Demo\

[Pictures.Source]
0=C:\My Documents\Works\Application Demo\pictures\*.*
1=C:\My Documents\My pictures\templates\*.jpg

[Pictures.Properties]
Description=Installs the pictures to be used with the application.
Title=Sample pictures

Example of simple directive file without source:

; Paquet Builder Directive File

[General]
Title=My archive 1
NoSourceSection=1
Output=C:\My Documents\pbdebug\output\direct2.exe
ProjectTemplate=C:\My Documents\pbdebug\testmsi1.pbp
OutputLog=C:\My Documents\pbdebug\output\result.rtf
LiveUpdate=1

This directive is only intended to change the name of the output file & refresh the file list. Paquet Builder will just load our testmsi1.pbp project, perform a live update, change the package filename and that's all. You can of course add more parameters if you wish.

How to make directive files executed by Paquet Builder?

Without using the command line, select the "File|Open Directive File" menu command.

Otherwise you need to specify the path to the directive file thanks to the command line. When you launch Paquet Builder manually (for instance with the "Run" command from the Windows Start menu), you can pass parameters to the program.

The following command lines will execute a directive file:

PBUILDER.EXE "c:\mywork\myproject\file.pbd"

Paquet Builder will be opened and it will read the settings from the directive file. All you have to do is to press the Compile button and the package c:\mywork\myproject\output\myarc.exe will be created.

In addition Paquet Builder supports command line switches for the directive files:

  • /c forces Paquet Builder to compile the package according to the directive file specified previously.
  • /s will hide Paquet Builder when compiling (silent compilation).
  • /q will force Paquet Builder to exit after a successful compilation.

You can of course make some combinations with the preceding switches. For example,
PBUILDER.EXE "c:\mywork\myproject\file.pbd" /c/s/q will force Paquet Builder to compile c:\mywork\myproject\output\myarc.exe silently and then exit.

When a command line switch is specified, then the splash screen is automatically hidden. Only a window will appear in the Windows task bar with the title "Paquet Builder - 5% compiling". Paquet Builder also displays the progression of the compilation.


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