Publishing an Executable
See this page in the Vizard Documentation on how to publish your SightLab script as an executable if you wish to distribute it to users who are not running Vizard.
Note this is currently only supported for scripts that don't use the GUI. Either non-GUI, or if created with the GUI need to run with gui=False, configpath = 'sightlab_configs/recent_config.stlb'
For publishing executables with the interactive replay you may need to also share your Resources/environments (or Resources/media for 360 media) folder, or whatever folder has the assets you are using.
You will also need to make a separate executable of the SightLabVR_Replay file and copy that to the folder with your exe to use the replay.
To choose which vizconnects (hardware configurations) to show for the hardware configuration dropdown add this code. To see the available options see the settings.py file
#Add before importing sightlab
from sightlab_utils import settings
settings.VIZCONNECT_CONFIG_LIST = ['Desktop',''Meta Quest 3'']
-
See ExampleScripts\PublishExe in the SightLab ExampleScripts Directory for publish exe examples
-
Make sure to run from the Vizard IDE with File- Publish as Exe
-
Note it may take longer than normal for the script to start
-
Data files will be saved to the folder you run the exe from

-
Drag "data" folder into the screen where it prompts for any missing files

Example
Add the published directories
# =============================================================================
# PUBLISH CONFIGURATION - Must be BEFORE any sightlab imports!
# =============================================================================
import viz
# Filter out problematic packages that cause issues in published EXE
viz.res.addPublishFilter('*google_generativeai*')
viz.res.addPublishFilter('*-nspkg.pth')
viz.res.addPublishFilter('*.pth')
# Add publish directories - ensures correct package versions are bundled
publish_directories = [
'data',
viz.res.getVizardPath() + 'bin/lib/site-packages/sightlab_utils/',
viz.res.getVizardPath() + 'bin/lib/site-packages/deepdiff',
viz.res.getVizardPath() + 'bin/lib/site-packages/numpy',
viz.res.getVizardPath() + 'bin/lib/site-packages/pandas',
]
for directory in publish_directories:
viz.res.addPublishDirectory(directory)
Session Replay EXE
(Note: Any environments or assets that may be used with the Session Replay will need to be included in the exe)
Use this for published directories, where the Resources/environments is the name of where your assets for 3D models are or Resources/media for 360 media
publish_directories = [
'data',
'Resources/environments/',
viz.res.getVizardPath() + 'bin/lib/site-packages/sightlab_utils/'
]
for directory in publish_directories:
viz.res.addPublishDirectory(directory)
Multi-User
For multi-user scripts you can use the same example code, but need to add this additional code to the client and server:
Server:
(When calling the SightLab class):
sightlab = sl.SightLabServer(gui=False,configpath='sightlab_configs/recent_config_server.stlb')
Client:
Add the additional resources below:
publish_directories = [
'data',
'sightlab_configs',
'Resources',
viz.res.getVizardPath() + 'bin/lib/site-packages/sightlab_utils/',
viz.res.getVizardPath() + 'bin/lib/site-packages/deepdiff',
viz.res.getVizardPath() + 'bin/lib/site-packages/numpy',
viz.res.getVizardPath() + 'bin/lib/site-packages/pandas',
]
Next, add this code when calling the SightLab Class (where after hardwareconfig put the name of the hardware file you are using and after server, need to hardcode the name of the server machine) :
sightlab = sl.SightLabClient(configpath = 'sightlab_configs/recent_config_client.stlb', hardwareconfig = "Desktop", server = "PREDATOR-VR1")
To change the server or hardware later without republishing, see Set the Server and Hardware from a Text File below.
Lastly, you may need to manually copy the 'Data' folder to this location:
C:\Users\UserName\AppData\Local\SightLab\Application\Script
Set the Server and Hardware from a Text File
Hardcoding server and hardwareconfig locks a published client EXE to one server machine and one hardware setup, so any change means republishing. Instead, the client can read both values from a text file in the same folder as the EXE. Each client PC can then edit that file to point to its own server and headset.
1. Create the settings file
Create client_settings.txt in the same folder as your client script:
# Client settings - read each time the client EXE starts.
# Keep this file in the same folder as the .exe. Edit, save, then relaunch the .exe.
# server: computer name or IP address of the machine running the server
server = PREDATOR-VR1
# hardwareconfig: SightLab hardware name, spelled exactly (case-sensitive), e.g.
# Desktop, Meta Quest 3, Meta Quest Pro, Vive Focus Vision, OpenXR EyeTR, SteamVR
hardwareconfig = Desktop
2. Read it in the client script
Replace the sl.SightLabClient(...) line with the code below. The values in client_settings are the defaults, used if the file or a line is missing.
import os
# Read server / hardwareconfig from client_settings.txt in the same folder as the
# published EXE (or this script's folder when run from Vizard).
CLIENT_SETTINGS_FILE = viz.res.getPublishedPath('client_settings.txt')
client_settings = {'server': 'PREDATOR-VR1', 'hardwareconfig': 'Desktop'}
if os.path.isfile(CLIENT_SETTINGS_FILE):
with open(CLIENT_SETTINGS_FILE, 'r', encoding='utf-8-sig') as f: # -sig: tolerate Notepad's BOM
for line in f:
line = line.strip()
if not line or line.startswith('#') or '=' not in line:
continue
key, value = line.split('=', 1)
key = key.strip().lower()
if key in client_settings:
client_settings[key] = value.strip().strip('"\'')
else:
print(f"Ignoring unknown setting '{key}' in {CLIENT_SETTINGS_FILE}")
print(f"Loaded {CLIENT_SETTINGS_FILE}: {client_settings}")
else:
print(f"{CLIENT_SETTINGS_FILE} not found, using defaults: {client_settings}")
sightlab = sl.SightLabClient(configpath = 'sightlab_configs/recent_config_client.stlb', hardwareconfig = client_settings['hardwareconfig'], server = client_settings['server'])
3. Publish, then place the file next to the EXE
Publish the client as usual. Do not add client_settings.txt to publish_directories, because files bundled into the EXE are unpacked to the AppData folder, where users won't find them. Instead, copy client_settings.txt into the same folder as the client .exe when you distribute it. To change the server or hardware, edit the file, save it, and relaunch the EXE.
Note
viz.res.getPublishedPath()returns the path in the folder that contains the published EXE. When the script is run from Vizard instead, it returns the file name unchanged, so the copy in your script's folder is used.hardwareconfigmust exactly match one of the hardware names in settings.py. Otherwise SightLab shows "Hardware config not found" and quits.servercan be the server's computer name or its IP address.- To make other values editable, add them to the
client_settingsdictionary and the text file. The same approach also works for the server script.
Additional Information
See this page in the Vizard Documentation for more information
Additional built in options related to publishing can be modified in the sightlab_config.py file in sightlab_utils (C:\Program Files\WorldViz\Vizard\<version>\bin\lib\site-packages\sightlab_utils)
For video recording as an option add
viz.setOption('viz.publish.allow_capture_video',1)
For adding additional python libraries use this code:
viz.res.getVizardPath() + 'bin/lib/site-packages/sightlab_utils/',
viz.res.getVizardPath() + 'bin/lib/site-packages/deepdiff',
viz.res.getVizardPath() + 'bin/lib/site-packages/numpy',