Question
I got inspired by an article in [http://www.xmldatabases.org/WK/blog/1094?t=item Inspirational Technology] and added some configuration-option to the software as an XML-File.
In times before I just did a copy \develeopment\somefile.ini \distribuiton\somefile.ini after runing Py2Exe.
But after combining Py2Exe with Innosetup, it was really crucial to get these files copied to the Py2Exe dist-Directory during the Py2Exe Buildrun.
Solution
It was present all times in Py2Exe. But I did not really understand how to use it :)))
1 setup(
2 options = options,
3 # The lib directory contains everything except the executables and the python dll.
4 zipfile = zipfile,
5 windows = [wxprog],
6 # use out build_installer class as extended py2exe build command
7 cmdclass = {"py2exe": build_installer},
8 packages = ["encodings"],
9 data_files=[("prog",["kategorien.xml",])]
10 )
The crucial line is
1 data_files=[ ("prog",["kategorien.xml",])]
here you are supposed to supply a list of tuples. [ (,), (,), ...]
Each tuple ("directoy",["list.txt", "of.txt", "files.txt) consists of 2 Elements:
- 1 the subdirctory of the dist-base directory, where the files are copied to 1 a list of files, which are supposed to be copied there
So in my example I have some configuration data in kategorien.xml and want to get this file copied to the program-directory. (Maybe that is bad style and whe should put it within \documents and settings\currentuser\ApplicationSettings\MyCompany\MyProduct\MySettings.XML, but for distribution WITHIN one company I want to be able to support filepaths by phone )