roBrightPackage

 

An roBrightPackage object represents a .zip file, which can include arbitrary content or be installed on a storage device to provide content and script updates (for example, to distribute updates via USB thumb drives). The JavaScript equivalent is the Node.js Zlib API.

Object Creation: The roBrightPackage object is created with a filename parameter that specifies the name of the .zip file.

CreateObject("roBrightPackage", filename As String)

Limitations

The roBrightPackage object supports .zip files that are smaller than 4GB only.

Supported Technologies

  • deflate32 (with default options)

  • PPMd (with default options)

  • WinZip (with "No compression", "Maximum", and "SuperFast" options; other options, including "Enhanced Deflate", are not supported)

  • AES encryption

Unsupported Technologies

  • bzip2

  • LZMA

  • Deflate64

  • zip64 (i.e. the compression software built in to Windows Explorer)

ifBrightPackage

ifBrightPackage is a legacy interface. We recommend you use roAssetPool instead to achieve better functionality.

Unpack(path As String) As Void

Extracts the .zip file to the specified destination path. Any preexisting files in the target directory will be deleted as part of this operation. Providing a destination path of "SD:/" will wipe all preexisting files from the card and extract the .zip contents to the root folder.

SetPassword(password As String) As Void

Provides the password specified when the .zip file was created. This method supports AES 128 and 256 bit encryption, as generated by WinZip.

GetFailureReason() As String
 
UnpackFile(a As String, b As String) As Boolean
Example
package = CreateObject("roBrightPackage", "newfiles.zip") package.SetPassword("test") package.Unpack("SD:/")

Using roBrightPackage for Content Updates

BrightSign players check storage devices for autorun scripts in the following order:

  1. External USB devices 1 through 9

  2. SD

  3. µSD

In addition to looking for autorun.brs scripts, BrightSign players look for autorun.zip files that contain the script name autozip.brs. If an autorun.zip file with an autozip.brs file is found, and autozip.brs can be decrypted, then the player will execute the autozip.brs file.

Important

The autozip.brs file cannot reference any external files, as it is the only file to be automatically uncompressed by a BrightSign player prior to execution.

The autozip.brs script should unpack the contents of the autorun.zip file to an installed storage device and reboot to complete the update:

Example
package = CreateObject("roBrightPackage", "SD:/autorun.zip") package.Unpack("SD:/") MoveFile("SD:/autorun.zip", "SD:/autorun.zip_invalid") RebootSystem()

Unpacking Encrypted Archives

If the autorun.zip file is encrypted, then the player uses the password stored in the registry, in the section "security" under the name "autozipkey," to decrypt the file.

Extended Example

ON THIS PAGE