= 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 :))) {{{ #!python setup( options = options, # The lib directory contains everything except the executables and the python dll. zipfile = zipfile, windows = [wxprog], # use out build_installer class as extended py2exe build command cmdclass = {"py2exe": build_installer}, packages = ["encodings"], data_files=[("prog",["kategorien.xml",])] ) }}} The crucial line is {{{ #!python 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\application settings\my bompany\myproduct\mysettings.xml, but for distribution WITHIN one company I want to be able to support filepaths by phone :-)) ) For more information, see: [[data_files]] = and how do you deal with this .xml-settings = Just to be buzzword-compliant every application this days should store at least something in [[http://www.xml.org/|XML]]. There are many, many libraries to do XML-Stuff in Python, I found 2 of them rather pythonic: * effbots [[http://effbot.org/zone/element-index.htm|ElementTree]] * and gnosis.xml of David Mertz Elementtree Documentation is easier to find (it's on the same website) and not totally up to date ("Element" is now a sub to "Elementtree" and no longer on module-level and such); gnosis-Tools are rather hidden [[http://gnosis.cx/download/Gnosis_Utils-current.tar.gz|GnosisDownload]] within a textual link which is only available from the end of an article in IBMs developer World. Also there is no website "getting started" for Gnosis, you have to dig for the /doc directory. The configuration file is: {{{ Kundentermin Kundentelefonate Auslandsbesuche }}} and I read it with {{{ #!python p=jpath.path(sys.argv[0]) p=p.splitpath()[0] p=p.joinpath("kategorien.xml") from elementtree import ElementTree t=ElementTree.fromstring(p.bytes()) kategorien=[k.text for k in t.getiterator(tag="Kategorie")] }}} after that {{{kategorien}}} contains a standard Python list of the categories defined in kategorien.xml jpath is a renamed PathModul written by Jason Jarondorff 20040113HAM