Runnable Leo in one .zip file.

112 views
Skip to first unread message

Terry Brown

unread,
Jan 2, 2012, 12:04:11 PM1/2/12
to leo-e...@googlegroups.com
Summary - it's easy to make a .zip file containing Leo and all it's
dependencies.

Inspired by Matt's recipe, using VirtualBox throw away 1GB Windows XP
32 bit machines, I tried the following.

Install Python (installer from python.org) 2.7.2 to

C:\Docouments and Settings\someuser\Desktop\leo\python27

Install PyQt (installer from Riverbank) 4.9 into the same folder (it
goes there by default)

Unzip http://www.greygreen.org/leo/leo-editor-latest.zip into

C:\Docouments and Settings\someuser\Desktop\leo\leo-editor-latest

Make leo.zip from C:\Docouments and Settings\someuser\Desktop\leo

Delete the virtual machine, purging any registry entries etc. created
by the two installers.

On a fresh machine, searched the registry for 'python' just to be sure,
found nothing.

Unzip the .zip file, then

cd C:\Docouments and Settings\someuser\Desktop\leo
python27\python.exe leo-editor-latest\launchLeo.py

And Leo opens a blank outline, after asking for an ID, as it's supposed
to. Didn't test it beyond that.

So, the .zip file contains all Leo needs to run, and obviously
runLeo.bat could be added in the top level to actually launch it.

Cheers -Terry

Terry Brown

unread,
Jan 2, 2012, 12:37:34 PM1/2/12
to leo-e...@googlegroups.com
On Mon, 2 Jan 2012 11:04:11 -0600
Terry Brown <terry_...@yahoo.com> wrote:

> Summary - it's easy to make a .zip file containing Leo and all it's
> dependencies.

Of course this is for Windows, so I think it's an improvement over
asking people to install Python and PyQt first, but neither of those
steps was that hard in Windows anyway. I wonder if anything similar is
possible for Mac.

Cheers -Terry

Largo84

unread,
Jan 2, 2012, 5:39:12 PM1/2/12
to leo-e...@googlegroups.com, terry_...@yahoo.com
I wish it were that easy. The problem is installing PyQt. I finally gave up, it wasn't worth the hassle. The only way I can run Leo on my Mac is in a Windows virtual environment.

Rob.................

Gregory Crosswhite

unread,
Jan 2, 2012, 6:17:47 PM1/2/12
to leo-e...@googlegroups.com, terry_...@yahoo.com

On Jan 3, 2012, at 8:39 AM, Largo84 wrote:

I wish it were that easy. The problem is installing PyQt. I finally gave up, it wasn't worth the hassle. The only way I can run Leo on my Mac is in a Windows virtual environment.

What kinds of problems were you encountering?

Personally I use MacPorts for such things, which works reasonably well at the cost of building redundant versions of lots of stuff.

Cheers,
Greg

Edward K. Ream

unread,
Jan 5, 2012, 7:13:23 AM1/5/12
to leo-e...@googlegroups.com
On Mon, Jan 2, 2012 at 11:04 AM, Terry Brown <terry_...@yahoo.com> wrote:
> Summary - it's easy to make a .zip file containing Leo and all it's
> dependencies.

Interesting.

Is this a technique that we could use for official Windows releases?
If so, what exactly would we do?

Edward

HansBKK

unread,
Jan 5, 2012, 11:21:49 AM1/5/12
to leo-e...@googlegroups.com
My 2¢:

If something like this **is** done, it should IMO be packaged as an alternative to the normal installation procedure.

You would definitely get marketing exposure by getting the specs from PortableApps.com and let them host it there as  "Portable Leo", tracking the "official" Portable Python (currently 2.7.2) as a dependency, obviously including QT etc as well. But it would need to be kept up to date. . .

Most Windows users would be better served by following the normal installation procedure and ending up with a registry-and-environment-variables-complete install of Python et al which they can use for other things beyond Leo. Ending up with multiple instances of Python to maintain is likely to cause more problems.

