Navigation:  ThinBASIC Tools > thinBundle >

#BUNDLE File

Previous pageReturn to chapter overviewNext page

 

Description

 

Pass to BUNDLE process new files to be included into bundled executable.

 

Syntax

 

#BUNDLE File [Once] "FileID", "Source file path name", "Destination file path name" [, BundleOption=Value]

 

Returns

 

None.

 

Parameters

 

File names:

 

File name

Meaning

"FileID"

It is an optional unique identifier of the file. If omitted (empty string) thinBundle will create one using "FILE0000" template where 0000 will be substituted with the sequence of the file in the bundled executable

FileID must be a string composed only by letters and numbers. No spaces, not special chars like punctuations.

"Source file path name"

It is the name and location of the Source file to be included in Bundled executable.

Path can be absolute: in this case it will be searched exactly where specified.
Path can be relative: relative means relative to script source path.

 

Any kind of files can be specified.

If source file is not found, it will  produce a blocking error in bundle process.

 

"Destination file path name"

It is the name and location of the output file when it will be extracted from the Bundled executable on execution startup.

 

It can be an empty string: in this case the source name will be used and extracted in the same path of the Bundled executable

 

If specified, it can have no path, an absolute path or a relative path.

no path and only file name: it means file will be extracted from bundled executable and placed in the same directory of the executable with the specified name
absolute path: file will be extracted in the absolute path specified with the indicated name
relative path: file will be extracted and path will be relative to the bundled executable path.

 

 

Available options: optional flags can be indicated in order to change standard behave.

There are options for source file and options for destination file.

 

Options for source file

Meaning

Default

FileIsMandatory

If source file does not exists, it will produce a bundle error preventing possibility to create bundled script

1

 

Options for destination file

Meaning

Default

ExtractOnRun

If 1, the file will be extracted when bundled execution will start

1

CreateFullPath

If 1, when bundled execution will start it will ensure that destination directory exists otherwise it will be created

1

ReplaceExisting

If 1, when bundled execution will start, if destination file exists it will be replaced

1

DeleteOnClose

If 1, when bundled execution will finish, destination file will be removed from disk

1

 

Remarks

 

Once option instruct thinBasic the check if current specified file has already been specified. If yes, it will be just skipped

 

Restrictions

 

This directive is a pre parsing directive.

It means all #BUNDLE ... statements will be solved before starting script execution.

 

See also

 

Examples

 

#BUNDLE File "LIC", ".\Licence.txt"         , ".\Licence\"    , ReplaceExisting=1, DeleteOnClose=0, CreateFullPath=1

#BUNDLE File ""   , ".\Resources\MyLogo.png", "Logo.Png"      FileIsMandatory=0, ReplaceExisting=1, DeleteOnClose=1

#BUNDLE File "DB1", ".\DB\OriginalDB.MDB"   , ".\DB\AppDB.MDB"