@ECHO OFF SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION ECHO: ECHO === Starting Installer Build Workaround === REM Store current directory SET "current_path=%CD%" SET "vs_base_path=%ProgramFiles%\Microsoft Visual Studio\18" FOR %%E IN (Community Professional Enterprise) DO ( IF EXIST "%vs_base_path%\%%E\Common7\IDE\CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild\DisableOutOfProcBuild.exe" ( SET "buildfix_path=%vs_base_path%\%%E\Common7\IDE\CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild" SET "devenv_path=%vs_base_path%\%%E\Common7\IDE\devenv.exe" SET "vs_edition=%%E" GOTO :FoundEdition ) ) ECHO [ERROR] Could not find DisableOutOfProcBuild.exe in any known VS2026 edition. EXIT /B 1 :FoundEdition ECHO Found Visual Studio 2026 Edition: %vs_edition% CD /D "%buildfix_path%" CALL DisableOutOfProcBuild.exe REM Restore previous directory CD /D "%current_path%" REM === Validate required files === ECHO: ECHO === Checking required files === SET "error=0" IF NOT EXIST "UnityLauncherPro\bin\Release\UnityLauncherPro.exe" ( ECHO [ERROR] Missing file: UnityLauncherPro\bin\Release\UnityLauncherPro.exe SET "error=1" ) IF NOT EXIST "UnityLauncherPro\Images\icon.ico" ( ECHO [ERROR] Missing file: UnityLauncherPro\Images\icon.ico SET "error=1" ) IF %error% NEQ 0 ( ECHO [ERROR] Required files are missing. Aborting installer build. EXIT /B 1 ) ECHO: ECHO === Building Installer === ECHO Current dir: %CD% IF NOT EXIST "UnityLauncherPro.sln" ( ECHO [ERROR] Solution file not found: UnityLauncherPro.sln EXIT /B 1 ) SET "installer_project=UnityLauncherProInstaller\UnityLauncherProInstaller.vdproj" IF NOT EXIST "%installer_project%" ( ECHO [ERROR] Installer project not found: %installer_project% EXIT /B 1 ) ECHO Running: ECHO "%devenv_path%" "UnityLauncherPro.sln" /Rebuild "Release" /Project "%installer_project%" "%devenv_path%" "UnityLauncherPro.sln" /Rebuild "Release" /Project "%installer_project%" > build_output.log 2>&1 SET "exitCode=%ERRORLEVEL%" ECHO: ECHO === Build Complete === REM Optional cleanup: disable workaround REG DELETE "HKCU\Software\Microsoft\VisualStudio\Setup" /v VSDisableOutOfProcBuild /f >NUL 2>&1 ENDLOCAL EXIT /B %exitCode%