# Install Thorium browser and set as default via Active Setup (all users) # PS-SFTA is stored in Program Files and runs at each user's first logon. # post-oobe.cmd also runs SFTA for the initial user. { pkgs, makeFilesISO, ... }: let installer = pkgs.fetchurl { url = "https://github.com/Alex313031/Thorium-Win/releases/download/M138.0.7204.303/thorium_AVX2_mini_installer.exe"; hash = "sha256-43daDPX4N7NbVx1UfmO6KDMKKufhmpeQMO7qTeRggqo="; }; sfta = pkgs.fetchurl { url = "https://raw.githubusercontent.com/DanysysTeam/PS-SFTA/master/SFTA.ps1"; hash = "sha256-Prb23uP9jJFgQEIGC51ljwjshdP9ChR2kRnf14vDCFE="; }; in { name = "thorium"; cdroms = [ (makeFilesISO { name = "thorium"; files = [ installer sfta ]; }) ]; auditScript = '' @echo off echo Installing Thorium browser... copy D:\thorium_AVX2_mini_installer.exe C:\thorium_installer.exe start /wait C:\thorium_installer.exe --silent --system-level --do-not-launch-chrome del /q C:\thorium_installer.exe echo Waiting for setup.exe to finish... :wait_loop tasklist /fi "imagename eq setup.exe" 2>nul | find /i "setup.exe" >nul if not errorlevel 1 ( timeout /t 5 /nobreak >nul goto wait_loop ) echo Setting up Thorium as default browser for all users... :: Store SFTA in Program Files (survives sysprep as installed program) mkdir "C:\Program Files\vmix" 2>nul copy D:\SFTA.ps1 "C:\Program Files\vmix\SFTA.ps1" >nul :: Register Active Setup: runs at first logon for every new user reg add "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\vmix-default-browser" /v "(Default)" /t REG_SZ /d "Set default browser" /f >nul reg add "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\vmix-default-browser" /v "StubPath" /t REG_SZ /d "powershell -WindowStyle Hidden -ExecutionPolicy Bypass -Command \". 'C:\\Program Files\\vmix\\SFTA.ps1'; Set-FTA 'ThoriumHTM' '.htm'; Set-FTA 'ThoriumHTM' '.html'; Set-PTA 'ThoriumHTM' 'http'; Set-PTA 'ThoriumHTM' 'https'\"" /f >nul reg add "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\vmix-default-browser" /v "Version" /t REG_SZ /d "1,0,0,0" /f >nul ''; }