Skip to content

Instantly share code, notes, and snippets.

@armornick

armornick/Lazarus.bat

Last active Aug 29, 2015
Embed
What would you like to do?
Batch script to make Lazarus (more) portable (for Lazarus version 1.2.2 but should be easy to modify)
@echo off
rem
rem from http://forum.lazarus.freepascal.org/index.php/topic,23343.msg139270.html
rem
rem Simple script to relocate lazarus to use the current driveletter as
rem path, and put basic portable app support in lazarus.
rem
rem Assumes lazarus is in drvletter:\lazarus and config in
rem $lazarusdir/config
rem
rem For this to work, everything should be relative wrt $(lazarusdir)
rem inside the IDE. If packages work is currently untested
set LAZARUSDIR=%~dp0
set FPCROOTDIR=%LAZARUSDIR%\fpc\2.6.4
set FPCBINDIR=%FPCROOTDIR%\bin\i386-win32
set LAZARUSCONFIG=%LAZARUSDIR%\config
for %%i in (%LAZARUSDIR%\fpc\*) do set ALTFPCROOTDIR=%%i
echo %ALTFPCROOTDIR%
%FPCBINDIR%\fpcmkcfg -d basepath=%FPCROOTDIR% > %FPCBINDIR%\fpc.cfg
REM cd %LAZARUSDIR%
rem startlazarus? untested as yet
rem should later get --lazarusdir=%LAZARUSDIR% if mantis 15741 (0.9.30+) is committed
rem
Lazarus.exe --primary-config-path=%LAZARUSCONFIG% --lazarusdir=%LAZARUSDIR%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.