473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Distributing applications

I've learned enough of the Python language to be mildly dangerous and
have used it in a few personal projects. All my development of
commercial (or production) products over the past dozen years have been
done with C++ or Java.

For a program I'm planning -- to begin during the summer -- having an
interpreter as part of the application would be very desirable to allow
sophisticated users to provide their own extensions. Java would be
do-able, but....

My problems are:
- I'd like the process of installing the application to be one step;
no "first download a Python interpreter then a GUI library" kind of
thing.
- I also need the core part of the application to be reasonably
protected. I'm not looking to defeat hackers, but something equivalent
to the way Java's class files stored in jars stay where they're supposed
to be and aren't immediately readable.

I've looked at various web sites for this topic, but most I've found are
just arguments for using the Python language. OK, I'll pretend I'm
convinced...now any comments or references on the mechanics of creating
a self-contained distribution?

--
Phillip Mills
Multi-platform software development
(416) 224-0714

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 18 '05 #1
14 1857
On Wednesday 02 March 2005 14:12, Phillip Mills wrote:
now any comments or references on the mechanics of creating
a self-contained distribution?


Run to http://starship.python.net/crew/theller/py2exe/
--
Toby Dickenson
Jul 18 '05 #2
I wanted a nice tightly-wrapped distribution of my own and really
didn't want to go the py2exe route. I may have used a sledgehammer to
kill a fly, but here is what I did...

1) Downloaded python source (2.3.4)
2) Modified source, so that sys.path would pull from a registry key
setup by my installer.
2) Compiled python
3) Compiled wxPython 2.5.3.1
4) Bundled my app along with the custom python installation using NSIS.

