# Version Check ColourSpace Script Guide ## What This Script Does This PowerShell script automatically checks if newer versions of ColourSpace and ColourSpace ZRO are available for download. It compares the latest version numbers published on the LightIllusion website against the versions currently installed on your Windows computer, then displays a clear status message indicating whether updates are available. --- ## Creating the Script ### Step 1: Open Notepad - Press `Windows Key + R` - Type `notepad` and press Enter ### Step 2: Copy the Script - Copy all the PowerShell code (the entire script text) ```shell Write-Host "`nCheck for new versions of ColourSpace`n" # Function to get installed version from Windows Registry or Program Files function Get-InstalledVersion { param ( [string]$ProductName, [string[]]$AlternateNames = @(), [string[]]$ExcludeNames = @() ) # Check common registry locations for installed programs $registryPaths = @( "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" ) $searchNames = @($ProductName) + $AlternateNames foreach ($path in $registryPaths) { foreach ($searchName in $searchNames) { $apps = Get-ItemProperty $path -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -like "*$searchName*" } foreach ($app in $apps) { # Check if this app should be excluded $shouldExclude = $false foreach ($excludeName in $ExcludeNames) { if ($app.DisplayName -like "*$excludeName*") { $shouldExclude = $true break } } if ($shouldExclude) { continue } # Try to extract the last 4 digits from version string (e.g., v1.0.1.2245 -> 2245) if ($app.DisplayVersion) { if ($app.DisplayVersion -match '\.(\d{4})) { return $matches[1] } if ($app.DisplayVersion -match '(\d{4})') { return $matches[1] } } if ($app.DisplayName -match '\.(\d{4})') { return $matches[1] } } } } # Check common installation directories $programPaths = @( "$env:ProgramFiles\LightIllusion\$ProductName", "${env:ProgramFiles(x86)}\LightIllusion\$ProductName", "$env:ProgramFiles\$ProductName", "${env:ProgramFiles(x86)}\$ProductName" ) foreach ($altName in $AlternateNames) { $programPaths += "$env:ProgramFiles\LightIllusion\$altName" $programPaths += "${env:ProgramFiles(x86)}\LightIllusion\$altName" $programPaths += "$env:ProgramFiles\$altName" $programPaths += "${env:ProgramFiles(x86)}\$altName" } foreach ($programPath in $programPaths) { if (Test-Path $programPath) { # Look for exe file $exeFile = Get-ChildItem -Path $programPath -Filter "*.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 if ($exeFile) { $version = (Get-Item $exeFile.FullName).VersionInfo.FileVersion if ($version -match '\.(\d{4})) { return $matches[1] } if ($version -match '(\d{4})') { return $matches[1] } } } } return $null } # ColourSpace try { $webContent = Invoke-WebRequest -Uri "https://lightillusion.com/software/home.php" -UseBasicParsing $latestCS = if ($webContent.Content -match 'Latest ColourSpace version.*?v\d+\.\d+\.\d+\.(\d+)') { $matches[1] } else { $null } } catch { $latestCS = $null } $installedCS = Get-InstalledVersion -ProductName "ColourSpace" -ExcludeNames @("ZRO") Write-Host "ColourSpace:" Write-Host " Latest online: v$latestCS" Write-Host " Latest installed: v$installedCS" if ($latestCS -and $installedCS) { if ([int]$latestCS -gt [int]$installedCS) { Write-Host " Status: NEW VERSION AVAILABLE (build $latestCS)" -ForegroundColor Green } elseif ([int]$latestCS -eq [int]$installedCS) { Write-Host " Status: Up to date" -ForegroundColor Cyan } else { Write-Host " Status: Local version is newer" -ForegroundColor Yellow } } else { Write-Host " Status: Unable to compare versions" -ForegroundColor Red if (-not $installedCS) { Write-Host " (ColourSpace not found on this system)" -ForegroundColor Red } } Write-Host "" # ColourSpace ZRO try { $latestZRO = if ($webContent.Content -match 'Latest ColourSpace ZRO version.*?v\d+\.\d+\.\d+\.(\d+)') { $matches[1] } else { $null } } catch { $latestZRO = $null } $installedZRO = Get-InstalledVersion -ProductName "ColourSpace ZRO" -AlternateNames @("ColourSpaceZRO", "Colourspace ZRO") Write-Host "ColourSpace ZRO:" Write-Host " Latest online: v$latestZRO" Write-Host " Latest installed: v$installedZRO" if ($latestZRO -and $installedZRO) { if ([int]$latestZRO -gt [int]$installedZRO) { Write-Host " Status: NEW VERSION AVAILABLE (build $latestZRO)" -ForegroundColor Green } elseif ([int]$latestZRO -eq [int]$installedZRO) { Write-Host " Status: Up to date" -ForegroundColor Cyan } else { Write-Host " Status: Local version is newer" -ForegroundColor Yellow } } else { Write-Host " Status: Unable to compare versions" -ForegroundColor Red if (-not $installedZRO) { Write-Host " (ColourSpace ZRO not found on this system)" -ForegroundColor Red } } ``` - Paste it into Notepad ### Step 3: Save the File - Click `File` → `Save As` - Navigate to your Documents folder: `C:\Users\YourUsername\Documents` - In the "File name" field, type: `check-colourspace.ps1` - In the "Save as type" dropdown, select `All Files (*.*)` - Click `Save` **Important:** The file must end with `.ps1` (not `.txt`) to be recognized as a PowerShell script. ## Running the Script ### Step 1: Enable PowerShell Scripts (One-Time Setup) If this is your first time running PowerShell scripts: 1. Press `Windows Key + X` and select `Windows PowerShell` (or `Terminal`) 2. Type the following command and press Enter: ```shell Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser ``` 3. When prompted, type `Y` and press Enter This is a one-time setup that allows you to run scripts you create locally. ### Step 2: Run the Script 1. Open PowerShell (press `Windows Key + X` → select `Windows PowerShell`) 2. Navigate to your Documents folder: ```shell cd Documents ``` 3. Run the script: ```shell .\check-colourspace.ps1 ``` ### Expected Output The script will display something like: ```shell Check for new versions of ColourSpace ColourSpace: Latest online: v2245 Latest installed: v2195 Status: NEW VERSION AVAILABLE (build 2245) ColourSpace ZRO: Latest online: v2195 Latest installed: v2195 Status: Up to date ``` The status messages will be color-coded: - **Green** = New version available - **Cyan** = Up to date - **Yellow** = Local version is newer (unusual) - **Red** = Unable to compare or software not found ## Troubleshooting **"Running scripts is disabled"**: Follow Step 1 under "Running the Script" above. **"File not found"**: Make sure you saved the file with the `.ps1` extension and you're in the correct directory (Documents). **"ColourSpace not found"**: The script couldn't locate the installed version. Ensure ColourSpace is properly installed on your system.