And the normal Windows install just isn't that hard, really! Improving the current instructions, by providing a step-by-step "cookbook" with direct links to the download packages etc might make it a **little** easier (IMO only for the clueless), but then of course that would be a doc that would need pretty frequent updates, which if I may be so bold doesn't seem to happen too quickly on the doc side.

(for which topic I'll start a new thread)

Terry Brown

unread,
Jan 5, 2012, 11:57:32 AM1/5/12
to leo-e...@googlegroups.com
On Thu, 5 Jan 2012 06:13:23 -0600
"Edward K. Ream" <edre...@gmail.com> wrote:

> Is this a technique that we could use for official Windows releases?
> If so, what exactly would we do?

I guess, perhaps as an all-in-one option with a system integrated
option for those who want to use system python/qt. Don't know if it
violates and licensing on Python / Qt, everything's being distributed
unaltered, so I wouldn't think so.

So basically you'd give people a large .zip file and tell them to
extract it to a folder and run the batchfile at the top level. If they
can't do that, they might not be ready for Leo :-) I guess you could
make it a self-extracting .zip, for that matter.

Also, the daily snapshot could be made this way, seeing once Python and
Qt are installed in the folder the Leo version can just be copied in.

It's not uncommon for FLOSS to be distributed this way, both Blender
and Inkscape use this approach, particularly for recent builds.

Cheers -Terry

Terry Brown

unread,
Jan 5, 2012, 11:59:29 AM1/5/12
to leo-e...@googlegroups.com
On Thu, 5 Jan 2012 08:21:49 -0800 (PST)
HansBKK <han...@gmail.com> wrote:

> And the normal Windows install just isn't that hard, really!

I agree, I guess we're aiming at the users who move on when they see
"to install Leo, first install Python and PyQt, then..." The question
again of whether they're going to want Leo when they have it or not.

Cheers -Terry

Largo84

unread,
Jan 5, 2012, 3:40:26 PM1/5/12
to leo-e...@googlegroups.com
Two perspectives on this:

1) For me ( a long time Leo user and advocate) having an up-to-date PortableApps version would be FANTASTIC!! I wish I knew how to make it happen. I run the latest version from a DropBox folder so it's available on the several computers I use between work and home. However, having it available on a thumb drive (with all the dependencies and home environment set) would be even better.
2) For potential new users of Leo, I agree that an all-in-one zip file installation would be beneficial. I don't think it has to be too 'dumbed down' (though that's a relative term and I suppose I might even be in that category :-)
Rob..............

Largo84

unread,
Jan 5, 2012, 4:41:00 PM1/5/12
to leo-e...@googlegroups.com, terry_...@yahoo.com


On Monday, January 2, 2012 6:17:47 PM UTC-5, gcrosswhite wrote:

On Jan 3, 2012, at 8:39 AM, Largo84 wrote:

I wish it were that easy. The problem is installing PyQt. I finally gave up, it wasn't worth the hassle. The only way I can run Leo on my Mac is in a Windows virtual environment.

What kinds of problems were you encountering?

