packaging multiple python scripts as Windows exe file

A

Alex Hall

Hi all,
While my project is still suffering from major import problems, I will
soon have to try to package it as a Windows executable file. I do not
want an installer; I want the user to be able to run the program for
as long as they want, then to quit (by using a command from inside the
program) and that is it. Nothing to install, no files to copy, no
registry editing, just start and use it until done.

I know about the popular solutions for this sort of thing, but I read
that a DLL is required, and that this dll cannot be (legally)
distributed by myself? A few questions here:
1. Did I read this wrong / is this outdated? Please answer 'yes' as
this will be a real pain to deal with.

2. If I must have it but can distribute it, where should it go so my
program can find it?

3. If the user must download it for legal reasons, instead of me
giving it to them, can I just have a Python script take care of it and
put it in the same directory as the program, so the program can find
it, or do I need to register the dll with the system? If I need to
register, does this require admin login?

Thanks as always!
 
M

Mike Driscoll

Hi all,
While my project is still suffering from major import problems, I will
soon have to try to package it as a Windows executable file. I do not
want an installer; I want the user to be able to run the program for
as long as they want, then to quit (by using a command from inside the
program) and that is it. Nothing to install, no files to copy, no
registry editing, just start and use it until done.

I know about the popular solutions for this sort of thing, but I read
that a DLL is required, and that this dll cannot be (legally)
distributed by myself? A few questions here:
1. Did I read this wrong / is this outdated? Please answer 'yes' as
this will be a real pain to deal with.

2. If I must have it but can distribute it, where should it go so my
program can find it?

3. If the user must download it for legal reasons, instead of me
giving it to them, can I just have a Python script take care of it and
put it in the same directory as the program, so the program can find
it, or do I need to register the dll with the system? If I need to
register, does this require admin login?

Thanks as always!


Without knowing the exact DLL you're thinking of, we can't be sure
what the answer is. But I think you're talking about a certain MS DLL
that Python distributes. If so, I've read multiple threads on this
topic that claim that since Python distributes it, there is an implied
permission that you can as well. Since I'm not a lawyer, I can't say
for sure, but the articles I've seen are pretty convincing.
 
J

Joaquin Abian

Without knowing the exact DLL you're thinking of, we can't be sure
what the answer is. But I think you're talking about a certain MS DLL
that Python distributes. If so, I've read multiple threads on this
topic that claim that since Python distributes it, there is an implied
permission that you can as well. Since I'm not a lawyer, I can't say
for sure, but the articles I've seen are pretty convincing.

the OP probably means MSVCR71.dll that is needed to make single file
executables with py2exe.
This has been discussed elsewhere. Look at http://www.py2exe.org/index.cgi/Tutorial#Step5

joaquin
 
A

Alex Hall

msvcr90.dll is the file, and, according to the py2exe tutorial, step
5, I do not have permision to distribute the file. This is not good
news, but beyond that, I apparently get an entire directory with all
required files, not a single .exe which has everything packaged inside
it. Is there another way of compiling Python to .exe which gives me
one file containing all my dlls and Python dependencies? If not then a
folder is not bad, but a single file would be best.
 
D

Den

Hi all,
While my project is still suffering from major import problems, I will
soon have to try to package it as a Windows executable file. I do not
want an installer; I want the user to be able to run the program for
as long as they want, then to quit (by using a command from inside the
program) and that is it. Nothing to install, no files to copy, no
registry editing, just start and use it until done.

I know about the popular solutions for this sort of thing, but I read
that a DLL is required, and that this dll cannot be (legally)
distributed by myself? A few questions here:
1. Did I read this wrong / is this outdated? Please answer 'yes' as
this will be a real pain to deal with.

2. If I must have it but can distribute it, where should it go so my
program can find it?

3. If the user must download it for legal reasons, instead of me
giving it to them, can I just have a Python script take care of it and
put it in the same directory as the program, so the program can find
it, or do I need to register the dll with the system? If I need to
register, does this require admin login?

Thanks as always!

I'm not an expert, but there is a module called ResourcePackage
(http://resourcepackage.sourceforge.net/) which I have used to include
binary files within my python program (I use it for an image file).
It takes the binary file, makes a string out of it, then generates a
module containing that string. You can then import that module and
access that string. In particular, I assume you can write that string
out to a binary file and recreate the binary file.

I know this doesn't address how to make a single exe which a user can
run (I'm interested in the replies you get) but it does allow you to
carry your binary files along with your and write them out when and if
you need them.

By the way, I'd be interested to hear if there are any other such
solutions for embedding binary files in a python program.

Hope that helped.

Den
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top