Lazarus

Announcements => Third party => Topic started by: jammiii on February 23, 2009, 08:26:37 pm

Title: Lazarus 0.9.27 for PortableApps
Post by: jammiii on February 23, 2009, 08:26:37 pm
I'm proud to announce that I've ported Lazarus to the PortableApps format.  This allows you to take Lazarus with you via USB HDD or USB Flash.  It's convenient for the developer on-the-go.  Just plug-in your USB device, and run Lazarus anywhere!  This version is for Windows but I plan to port to Linux too.

You can download Lazarus 0.9.27 Portable at http://www.eightminds.com/archives/24

Title: Re: Lazarus 0.9.27 for PortableApps
Post by: LazaruX on February 23, 2009, 11:57:50 pm
That's a good news, however, in the last year I programmed 70% of my codes on my USB stick, I just installed Lazarus on my HHD (Windows platform) then copied C:\Lazarus to my USB stick and changed the environmental paths.
Sooooo,...does your port work with anydrive directly?
You plan to make the Linux portable is good, but I think harder.
 :D
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: jammiii on February 24, 2009, 01:23:17 am
Yes, that's exactly what the PortableApps version does.  It remaps all paths on the fly.  USB drive letters in windows change depending on the machine configuration, and it changes if the machine is on a network.  This too is taken into account.  Their are many settings which are not transferable when you simply copy to USB and change the local XML configuration files (such-as auto loading the last project on startup).  If you only plan to run Lazarus on one machine (or machines with the same drive letter mappings, then copying the folder alone is usually fine but in many cases it's not.

The linux version would have to be limited to specific distros.  Still, it's possible.

With this app, you load your USB drive, and go... no-matter what system your on or how the drives are mapped.  All settings remain intact.
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: LazaruX on February 24, 2009, 01:17:31 pm
That's a good news then and a good implementation
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: LazaruX on February 25, 2009, 11:41:57 am
This should be easier, maybe this should be default in lazarus.exe  :

Code: [Select]
unit main;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  ExtCtrls, Buttons,windows;

type

  { TForm1 }

  TForm1 = class(TForm)
    BitBtn1: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;
  dir : string;

 f:text;
implementation

{ TForm1 }

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
 dir := GetCurrentDir;

 assignfile(f,'environmentoptions.xml');
 rewrite(f);

 writeln(f,'<?xml version="1.0"?>');
 writeln(f,'<CONFIG>');
 writeln(f,'  <EnvironmentOptions>');
 writeln(f,'    <Version Value="102"/>');
 writeln(f,'    <LazarusDirectory Value="'+dir+'">');
 writeln(f,'    </LazarusDirectory>');
 writeln(f,'    <CompilerFilename Value="'+dir+'\fpc\2.2.2\bin\i386-win32\\fpc.exe">');
 writeln(f,'    </CompilerFilename>');
 writeln(f,'    <FPCSourceDirectory Value="'+dir+'\fpc\2.2.2\source">');
 writeln(f,'    </FPCSourceDirectory>');
 writeln(f,'    <MakeFilename Value="'+dir+'\fpc\2.2.2\bin\i386-win32\\make.exe">');
 writeln(f,'    </MakeFilename>');
 writeln(f,'    <TestBuildDirectory Value="'+dir+'\Temp\">');
 writeln(f,'    </TestBuildDirectory>');
 writeln(f,'    <Debugger Class="TGDBMIDebugger"/>');
 writeln(f,'    <DebuggerFilename Value="'+dir+'\mingw\bin\gdb.exe">');
 writeln(f,'    </DebuggerFilename>');
 writeln(f,'    <Desktop>');
 writeln(f,'      <MainIDE>');
 writeln(f,'        <WindowPlacement Value="RestoreWindowGeometry"/>');
 writeln(f,'        <CustomPosition Width="720" Height="69"/>');
 writeln(f,'        <WindowState Value="Normal"/>');
 writeln(f,'        <DockMode Value="Default"/>');
 writeln(f,'        <Visible Value="True"/>');
 writeln(f,'      </MainIDE>');
 writeln(f,'    </Desktop>');
 writeln(f,'  </EnvironmentOptions>');
 writeln(f,'</CONFIG>');

  closefile(f);

 WinExec('lazarus.exe',1);

 Close;
end;


initialization
  {$I main.lrs}

end.

Title: Re: Lazarus 0.9.27 for PortableApps
Post by: jammiii on February 26, 2009, 04:02:07 am
Not a bad idea but the question is... Shouldn't the default settings foster cross-platform development habbits?

I will definitely consider it though.  Thanks.
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: LazaruX on February 26, 2009, 09:42:02 am
Yeah, ok,

instead of Winexec, we could use Tprocess

and we could do something like

If OS=Windows then ......run lazarus.exe
if os=linux then run lazarus,
......

and the problem would be solved
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: jammiii on February 26, 2009, 03:19:02 pm
Thank you so much for your contribution.  I will be able to work on this tomorrow night.
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: JD on February 27, 2009, 11:56:48 am
First I want to thank you for your effort. I love portable apps; on my computer (to save Windows Registry bloat) and on my USB keys, that is how I like to work.

However, I was unable to get LazarusPortable to start on my USB keys & on my computer by clicking on the Lazarus 0.9.27 Portable executable. I could start it by clicking the startlazarus or the lazarus executable & them reseting the environment options but I was unable to compile any project.

I finally realised that the problem was the fpc.cfg file. I opened it & discovered that the paths are absolute (g:\PortableApps\) which prevented it from working.