It's been a while so my memory is a little fuzzy, but as I recall, first I had to figure out how to install the Mac development environment. Not overly difficult, but annoying. Next came SIP (I think). Then, I had to figure out how to build Qt from source (all this using command line stuff that is not intuitive for a non-programmer). Then, after all of that to find out that whatever Qt system I was trying to install wasn't compatible for some reason (don't remember the specifics). All of this using online documentation and user guides geared towards programmers. I had already spent my entire personal free time over several days just to get to this point before I finally decided that (to quote Al Pacino) 'It's too damn hard!'

Now, since then I've seen several posts suggesting other strategies. I can't yet bring myself to try them, especially considering that my Mac is no longer in an 'original state' considering all the mucking around I did before (and don't know how to undo). If (and when) PyQt ever becomes available with prebuilt binaries for Mac platform, I'll be all over it. Until then, probably not.
Rob.........
 

HansBKK

unread,
Jan 5, 2012, 8:12:28 PM1/5/12
to leo-e...@googlegroups.com
On Friday, January 6, 2012 3:40:26 AM UTC+7, Largo84 wrote:
PortableApps version would be FANTASTIC!! I wish I knew how to make it happen.

A couple of versions have been posted here already, including Terry's very simple sequence in the first message of this thread. Of course, we're only talking about Windows, but note that it works equally well either syncing with whatever tool (I favor Unison over SSH) or carrying around on an arbitrary-path'd external device, including flash drives (but they can be slow).

Here's my more robust (hence more complex) version, xx indicating your python version (mine is 27):

Use the normal .MSI, setup.exe etc processes to Install a clean "canonical" version of your "python dev stack" to say C:\PythonXX, reboot if needed, test thoroughly. Note any new environment variables pointing to your new binary locations.

Now create a corresponding PythonXX folder in your "PortableApps" location (I put it under "CommonFiles" along with GTK and Java) and copy everything from your installed location to the portable one.

You can then use the project-provided tools on the "master" computer to keep your binaries updated, and they will see any local Registry entries and the environment variables they created and operate normally wrt your installed location (e.g. C:\PythonXX).

If you have a local folder sync tool (I use Unison and WinMerge) you can add to/remove from/configure your Python environment from either location, otherwise just keep your installed location as the "master" and just copy the whole stack over each time you do so.

The whole PortableApps tree can then be sync'd/copied to any other desktop(s) you like, either over the wire or via an external device, and the latter can be carried for use in say an Internet cafe or client-site situation.

====================
For use on those other computers, for running in portable mode, I use a "portable start menu" (PStart) which allows for its own "autolaunch" batch files, where I set some global environment variables to be used by app-specific launch batch files, including :

%Path% (I add my batch folder and a general utility/tools folder)
%HOME% (usually "E:\aasync\Data\H_HOME"
and a custom one called %h_pa%, which points to the root of my PortableApps parent (usually "D:\aasync\PortableApps")

Then for each environment that requires its own custom settings, I create a launch batch file that builds on that base. In the case of Python apps, here's an example that opens a CMD console window:

@ECHO OFF
set PATH=%PATH%;%h_pa%\CommonFiles\Python27;%h_pa%\CommonFiles\Python27\Lib\site-packages\PyQt4;%h_pa%\CommonFiles\Python27\Lib\idlelib;%h_pa%\CommonFiles\Python27\Scripts;
set PROMPT=$p_python$g
E:
cd \aasync
CMD.exe

I'm not sure which if any of the environment stuff Leo requires, but I figure it might as well have the same environment as my Python CLI, since I'll be testing shell integration, including iPython. In my leo-win.bat, the last three lines above are replaced with:

D:
cd \aasync\PortableApps\leo-editor
start "" "..\CommonFiles\Python27\pythonw.exe" "..\CommonFiles\Python27\Lib\site-packages\leo-editor4\launchLeo.py" %*

====================

Note this is more than the minimum you need to just run Leo - you could of course simplify it; for example, only set the environment variables Leo requires, or you could just set the master computer' installation routines to use a single location under PortableApps, but I prefer to keep them separate for testing purposes.

I hope you (and others googling this later) find this useful.

Matt Wilkie

unread,
Dec 15, 2012, 3:05:07 AM12/15/12
to leo-e...@googlegroups.com, terry_...@yahoo.com
On Monday, 2 January 2012 09:04:11 UTC-8, Terry wrote:
Summary - it's easy to make a .zip file containing Leo and all it's
dependencies.

So, the .zip file contains all Leo needs to run, and obviously
runLeo.bat could be added in the top level to actually launch it.

Since this topical today, almost a year later, I thought I'd take a run at repeating this using Portable Python (http://www.portablepython.com) as a base. It didn't work, but I think it should. Maybe someone else knows why.

I ran the installer for 2.7.3 since 3.2 doesn't include PyQt4. At install time I selected only the Python and PyQt4 packages. Then from a fresh command shell:
{{{
path=c:\windows;c:\windows\system32
pushd x:\portapy27\App
path=%cd%;%cd%\Scripts;%cd%\Lib\site-packages\PyQt4;%path%
set pythonhome=%cd%
set pythonpath=%cd%\Lib

popd

python --version
Python 2.7.3

python -c "import PyQt4"
:: no error returned, we're good.

python c:\apps\leo-editor-latest\launchLeo.py
Leo requires Qt to be installed.
}}}

oh well.

-matt

Nils Lindemann

unread,
Dec 15, 2012, 4:36:03 AM12/15/12
to leo-editor
Hi,

I dont like the portable apps solution.
Thats a third party and if you have bugs there you have bugs in leo.

but a standalone no registry all in one zip sounds terrific.

Nils

Edward K. Ream

unread,
May 5, 2013, 10:43:00 AM5/5/13
to leo-editor
On Mon, Jan 2, 2012 at 11:04 AM, Terry Brown <terry_...@yahoo.com> wrote:
Summary - it's easy to make a .zip file containing Leo and all it's
dependencies.

I'm re-reading this entire thread now with an eye to getting Leo 4.11a1 out the door.

Your description of the process is clear enough.  Doing the work in a virtual machine ensures that none of the "new" installs will effect the host machine.  I'm not sure a virtual machine is necessary, but it's probably more convenient. To to check out VirtualBox...

Edward

Edward K. Ream

unread,
May 5, 2013, 10:49:35 AM5/5/13
to leo-editor
On Thu, Jan 5, 2012 at 10:21 AM, HansBKK <han...@gmail.com> wrote:
My 2¢:

If something like this **is** done, it should IMO be packaged as an alternative to the normal installation procedure.

Yes.  Ideally, I'd like to see daily snapshots of all-in-one builds.  I think this means the .zip files Terry was talking about in this thread.

You would definitely get marketing exposure by getting the specs from PortableApps.com and let them host it there as  "Portable Leo", tracking the "official" Portable Python (currently 2.7.2) as a dependency, obviously including QT etc as well. But it would need to be kept up to date. . .

I'm checking out PortableApps now.  Not sure how often I'd want to update the PortableApps version: perhaps just for the final version of the official releases.

Most Windows users would be better served by following the normal installation procedure and ending up with a registry-and-environment-variables-complete install of Python et al which they can use for other things beyond Leo. Ending up with multiple instances of Python to maintain is likely to cause more problems.

I agree.

And the normal Windows install just isn't that hard, really! Improving the current instructions, by providing a step-by-step "cookbook" with direct links to the download packages etc might make it a **little** easier (IMO only for the clueless), but then of course that would be a doc that would need pretty frequent updates, which if I may be so bold doesn't seem to happen too quickly on the doc side.

That's the new top priority.

Edward

Edward K. Ream

unread,
May 5, 2013, 10:52:52 AM5/5/13
to leo-editor
On Thu, Jan 5, 2012 at 7:12 PM, HansBKK <han...@gmail.com> wrote:
On Friday, January 6, 2012 3:40:26 AM UTC+7, Largo84 wrote:
PortableApps version would be FANTASTIC!! I wish I knew how to make it happen.

A couple of versions have been posted here already, including Terry's very simple sequence in the first message of this thread. Of course, we're only talking about Windows, but note that it works equally well either syncing with whatever tool (I favor Unison over SSH) or carrying around on an arbitrary-path'd external device, including flash drives (but they can be slow).

Here's my more robust (hence more complex) version, xx indicating your python version (mine is 27):

[Big snip]

One of the goals for 4.11a1 is to automate everything as much as possible.

I'm not sure how feasible it is, there are scripts in leoDist.leo that do some of the work, but many steps still must be done by hand.

Edward
Reply all
Reply to author
Forward
0 new messages