Skip to content

Norgate-AV/crestron-sig-helper-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crestron Sig Helper Scripts

A set of small PowerShell scripts to assist with compressing a Crestron .sig file into a .zig file, and optionally embedding it into a .lpz archive.

Usage

This project provides three PowerShell scripts that can be used independently or together:

sigtozig.ps1

Compresses a .sig file into a .zig archive.

.\sigtozig.ps1 <path-to-sig-file>

Example:

.\sigtozig.ps1 .\MyProgram\MyProgram.sig

This creates MyProgram.zig in the same directory as the .sig file.


embedzig.ps1

Embeds a .zig file into an existing .lpz archive.

.\embedzig.ps1 <path-to-lpz-file> <path-to-zig-file> [-Verbose]

Example:

.\embedzig.ps1 .\MyProgram\MyProgram.lpz .\MyProgram\MyProgram.zig -Verbose

The -Verbose flag shows the archive contents before and after embedding.


embedsig.ps1

High-level script that orchestrates both operations: creates a .zig from the corresponding .sig file and embeds it into the .lpz archive.

.\embedsig.ps1 <path-to-lpz-file> [-Verbose]

Example:

.\embedsig.ps1 .\MyProgram\MyProgram.lpz -Verbose

Requirements:

  • The .sig file must exist in the same directory with the same base name as the .lpz
  • Both sigtozig.ps1 and embedzig.ps1 must be in the same directory as embedsig.ps1

Typical Workflow

Option 1: Embed .zig into .lpz (Recommended)

  1. Compile your SIMPL Windows program (generates .lpz and .sig files)

  2. Run embedsig.ps1 to create and embed the .zig:

    .\embedsig.ps1 .\MyProgram\MyProgram.lpz
  3. Deploy the modified .lpz to your processor via FTP/SFTP

  4. Issue progload command via SSH

  5. The .zig file is now on the processor and SIMPL Debugger will find it automatically

Option 2: Upload .zig Manually

If you prefer not to modify the .lpz file, you can upload the .zig separately:

  1. Compile your SIMPL Windows program (generates .lpz and .sig files)

  2. Run sigtozig.ps1 to create the .zig:

    .\sigtozig.ps1 .\MyProgram\MyProgram.sig
  3. Upload the .lpz to the processor via FTP/SFTP

  4. Issue progload command via SSH (this extracts the .lpz)

  5. IMPORTANT: Upload the .zig file AFTER progload completes

Why the order matters: The progload command extracts the .lpz and overwrites the entire program directory. If you upload the .zig before running progload, it will be deleted during extraction.


WinSCP Integration

For a streamlined workflow, you can configure WinSCP custom commands to run embedsig.ps1 on .lpz files before uploading.

Setup:

  1. In WinSCP, go to OptionsPreferencesIntegrationCommands
  2. Click Add to create a new custom command
  3. Configure the command:
    • Description: Embed .sig into .lpz
    • Custom command: powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Path\To\embedsig.ps1" "!"
    • Check Local command
    • Shortcut key: (Optional) Assign a keyboard shortcut like Ctrl+Shift+E

Replace C:\Path\To\embedsig.ps1 with the actual path to your script. The "!" placeholder represents the selected file path.

Usage:

  1. In WinSCP's local file panel, navigate to your compiled program directory
  2. Select the .lpz file
  3. Right-click and choose Custom CommandsEmbed .sig into .lpz (or use your keyboard shortcut)
  4. The script runs and embeds the .zig into the .lpz
  5. Upload the modified .lpz to the processor
  6. SSH into the processor and run progload

Note: This is a manual step - you need to run the custom command before uploading. WinSCP custom commands don't run automatically on file operations.

Why?

When a Crestron SIMPL Windows program is compiled, it generates:

  • A .lpz archive containing the compiled program files
  • A separate .sig file containing program signals and their names, used for debugging in SIMPL Debugger

How SIMPL Debugger finds signal files:

SIMPL Debugger searches for the signal file in this order:

  1. On the processor - looks for a .zig file (compressed format)
  2. On the local disk - looks for the .sig file at the compile-time path stored in program metadata
  3. User prompt - shows a file dialog asking the user to locate the .sig file

The problem:

The ideal workflow is for the .zig file to always be present on the processor, so debugging works immediately without requiring access to the original source files.

However, deployment methods differ:

  • Crestron Toolbox - extracts the .lpz and selectively uploads files to the processor, then compresses and uploads the .sig as .zig separately. Even if you embed a .zig inside the .lpz, Toolbox ignores/discards it.
  • FTP/SFTP + progload (preferred by most professionals) - the .lpz is transferred via FTP/SFTP, then progload is issued via SSH. This extracts the entire .lpz contents, including any embedded .zig file.

The impact:

Without the .zig on the processor, debugging requires either:

  • Access to the original .sig file on the local machine (unavailable to on-site technicians)
  • Manually locating and pointing SIMPL Debugger to the .sig file (if you even have it)

The solution:

These scripts compress .sig files to .zig format and embed them into .lpz archives. When you deploy via FTP/SFTP + progload, the .zig is already inside the .lpz and gets extracted to the processor, making debugging accessible to anyone with SIMPL Debugger.

LICENSE

MIT

About

Helpers for uploading Crestron .sig files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors