How to Build a Custom Blender Launcher for Multiple Versions

How to Build a Custom Blender Launcher for Multiple Versions

Managing multiple Blender versions can save compatibility headaches, let you test features safely, and keep old projects working. This guide walks you step-by-step to build a simple, cross-platform custom launcher that lists installed Blender versions, lets you pick one, and opens your .blend files with the selected version. We’ll provide a Windows batch script, a macOS Automator/AppleScript approach, and a Python-based cross-platform GUI you can extend.

What this launcher will do

  • Detect installed Blender versions in standard locations.
  • Show a list of found versions and their paths.
  • Let you choose a version (or default) to open a .blend file or launch Blender empty.
  • Remember your last-selected version (simple config file).
  • Be lightweight and editable.

1. Design decisions (assumptions)

  • Reasonable defaults: common install locations for each OS.
  • Config stored as a simple JSON file next to the launcher.
  • Launcher will accept an optional file path argument to open a specific .blend.
  • No elevated permissions required.

2. Option A — Windows: Batch script + simple menu

Save this as launch_blender.bat in a folder; create a subfolder “config” for last_choice.json.

”`bat @echo off setlocal enabledelayedexpansion

REM Default search locations (customize if needed) set “PROGRAMFILES=%ProgramFiles%” set “PROGRAMFILES_X86=%ProgramFiles(x86)%” set “CANDIDATES=%PROGRAMFILES%\Blender Foundation\Blender;%PROGRAMFILES_X86%\Blender Foundation\Blender;%USERPROFILE%\AppData\Local\Programs\Blender Foundation\Blender”

REM Find blender.exe in candidate folders (search versioned subfolders) set i=0 for %%p in (%CANDIDATES%) do ( if exist “%%~p” ( for /d %%v in (“%%~p*”) do ( if exist “%%v\blender.exe” ( set /a i+=1 set “path[!i!]=%%v\blender.exe” set “name[!i!]=%%~nxv” ) ) ) )

if %i%==0 ( echo No Blender installations found in standard locations. pause exit /b 1 )

echo Found Blender versions: for /l %%n in (1,1,%i%) do ( echo%%n. !name[%%n]! )

REM Load last choice if exists set “config=config\last_choice.json” if exist “%config%” ( for /f “tokens=2 delims=:”” %%a in (‘type “%config%” ^| findstr /r /c:““last”“’) do set last=%%a )

echo. set /p choice=Select version number (Enter for last: %last%):

if “%choice%”==“” set choice=%last% if “%choice%”==“” set choice=1

set “exe=!path[%choice%]!”

if “%~1”==“” ( start “” “%exe%” ) else ( start “” “%exe%” “%~1”

Comments

Leave a Reply