My `setup.exe' file was 6654281 bytes -- not bad. Considering its the
entire python distribution (I may have missed a couple of modules --
but i don't think so) and wxPython.

I chose not to use py2exe because it made updating my app a bit
messier. For instance, suppose I don't use the smtplib module in
version 1 of my software. Py2exe realizes that and doesn't 'package'
smtplib with my executable. Now, if I release version 1.1 which does
use smtplib, then I'd have to figure out how to get the updates out
without having the user redownload the entire application. Granted, I
didn't put much thought into an update mechanism, but it seemed to be
messy at the time.

If I have my own distribution, I can simply give the users an "update"
program that will query my webserver which will download the latest
version for them automagically. Because my distribution has all of
the modules already available, I don't have to worry about sending
them any missing modules. Simply download the latest version of my
app and it works with my custom rolled distribution.

But, this only works for Windows...

jw

On Wed, 02 Mar 2005 09:12:26 -0500, Phillip Mills
<ph************@acmdelete.org> wrote:
I've learned enough of the Python language to be mildly dangerous and
have used it in a few personal projects. All my development of
commercial (or production) products over the past dozen years have been
done with C++ or Java.

For a program I'm planning -- to begin during the summer -- having an
interpreter as part of the application would be very desirable to allow
sophisticated users to provide their own extensions. Java would be
do-able, but....

My problems are:
- I'd like the process of installing the application to be one step;
no "first download a Python interpreter then a GUI library" kind of
thing.
- I also need the core part of the application to be reasonably
protected. I'm not looking to defeat hackers, but something equivalent
to the way Java's class files stored in jars stay where they're supposed
to be and aren't immediately readable.

I've looked at various web sites for this topic, but most I've found are
just arguments for using the Python language. OK, I'll pretend I'm
convinced...now any comments or references on the mechanics of creating
a self-contained distribution?

--
Phillip Mills
Multi-platform software development
(416) 224-0714

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
--
http://mail.python.org/mailman/listinfo/python-list

Jul 18 '05 #3
Phillip Mills wrote:
I've learned enough of the Python language to be mildly dangerous and
have used it in a few personal projects. All my development of
commercial (or production) products over the past dozen years have been
done with C++ or Java.

For a program I'm planning -- to begin during the summer -- having an
interpreter as part of the application would be very desirable to allow
sophisticated users to provide their own extensions. Java would be
do-able, but....

My problems are:
- I'd like the process of installing the application to be one step;
no "first download a Python interpreter then a GUI library" kind of
thing.
For creating a self-contained installation/distribution under Windows,
use py2exe:

http://starship.python.net/crew/theller/py2exe/

If you want to create a nice Windows installer for your module(s):

http://www.python.org/doc/current/di...on-script.html

- I also need the core part of the application to be reasonably
protected. I'm not looking to defeat hackers, but something equivalent
to the way Java's class files stored in jars stay where they're supposed
to be and aren't immediately readable.
Hmm, not sure about that one. You mean that those users who write
extensions should not be able to modify the core code you wrote? Are you
talking about a restricted execution environment for untrusted code?
I'd rather make it so to only accept code which is signed by a trusted
party or something like that.
I've looked at various web sites for this topic, but most I've found are
just arguments for using the Python language. OK, I'll pretend I'm
convinced...now any comments or references on the mechanics of creating
a self-contained distribution?

Jul 18 '05 #4
Jaime Wyant wrote:
I chose not to use py2exe because it made updating my app a bit
messier. For instance, suppose I don't use the smtplib module in
version 1 of my software. Py2exe realizes that and doesn't 'package'
smtplib with my executable. Now, if I release version 1.1 which does
use smtplib, then I'd have to figure out how to get the updates out
without having the user redownload the entire application. Granted,
I didn't put much thought into an update mechanism, but it seemed to
be messy at the time.
I don't follow you. How is that different compared to adding a module
to your application? Let's say version 1.1 of your software has
module1.py updated, module2.py added and it needs smtplib. You just
bundle three compiled files and unpack them let's say to
\program files\my software\module1.pyc
\program files\my software\module2.pyc
\program files\my software\python\smtplib.pyc

I don't see any mess.

If I have my own distribution, I can simply give the users an "update"
program that will query my webserver which will download the latest
version for them automagically. Because my distribution has all of
the modules already available, I don't have to worry about sending
them any missing modules. Simply download the latest version of my
app and it works with my custom rolled distribution.

But, this only works for Windows...


Why? As I understand "update" program was written by you, so what
prevents it from working on other platforms besides testing?

Serge.

Jul 18 '05 #5
First, thanks to all the people who have answered so far for the
suggestions.

In article <U3*********************@news000.worldonline.dk> ,
André Søreng <ws******@tiscali.no> wrote:
Phillip Mills wrote:
My problems are:
[...]
http://starship.python.net/crew/theller/py2exe/


Apparently I had more problems than I mentioned. :-) One of them being
that a Windows-only solution is only a partial solution.
- I also need the core part of the application to be reasonably
protected. I'm not looking to defeat hackers, but something equivalent
to the way Java's class files stored in jars stay where they're supposed
to be and aren't immediately readable.

Hmm, not sure about that one. You mean that those users who write
extensions should not be able to modify the core code you wrote?


Partly that and partly a file management thing. For most end users a
..jar is one thing to deal with; it's the most recent one or it's not;
it's present in the right location or it's not....

--
Phillip Mills
Multi-platform software development
(416) 224-0714

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 18 '05 #6
On 2 Mar 2005 10:43:38 -0800, Serge Orlov <Se*********@gmail.com> wrote:
Jaime Wyant wrote:
I chose not to use py2exe because it made updating my app a bit
messier. For instance, suppose I don't use the smtplib module in
version 1 of my software. Py2exe realizes that and doesn't 'package'
smtplib with my executable. Now, if I release version 1.1 which does
use smtplib, then I'd have to figure out how to get the updates out
without having the user redownload the entire application. Granted,
I didn't put much thought into an update mechanism, but it seemed to
be messy at the time.


I don't follow you. How is that different compared to adding a module
to your application? Let's say version 1.1 of your software has
module1.py updated, module2.py added and it needs smtplib. You just
bundle three compiled files and unpack them let's say to
\program files\my software\module1.pyc
\program files\my software\module2.pyc
\program files\my software\python\smtplib.pyc

I don't see any mess.


The way I *think* about it is this --> To update my app, I only have
to download a new version of it... Being written in python, the app
itself is pretty small....

Suppose the following are true:
1) when the user installs my custom built python distribution they
also get version 1.0 of the app.
2) Suppose it is installed in c:\myapp (for simplicity).
3) I've just released version 1.1

Because *all* of the modules are in my custom built distribution, I
don't have to actively scan for new modules between releases. So....
I can write a simple "updater" script that will:
1) download a new myapp.zip
2) remove the c:\myapp directory and its subdirs
3) unzip it to c:\myapp, overwriting what is there

After those three steps are complete, then my app is updated. Super
simple. All I have to do is "zip" up my application and post it to a
website somewhere...

IIRC, py2exe bundles things up in a .zip file. So in order to update
a py2exe app i'd have to ->
1) check for new module dependencies
2) get the newly imported modules AND my newly updated modules back to
the client
3) update the zip file with the new modules.

This becomes especially hairy when someone is updating from 1.0 to say
1.5. Then I have to keep track of all the deltas between 1.0/1.5. My
way is much simpler because I don't have to keep up with *anything*.
As long as I test my code against my custom built distribution, it
ought to JUST WORK.

I don't trust myself to keep up with anything ;).

However, if you have an idea on updating py2exe bundled apps, I'm all ears...

If I have my own distribution, I can simply give the users an "update"
program that will query my webserver which will download the latest
version for them automagically. Because my distribution has all of
the modules already available, I don't have to worry about sending
them any missing modules. Simply download the latest version of my
app and it works with my custom rolled distribution.

But, this only works for Windows...


Why? As I understand "update" program was written by you, so what
prevents it from working on other platforms besides testing?


Yes, but the *update* program runs in the context of my distribution
which is strictly bundled for windows. Now, someone *could* build a
distributable version for Linux somehow (I guess) and then the update
techniques I mentioned would probably work there.

jw
Jul 18 '05 #7
I'm fairly new to python myself (with about 16 years of various
languages); I found py2exe fairly straightforward to use.
The instructions are ok, but if you care to see it I took some notes and
threw them into an article on my company site.

<http://home.agilemarkup.com/index.php?option=content&task=view&id=64&Itemid=27 >

Regards

- Mitch

Phillip Mills wrote:
I've learned enough of the Python language to be mildly dangerous and
have used it in a few personal projects. All my development of
commercial (or production) products over the past dozen years have been
done with C++ or Java.

For a program I'm planning -- to begin during the summer -- having an
interpreter as part of the application would be very desirable to allow
sophisticated users to provide their own extensions. Java would be
do-able, but....

My problems are:
- I'd like the process of installing the application to be one step;
no "first download a Python interpreter then a GUI library" kind of
thing.
- I also need the core part of the application to be reasonably
protected. I'm not looking to defeat hackers, but something equivalent
to the way Java's class files stored in jars stay where they're supposed
to be and aren't immediately readable.

I've looked at various web sites for this topic, but most I've found are
just arguments for using the Python language. OK, I'll pretend I'm
convinced...now any comments or references on the mechanics of creating
a self-contained distribution?

Jul 18 '05 #8
Phillip Mills wrote:
First, thanks to all the people who have answered so far for the
suggestions.

In article <U3*********************@news000.worldonline.dk> ,
André Søreng <ws******@tiscali.no> wrote:
Phillip Mills wrote:
My problems are:
[...]
http://starship.python.net/crew/theller/py2exe/


Apparently I had more problems than I mentioned. :-) One of them
being that a Windows-only solution is only a partial solution.


There is also py2app for Mac. Still partial? :) Then follow Jaime's
way: build and bundle python with your application.
- I also need the core part of the application to be reasonably protected. I'm not looking to defeat hackers, but something
equivalent to the way Java's class files stored in jars stay
where they're supposed to be and aren't immediately readable.
Hmm, not sure about that one. You mean that those users who write
extensions should not be able to modify the core code you wrote?


Partly that and partly a file management thing. For most end users a

.jar is one thing to deal with; it's the most recent one or it's not; it's present in the right location or it's not....


Python byte code is like java byte code and python supports importing
from zip files like java. Since python comes with a liberal license
you can change the importing code to decrypt your modules with a
"secret" key. That will be much safer than java. Of course that won't
stop real hackers.

Serge.

Jul 18 '05 #9
Jaime Wyant wrote:
This becomes especially hairy when someone is updating from 1.0 to
say 1.5. Then I have to keep track of all the deltas between
1.0/1.5. My way is much simpler because I don't have to keep up with
*anything*. As long as I test my code against my custom built
distribution, it ought to JUST WORK.

I don't trust myself to keep up with anything ;).


Now I follow you :) I agree that updating py2exe apps requires package
management utilities. I don't think they will be messy, it's just
more code to maintain compared to your way. You only need to track
one delta (1.0 -> 1.1 ... -> latest) and publish two files latest.exe
and update.zip

Serge.

Jul 18 '05 #10
"Serge Orlov" <Se*********@gmail.com> writes:
Jaime Wyant wrote:
This becomes especially hairy when someone is updating from 1.0 to
say 1.5. Then I have to keep track of all the deltas between
1.0/1.5. My way is much simpler because I don't have to keep up with
*anything*. As long as I test my code against my custom built
distribution, it ought to JUST WORK.

I don't trust myself to keep up with anything ;).


Now I follow you :) I agree that updating py2exe apps requires package
management utilities. I don't think they will be messy, it's just
more code to maintain compared to your way. You only need to track
one delta (1.0 -> 1.1 ... -> latest) and publish two files latest.exe
and update.zip


Sometimes I think that CVS or SVN may be the simplest solution to update
applications. Install a client on the target computer, it may be
invisible to the user, copy the CVS or SVN directories, and provide a
script the does (also invisible) 'cvs up -r version_a_b'.

Thomas
Jul 18 '05 #11
Sneaky! I like it. Now if there was only a subversion python module...

jw

On Wed, 02 Mar 2005 22:08:45 +0100, Thomas Heller <th*****@python.net> wrote:
"Serge Orlov" <Se*********@gmail.com> writes:
Jaime Wyant wrote:
This becomes especially hairy when someone is updating from 1.0 to
say 1.5. Then I have to keep track of all the deltas between
1.0/1.5. My way is much simpler because I don't have to keep up with
*anything*. As long as I test my code against my custom built
distribution, it ought to JUST WORK.

I don't trust myself to keep up with anything ;).


Now I follow you :) I agree that updating py2exe apps requires package
management utilities. I don't think they will be messy, it's just
more code to maintain compared to your way. You only need to track
one delta (1.0 -> 1.1 ... -> latest) and publish two files latest.exe
and update.zip


Sometimes I think that CVS or SVN may be the simplest solution to update
applications. Install a client on the target computer, it may be
invisible to the user, copy the CVS or SVN directories, and provide a
script the does (also invisible) 'cvs up -r version_a_b'.

Thomas
--
http://mail.python.org/mailman/listinfo/python-list

Jul 18 '05 #12
Jaime Wyant wrote:
Sneaky! I like it. Now if there was only a subversion python module...

jw


GIYF: http://pysvn.tigris.org/
--
Website: www DOT jarmania FULLSTOP com
Jul 18 '05 #13
Jaime Wyant wrote:
Sneaky! I like it. Now if there was only a subversion python module...


Google, and you shall find.

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
Jul 18 '05 #14
On Wed, 2 Mar 2005 13:07:25 -0600, Jaime Wyant <pr***********@gmail.com> wrote:
<snip>
However, if you have an idea on updating py2exe bundled apps, I'm all ears...


I'm working on a little project that requires remote updating. What I
basically came up with is two nested applications.

program/program.exe runs, and checks program/realprogram/ for updates
from a server. if md5s mismatch, it pulls new versions. after pulling
new version, it runs the program/realprogram.exe

realprogram.exe can, at some point in the future, be written to update
program/program.exe's code.

This isn't exactly the way I ended up doing it, due to the application
(all on a LAN, not the internet) I'm actually pulling the 'real'
program every time and leaving it in a directory under
tempfile.gettempdir()

Its a bit messy, but it actually works on both windows and linux.
(cx_Freeze under linux)

Stephen.
Jul 18 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David | last post by:
I have been going around in circles trying to understand the method of creating a database in VB.Net 2003 and distributing that application and database. It seems if I use the Server Explorer to...
10
by: John Phelan | last post by:
I read an article by, by Mike Groh, in Access-VB-SQL Advisor Magazine, Week 37 that concerns me quite a bit on distributing Access Applications commercially. First I need to describe a "commercial...
5
by: MLH | last post by:
I have little or no knowledge as to how a runtime Access database application might be distributed from a website. I am sure that I'm about to find out. I do have one question for you wizards...
2
by: John Welch | last post by:
It happens much too often that I have to tell a client how to fix up missing references when I send them an application, especially if the client is distributing it to different users. It makes me...
6
by: Brett | last post by:
Is there a restriction with the academic version of VS.NET 2003 in the way of distributing an EXE? Or, what is the difference in this version and the commercial versions with respect to...
2
by: Michelle | last post by:
Hi I have an Access background and I wish to create a window application which will use a SQL connection for its data. I use VS 2005 Professional and know that the SQL Servicer Express edition...
5
by: xkenneth | last post by:
Hi All, I'll shortly be distributing a number of python applications that use proprietary. The software is part of a much larger system and it will need to be distributed securely. How can i...
1
by: PurpleServerMonkey | last post by:
Working on a rather large open source python application that I want to release for Linux and BSD and was wondering what methods others are using to distribute large and complex applications. ...
9
by: eliben | last post by:
Hello, I'm getting into Python now after years of Perl, and as part of my research I must understand how to do some common tasks I need. I have a bunch of Windows PCs at work to which I want...
10
by: Anthony P. | last post by:
Hello Again Everyone, I finished a very simple application and have published it to a local directory. I then went to the published directory and zipped all of the files up into a .ZIP archive....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.