Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

ON THIS PAGE


An roBrightPackage object represents a .zip file. The .zip file can include arbitrary content or can be installed on a storage device to provide content and script updates (for example, to distribute updates via USB thumb drives).

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

CreateObject("roBrightPackage", filename As String)

ifBrightPackage

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. roBrightPackage supports AES 128 and 256 bit encryption, as generated by WinZip.

GetFailureReason() As String

UnpackFile(a As String, b As String) As Boolean

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

Example
package = CreateObject("roBrightPackage", "newfiles.zip")
package.SetPassword("test")
package.Unpack("SD:/")

Using roBrightPackage to Distribute New Content    

BrightSign checks 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 autozip.brs is encrypted, then the player uses the password stored in the registry, in the section "security" under the name "autozipkey," to decrypt the file. If an autorun.zip file with an autozip.brs file is found, and autozip.bas is decrypted, then the player will execute the autozip.brs file.

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 unpacks the contents of the autorun.zip file to an installed storage device and reboots to complete the update.

Example
' Content update application


r=CreateObject("roRectangle", 20, 668, 1240, 80)
t=CreateObject("roTextWidget",r,1,2,1)
r=CreateObject("roRectangle", 20, 20, 1200, 40)
t.SetSafeTextRegion(r)
t.SetForegroundColor(&hff303030)
t.SetBackgroundColor(&hffffffff)
t.PushString("Updating content from USB drive, please wait...")


package = CreateObject("roBrightPackage", "autorun.zip")
package.SetPassword("test")
package.Unpack("SD:/")
package = 0


t.Clear()
t.PushString("Update complete - remove USB drive to restart.")


while true
       sleep(1000)


       usb_key = CreateObject("roReadFile", "USB1:/autorun.zip")
       if type(usb_key) <> "roReadFile" then
             a=RebootSystem()
       endif
       usb_key = 0
end while

 

 

  • No labels