I changed the 'g' to 'c' & reinstalled the application in "c:\PortableApps" & then voila! The Lazarus 0.9.27 Portable.exe application worked! The environment options in the xml file were properly set & I could compile projects.

I think all that is missing to make it fully portable is to remove the absolute path references.
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: duncanparsons on February 27, 2009, 12:41:18 pm
when your happy with it all, will you be submitting it to portableapps.com for inclusion in their developer tools? :)
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: LazaruX on February 27, 2009, 01:40:23 pm
However, the last STABLE release is the 0.9.26 (AFAIK), so that should be made portable. I will make a small script, like the one I posted, so the problem will be solved.
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: jammiii on February 27, 2009, 03:24:04 pm
Cool JD!  Please download the current version which includes bug fixes for the paths issue. (Thanks for the offer BPSoftware :D but it's already fixed.)

The current version also includes the help files.

download it here...
http://www.eightminds.com/archives/26

Yes Duncanpar, I have submitted to the PortableApps Team here...
http://portableapps.com/node/18088

Good-point BPSoftware... I will aim to release the 0.9.26 version hopefully tonight.

As-for the absolute paths, my launcher automatically sets the correct paths now on startup as needed.

Thanks everyone for the on-going feedback!  :)  It's really helpful.
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: Vincent Snijders on February 28, 2009, 09:22:37 am
I will aim to release the 0.9.26 version hopefully tonight.
That is a good exercise for the 0.9.26.2 release expected within two weeks. :)
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: jammiii on February 28, 2009, 06:13:32 pm
I've posted Lazarus 0.9.26 for PortableApps with Help Files on my site.  http://www.eightminds.com Please test and provide any feedback you like.

As soon as version 0.9.26.2 is available, I will post it too.

Juan
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: jammiii on March 09, 2009, 03:43:17 pm
I've just released Beta 5 of Lazarus 0.9.27 for PortableApps (Ms-Windows).  Many improvements and bug-fixes.  visit www.eightminds.com to download source code and the installer.
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: BlueIcaro on May 23, 2009, 05:51:24 pm
Do you think add your lazarus portable to Portable Apps distro?
/BLueIcaro
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: Leledumbo on May 25, 2009, 07:59:06 am
It's already done: http://www.eightminds.com/archives/34 (http://www.eightminds.com/archives/34)
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: Nix on June 03, 2009, 12:53:39 am
Great job :)  ;D
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: PhilipCopeman on January 19, 2010, 05:36:55 pm
Juan have you got anywhere wiht this. I run the TurboCASH Accountin porject. I am looking at porting from Delphi 7 to Lazarus. It woudl eb a massive plud for me to have a movabel IDE and project data. IE you dpoanlaod the whjoel; thing and jsut press the gree button to compile - no package installation.

Have you been able to get thsi right wth Lazarus?
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: JD on January 19, 2010, 09:08:33 pm
I've tested portable Lazarus several times. It is a real pain to install additional components because of problems with the compiler paths.

The developer is aware of this because I kept him updated with my test results.

It is great if you use only the basic Lazarus components but if you're like me & you install/use a lot of third party components, you're in for a hard time.

I hope the compiler path problems will be corrected because it'll be very interesting to have a fully working portable version of Lazarus.
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: MisterKode on February 25, 2010, 11:31:07 am
It is great if you use only the basic Lazarus components but if you're like me & you install/use a lot of third party components, you're in for a hard time.

I hope the compiler path problems will be corrected because it'll be very interesting to have a fully working portable version of Lazarus.

I'm looking forward to a new version with these problems fixed. :)
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: timmermanj on July 08, 2010, 12:49:58 pm
Anybody any results for a portable Lazarus with 3rd party components?

Thanks!
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: Leledumbo on July 08, 2010, 03:21:07 pm
Quote
Anybody any results for a portable Lazarus with 3rd party components?
X-Lazarus from winpenpack and my own build (can't upload, I don't bring the source) can do that :D
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: timmermanj on July 08, 2010, 03:37:12 pm
I've tried X-lazarus but from the moment Lazarus has 3rd party components it can't find the lpk's and starts making dummy packages.

Could you please tell me how you solved this?

Thanks!
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: Leledumbo on July 09, 2010, 09:14:35 am
Ensure the 3rd party components lie under components folder and copy your: <windows drive>\Documents and Settings\Local Settings\Application Data\lazarus to <X-Lazarus dir>\User\<I forgot till this point, if you've ever run it once, you should a notice a directory containing the same set of files as the one I told to copy>.

If the problem persists, that means the package links are hardcoded (C:\lazarus\components instead of $(LazarusDir)\components for instance). Try reinstalling the packages.
Title: Re: Lazarus 0.9.27 for PortableApps
Post by: marcov on July 09, 2010, 11:30:40 am
Re: portable apps :

For 0.9.29+ I've added a commandline --lazarusdir parameter to startlazarus/lazarus to specify the lazarusdir.

If the laz configuration has everything relative to lazarusdir, and is configured with

If people then execute lazarus over a simple batchfile that detects the driveletter, and passes a corrected lazarusdir and --primary-config-dir to startlazarus(I used driveletter\lazarus\config for that), one would already be pretty close with a portable apps installation.

Unfortunately, this hasn't been tested to well yet. For older lazarus versions I used the following script/program:

http://www.stack.nl/~marcov/fixxml.zip, which uses the FPC XML package to fix the lazarusdir in the xml directly

TinyPortal © 2005-2018