Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > windows/distutils question

Reply
Thread Tools

windows/distutils question

 
 
Paul Rubin
Guest
Posts: n/a
 
      06-28-2005
I'm trying to package a windows app with distutils (you've heard about
it before). The app needs to store some data on disk and apparently
the right place to put it is in the "Application Data" directory. The
only way I see to find out the name of this directory is the
get_special_folder_path function in the postinstallation script
(CSIDL_APPDATA). So I call that function and get the directory name,
which work ok.

There's just one problem: how do I store the name so the application
can use it? My obvious idea is to just make an "appdir.py" file
containing something like

# automatically generated by postinstallation script
application_directory = "C:\windows\documents and settings\username\application data"

but the point is that I need appdir.py to be stored in the directory
where the application code itself lives, i.e. the installation target
directory. And I don't see a way to find THAT from the
postinstallation script. The postinstallation script seems to run
with working directory equal to wherever you launched it from.

Note: using os.path.expanduser('~/Application Data') doesn't work
because the person may be using a non-English version of Windows and
that directory would have a different name.

Thanks for any ideas.
 
Reply With Quote
 
 
 
 
pyguy2@gmail.com
Guest
Posts: n/a
 
      06-28-2005
If the environment variable:

os.environ['APPDATA']

is present on non-English Windows, you may be able to use that to get
what you need.

john

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question row filter (more of sql query question) =?Utf-8?B?YW5kcmV3MDA3?= ASP .Net 2 10-06-2005 01:07 PM
Quick Question - Newby Question =?Utf-8?B?UnlhbiBTbWl0aA==?= ASP .Net 4 02-16-2005 11:59 AM
Question on Transcender Question :-) eddiec MCSE 6 05-20-2004 06:59 AM
Question re: features of the 831 router (also a 924 question) Wayne Cisco 0 03-02-2004 07:57 PM
Syntax Question - Novice Question sean ASP .Net 1 10-20-2003 12:18 PM



Advertisments