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.
This project provides three PowerShell scripts that can be used independently or together:
Compresses a .sig file into a .zig archive.
.\sigtozig.ps1 <path-to-sig-file>Example:
.\sigtozig.ps1 .\MyProgram\MyProgram.sigThis creates MyProgram.zig in the same directory as the .sig file.
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 -VerboseThe -Verbose flag shows the archive contents before and after embedding.
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 -VerboseRequirements:
- The
.sigfile must exist in the same directory with the same base name as the.lpz - Both
sigtozig.ps1andembedzig.ps1must be in the same directory asembedsig.ps1
-
Compile your SIMPL Windows program (generates
.lpzand.sigfiles) -
Run
embedsig.ps1to create and embed the.zig:.\embedsig.ps1 .\MyProgram\MyProgram.lpz
-
Deploy the modified
.lpzto your processor via FTP/SFTP -
Issue
progloadcommand via SSH -
The
.zigfile is now on the processor and SIMPL Debugger will find it automatically
If you prefer not to modify the .lpz file, you can upload the .zig separately:
-
Compile your SIMPL Windows program (generates
.lpzand.sigfiles) -
Run
sigtozig.ps1to create the.zig:.\sigtozig.ps1 .\MyProgram\MyProgram.sig
-
Upload the
.lpzto the processor via FTP/SFTP -
Issue
progloadcommand via SSH (this extracts the.lpz) -
IMPORTANT: Upload the
.zigfile AFTERprogloadcompletes
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.
For a streamlined workflow, you can configure WinSCP custom commands to run embedsig.ps1 on .lpz files before uploading.
Setup:
- In WinSCP, go to Options → Preferences → Integration → Commands
- Click Add to create a new custom command
- 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
- Description:
Replace C:\Path\To\embedsig.ps1 with the actual path to your script. The "!" placeholder represents the selected file path.
Usage:
- In WinSCP's local file panel, navigate to your compiled program directory
- Select the
.lpzfile - Right-click and choose Custom Commands → Embed .sig into .lpz (or use your keyboard shortcut)
- The script runs and embeds the
.ziginto the.lpz - Upload the modified
.lpzto the processor - 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.
When a Crestron SIMPL Windows program is compiled, it generates:
- A
.lpzarchive containing the compiled program files - A separate
.sigfile 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:
- On the processor - looks for a
.zigfile (compressed format) - On the local disk - looks for the
.sigfile at the compile-time path stored in program metadata - User prompt - shows a file dialog asking the user to locate the
.sigfile
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
.lpzand selectively uploads files to the processor, then compresses and uploads the.sigas.zigseparately. Even if you embed a.ziginside the.lpz, Toolbox ignores/discards it. - FTP/SFTP +
progload(preferred by most professionals) - the.lpzis transferred via FTP/SFTP, thenprogloadis issued via SSH. This extracts the entire.lpzcontents, including any embedded.zigfile.
The impact:
Without the .zig on the processor, debugging requires either:
- Access to the original
.sigfile on the local machine (unavailable to on-site technicians) - Manually locating and pointing SIMPL Debugger to the
.sigfile (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.