Differences between revisions 1 and 2
Revision 1 as of 2004-01-13 13:01:28
Size: 1098
Editor: cache1-1-ffm-vpn
Comment:
Revision 2 as of 2004-01-13 13:06:22
Size: 1729
Editor: cache1-2-ffm-vpn
Comment: additional datafiles
Deletions are marked like this. Additions are marked like this.
Line 28: Line 28:
    data_files=[("prog",["kategorien.xml",])
]
    data_files=[ ("prog",["kategorien.xml",])]
Line 31: Line 30:
here you are supposed to supply a list of tuples 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 :-)) )

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 :-)) )

AddingConfigFiles (last edited 2015-04-13 15:08:35 by JimmyRetzlaff)