I did a try a long time ago too, I used this batchfile.
The idea is to make as many paths inside the IDE relative to lazarusdir, and then pass the lazarus.exe location to startlazarus using --lazarusdir and --pcp=
Well yeah, I did this and it's working.
I also have a batch file which sets a environment variable(for fpc.cfg) and starts startlazarus.exe with the lazarus dir set to the path of the batch script and the config folder a folder in there.
But the problem I have is that lazarus saves the last path in the config and when the current path of the config is not the same as the last one it will show the message, so I want to get rid of that.
A method would be, making a "launcher" in Lazarus, which I now started trying.
My Plan is modifying the environmentoptions.xml in the config directory and remove the <History> tags, but I don't know how to read xml files with Lazarus without a gui.
EDIT: Here's the batch file I used:
@echo off
echo Starting Lazarus...
set "LAZDIR=%~dp0"
start "" "%LAZDIR%startlazarus.exe" --lazarusdir="%LAZDIR%" --pcp="%LAZDIR%LazConfig" --scp="%LAZDIR%" --skip-last-project --nsc
EDIT 2: I used the environment variable in fpc.cfg to replace the absolute path and I used LazarusDir everywhere I could in config files.