473,387 Members | 1,789 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,387 software developers and data experts.

windows/distutils question

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.
Jul 19 '05 #1
1 1305
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

Jul 19 '05 #2

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

Similar topics

2
by: WIWA | last post by:
I'm looking for SNMP support in Python. I have found pySNMP, but I'm not sure whether this works under Windows as well. A few questions: 1) Where do I need to install the pySNMP files? 2) What...
2
by: Roose | last post by:
With some googling I have found these resources: http://docs.python.org/ext/win-dlls.html http://www.python.org/doc/faq/windows.html I have a large Win32/MFC/C/C++ application that has an...
3
by: Qiangning Hong | last post by:
I am writing a setup.py for my package. I have a pre-compiled myextmod.pyd file in my package and I want the distutils to automatically copy it to...
1
by: George van den Driessche | last post by:
Hi folks, I'm looking at packaging a project I'm working on using distutils. The project is for Windows and contains a COM server which needs registration, so the installer needs to be a little...
2
by: Laszlo Zsolt Nagy | last post by:
How how can I install my .mo files from a distutil script into its default location? sys.prefix + os.sep + 'share' + os.sep + 'locale'
6
by: ajikoe | last post by:
Hello I tried to combine c++ and python together. So I follow from this website: http://kortis.to/radix/python_ext/ I have this code: # prmodule.c static PyObject *pr_isprime(PyObject *self,...
27
by: Julien Fiore | last post by:
Do you wand to install Pyrex on Windows ? Here is a step-by-step guide explaining: A) how to install Pyrex on Windows XP. B) how to compile a Pyrex module. Julien Fiore, U. of Geneva
48
by: meyer | last post by:
Hi everyone, which compiler will Python 2.5 on Windows (Intel) be built with? I notice that Python 2.4 apparently has been built with the VS2003 toolkit compiler, and I read a post from Scott...
7
by: Eric S. Johansson | last post by:
is there anyway I can, in a setup.py file, set and internal equivalent to the '--install-scripts' commandline option? script installation directory but I don't want on the command line where...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.