Updated to better reflect the changes i've made recently

This commit is contained in:
2026-03-30 10:45:19 -07:00
parent 4bfed03621
commit c723a75756

View File

@@ -5,20 +5,23 @@ IT support tool that runs OBS Studio's replay buffer silently on VDI sessions, g
## How It Works ## How It Works
1. DEM runs `Start-OBSReplayBuffer.ps1` as a logon task 1. DEM runs `Start-OBSReplayBuffer.ps1` as a logon task
2. The script validates all required project files are accessible, then deploys OBS config files to `%APPDATA%\obs-studio\` automatically 2. The script validates all required project files are accessible — each path is polled for up to 2 minutes before failing, to handle slow network share availability at logon
3. OBS launches hidden with the replay buffer running — users never see the OBS interface 3. OBS config files are deployed to `%APPDATA%\obs-studio\` automatically
4. A system tray icon appears — right-click → **Save Replay** 4. OBS launches hidden; the script waits for the process to appear, locates the new OBS log file, then confirms the replay buffer has actually started before proceeding
5. The clip saves to `\\server\ITCaptures\<username>\YYYY-MM-DD_HH-MM-SS.mkv` 5. A WPF notification window informs the user that screen recording is active, shows the shield tray icon so they know what to look for, and auto-dismisses after 30 seconds
6. A system tray icon remains in the taskbar — right-click → **Save Replay**
7. On save, the script sends the request via WebSocket, then verifies a new `.mkv` file appears on disk before confirming success
8. A WPF confirmation window shows the saved filename and file size, and auto-dismisses after 30 seconds
## Architecture ## Architecture
| Component | Role | | Component | Role |
|---|---| |---|---|
| **DEM Logon Task** | Runs `Start-OBSReplayBuffer.ps1` at logon — only DEM task required | | **DEM Logon Task** | Runs `Start-OBSReplayBuffer.ps1` at logon — only DEM task required |
| **`config.psd1`** | Central config — UNC path, buffer duration, OBS executable path | | **`config.psd1`** | Central config — UNC path, buffer duration, OBS executable path, IT contact number |
| **`Start-OBSReplayBuffer.ps1`** | Validates project files, deploys OBS config, creates user capture folder, writes OBS profile, launches OBS + tray icon | | **`Start-OBSReplayBuffer.ps1`** | Validates project files (with retry), deploys OBS config, creates user capture folder, writes OBS profile, launches OBS, confirms replay buffer started via log, shows startup notification, launches tray icon |
| **`Show-ReplayTray.ps1`** | WinForms system tray icon — right-click menu with Save Replay / Exit | | **`Show-ReplayTray.ps1`** | WinForms system tray icon — right-click menu with Save Replay / Exit |
| **`Invoke-ReplaySave.ps1`** | Sends `SaveReplayBuffer` to OBS via WebSocket v5 (built into OBS 28+) | | **`Invoke-ReplaySave.ps1`** | Sends `SaveReplayBuffer` to OBS via WebSocket v5, verifies the file was written to disk, shows save confirmation popup |
| **`obs-config/`** | OBS config files — deployed to `%APPDATA%\obs-studio\` at logon by the script | | **`obs-config/`** | OBS config files — deployed to `%APPDATA%\obs-studio\` at logon by the script |
## Repository Structure ## Repository Structure
@@ -58,6 +61,7 @@ Edit `config.psd1` before deploying:
| `OBSExecutable` | Full path to `obs64.exe` on the target machine | `C:\Program Files\obs-studio\bin\64bit\obs64.exe` | | `OBSExecutable` | Full path to `obs64.exe` on the target machine | `C:\Program Files\obs-studio\bin\64bit\obs64.exe` |
| `ProfileName` | OBS profile name — must match the folder under `obs-config/profiles/` | `ITMonitor` | | `ProfileName` | OBS profile name — must match the folder under `obs-config/profiles/` | `ITMonitor` |
| `SceneCollection` | OBS scene collection name — must match the filename under `obs-config/scenes/` | `ITMonitor` | | `SceneCollection` | OBS scene collection name — must match the filename under `obs-config/scenes/` | `ITMonitor` |
| `ITContactNumber` | IT help desk phone number shown in startup and save confirmation popups | `555-555-5555` |
## Deployment ## Deployment
@@ -77,7 +81,7 @@ Create one logon task in DEM (scoped to the target user group). Set it to **not
powershell.exe -ExecutionPolicy Bypass -NonInteractive -WindowStyle Hidden -File "\\stcu-fs01\IT-Tools\OBS-Record\scripts\Start-OBSReplayBuffer.ps1" powershell.exe -ExecutionPolicy Bypass -NonInteractive -WindowStyle Hidden -File "\\stcu-fs01\IT-Tools\OBS-Record\scripts\Start-OBSReplayBuffer.ps1"
``` ```
This is the only DEM task needed. The script handles all config file deployment, folder creation, and launching both OBS and the tray icon. It will exit cleanly (code 1) if any required project file is inaccessible, or exit 0 if OBS is already running. This is the only DEM task needed. The script handles all config file deployment, folder creation, and launching both OBS and the tray icon. It will exit cleanly (code 1) if any required project file is inaccessible after the 2-minute retry window, or exit 0 if OBS is already running.
> **No DEM file transfer tasks are needed.** The script deploys `global.ini` and the scene collection from the repo to `%APPDATA%\obs-studio\` at each logon. `basic.ini` is written dynamically so the correct UNC path, primary monitor resolution, and monitor device ID are baked in per session. > **No DEM file transfer tasks are needed.** The script deploys `global.ini` and the scene collection from the repo to `%APPDATA%\obs-studio\` at each logon. `basic.ini` is written dynamically so the correct UNC path, primary monitor resolution, and monitor device ID are baked in per session.
@@ -89,14 +93,14 @@ This is the only DEM task needed. The script handles all config file deployment,
## User Experience ## User Experience
- A shield icon appears in the system tray at logon — no other UI is visible - At logon, a WPF popup notifies the user that screen recording is active, explains the replay buffer, shows the shield tray icon so they know what to look for, and includes the IT contact number — auto-dismisses after 30 seconds or on OK
- Right-click the icon**Save Replay** to save the last `BufferSeconds` of screen activity - A shield icon remains in the system tray — right-click**Save Replay** to save the last `BufferSeconds` of screen activity
- A Windows toast notification confirms success or failure (falls back to a message box if toast is unavailable) - After a save, a WPF confirmation popup shows the saved filename and file size — auto-dismisses after 30 seconds or on OK
- Clips appear at `\\server\ITCaptures\<username>\` named by timestamp - Clips appear at `\\server\ITCaptures\<username>\` named by timestamp
- Logs are written to `\\server\ITLogs\<username>\` — three files, one per script: - Logs are written to `\\server\ITLogs\<username>\` — three files, one per script, overwritten on each run:
- `OBSReplayBuffer.log` — startup and config deployment - `OBSReplayBuffer.log` — startup, path validation, OBS launch verification, and config deployment
- `OBSReplayBuffer-Tray.log` — tray lifetime, save attempts, and results - `OBSReplayBuffer-Tray.log` — tray lifetime and save attempts
- `OBSReplayBuffer-Save.log` — WebSocket steps for each save attempt - `OBSReplayBuffer-Save.log` — WebSocket steps and file verification for each save attempt
## Changing the Buffer Duration ## Changing the Buffer Duration
@@ -104,6 +108,20 @@ Update `BufferSeconds` in `config.psd1`. The value is written into the OBS profi
## Notes ## Notes
### Startup Verification
`Start-OBSReplayBuffer.ps1` performs three checks after launching OBS before showing the user notification:
1. **Process check** — polls for the `obs64` process for up to 30 seconds
2. **Log file check** — waits up to 30 seconds for OBS to create a new session log file
3. **Replay buffer check** — polls the log file for a replay buffer started message for up to 2 minutes
If any check times out, the script exits with code 1 and logs the failure. The tray icon is not launched.
### Save Verification
After OBS acknowledges the `SaveReplayBuffer` request, `Invoke-ReplaySave.ps1` polls the user's capture folder for up to 30 seconds for a new `.mkv` file. If no file appears, the save is treated as failed. This catches cases where OBS accepts the request but fails to write the file.
### VDI Compatibility ### VDI Compatibility
This tool is designed for VDI environments running without a physical GPU (e.g. Microsoft Basic Render Driver): This tool is designed for VDI environments running without a physical GPU (e.g. Microsoft Basic Render Driver):