Re: py2exe windows apps path question



Vincent, I'm not sure I completely understand your question but this
link may be the answer nonetheless:
http://www.jrsoftware.org/isfaq.php#workingdir

And here is how I make sure I'm always using the right directory in my scripts:

Put this code at the top:
import sys
curdir=os.path.dirname(sys.argv[0])
#print curdir
Then I use curdir to build all of the paths in my app:
For example let's get a list of files in a folder:
lstresumes=os.listdir(os.path.join(curdir,resume_folder_path)) #get
list of resumes


Below is optional but helps me keep a python module in the exe's main
directory and be able to edit it. Otherwise the main module reads
from py2exe's lib file which seems harder to change:
sys.path.insert(0,curdir) #read usersettings.py from main dir, not library


Let me know if that helps (I may be answering the question I had
yesterday and not yours though ;-)

-Greg


On 8/2/05, vincent wehren <vincent@xxxxxxxxxxxxxx> wrote:
>
> "Grant Edwards" <grante@xxxxxxxx> schrieb im Newsbeitrag
> news:11ev0tcg9n2ndd@xxxxxxxxxxxxxxxxxxxxx
> |I have several python apps (some wxPython, some plain text-mode
> | stuff) that I distribute internally for installation on Win32
> | machines. They're bundled/installed using py2exe and inno
> | setup.
> |
> | I followed what I think is the normal procedure of installing
> | each app in its own directory under /Program
> | Files/<vendor>/<app>.
> |
> | The problem is that the apps only run if they're started with
> | the install directory as the current working directory.
> | Otherwise they can't find the .dll's they use from the install
> | directory.
>
> AFAIK, Windows normally *does* search the directory where the executable
> module for the current process lives in for dlls. What sort of dlls are
> given you trouble?
>
> --
>
> Vincent Wehren
>
>
>
>
> |
> | Is there some way to temporarily add the app's install
> | directory to the search path for .dll's?
> |
> | --
> | Grant Edwards grante Yow! .. I think I'd
> | at better go back to my
> DESK
> | visi.com and toy with a few
> common
> | MISAPPREHENSIONS...
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>


--
Gregory Piñero
CEO and Founder
Blended Technologies
(www.blendedtechnologies.com)
.



Relevant Pages

  • Re: deploying crystal dlls with a vb.net project
    ... at the moment the crystal dlls aren't on the user's ... machine where I'm trying to install this application. ... I know it might not be the best idea to do this without a deployment ... app but there are time and financial constraints on this. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: OpenNetCF cab confusion
    ... You have two choices - copy the specific dlls to your app folder, ... In fact to allow for another installation to install the SDF I ... >>>I did a very simple test to try to understand the cab file building ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: DLL nightmares ...
    ... >> Why are you installing Office and Real player on your server? ... >> Don't install real player on your server. ... generally protected and won't be replaced by a bad app. ... With COM DLLs, as ...
    (microsoft.public.windows.server.general)
  • Re: DLL nightmares ...
    ... >> Why are you installing Office and Real player on your server? ... >> Don't install real player on your server. ... generally protected and won't be replaced by a bad app. ... With COM DLLs, as ...
    (microsoft.public.windows.server.setup)
  • Re: DLL nightmares ...
    ... >> Why are you installing Office and Real player on your server? ... >> Don't install real player on your server. ... generally protected and won't be replaced by a bad app. ... With COM DLLs, as ...
    (microsoft.public.windows.server.migration)