From 14eb7a9c70a5aa0043cfcbf26ab7bcad86476b9d Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 12 May 2026 10:18:26 -0400 Subject: [PATCH] Add changes for new menuinst fix --- constructor/briefcase/run_installation.bat | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/constructor/briefcase/run_installation.bat b/constructor/briefcase/run_installation.bat index 1abdc7066..9d718ff3c 100644 --- a/constructor/briefcase/run_installation.bat +++ b/constructor/briefcase/run_installation.bat @@ -45,7 +45,8 @@ rem Set CONDA_QUIET primarily to disable the spinners set CONDA_QUIET={{ 0 if add_debug else 1 }} rem Get the name of the install directory -for %%I in ("%INSTDIR%") do set "APPNAME=%%~nxI" +for %%I in ("%INSTDIR%") do set "DISTRIBUTION_NAME=%%~nxI" +set MENUINST_DISTRIBUTION_NAME=%DISTRIBUTION_NAME% set "LOG=%INSTDIR%\install.log" {%- if script_env_variables %} @@ -128,6 +129,15 @@ if "%ALLUSERS%"=="0" ( if errorlevel 1 ( exit /b %errorlevel% ) ) +rem Persist distribution_name to menuinst.toml before installing packages. +rem This ensures the value is captured even if no packages have shortcuts. +rem Must run before conda install to avoid creating shortcuts twice. +"%CONDA_EXE%" menuinst --install -p "%BASE_PATH%" --root-prefix "%BASE_PATH%" +if errorlevel 1 ( exit /b %errorlevel% ) +if not exist "%BASE_PATH%\Menu\menuinst.toml" ( + {{ error_block('Failed to initialize shortcut configuration', 14) }} +) + {%- if has_pre_install %} rem Run user-supplied pre-install script {%- if has_pre_install_desc %}