Hi Brian,
As I can understand, you are trying to find a way to automate the process of generating a Start menu folder for your MATLAB application on windows. Unfortunately, I was also unable to find any existing options in MATLAB Apps installer to achieve the same.
Here's a workaround, You can use .bat (batch files) to automate this process, here’s an example for the same:
Workflow:
- setup.bat calls MyAppInstaller.exe
- MyAppInstaller.exe installs the application, the setup.bat waits for it's completion.
- After the completion of MyAppInstaller.exe, the createStartMenuShortcut.bat is called from setup.bat.
- createStartMenuShortcut.exe creates the Start menu shortcuts.
Inside setup.bat
cd "[path of the folder of your application installer]"
start /wait MyAppInstaller.exe
start createStartMenuShortcut.bat
Inside createStartMenuShortcut.bat
@echo off
setlocal
:: Set the name of the shortcut
set SHORTCUT_NAME=[Add your application's name here].lnk
:: Set the target path of the shortcut (e.g., the path to the executable)
set TARGET_PATH=[Add path to your executable here]
:: Set the Start menu path for the current user
set START_MENU_PATH=%appdata%\Microsoft\Windows\Start Menu\Programs\[Add name of your application here]
:: Create the shortcut
echo Creating shortcut in the Start menu...
if not exist "%START_MENU_PATH%" mkdir "%START_MENU_PATH%"
echo Set oWS = WScript.CreateObject("WScript.Shell") > "%temp%\temp.vbs"
echo sLinkFile = "%START_MENU_PATH%\%SHORTCUT_NAME%" >> "%temp%\temp.vbs"
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> "%temp%\temp.vbs"
echo oLink.TargetPath = "%TARGET_PATH%" >> "%temp%\temp.vbs"
echo oLink.Save >> "%temp%\temp.vbs"
:: Run the VBScript to create the shortcut
cscript /nologo "%temp%\temp.vbs"
:: Clean up the temporary VBScript file
del "%temp%\temp.vbs"
echo Shortcut created successfully.
endlocal
You can run this batch file as your application’s setup.
Third party applications like inno setup and NSIS setup etc, can also help here.
I hope this helps, thanks!