title: Bundling GTK resources with py2exe
body: <p>I'm using Python 2.6 and PyGTK 2.22.6 from the <a href="http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/" rel="noreferrer">all-in-one installer</a> on Windows XP, trying to build a single-file executable (via <a href="http://www.py2exe.org/" rel="noreferrer">py2exe</a>) for my app.</p>
  
  <p>My problem is that when I run my app as a script (ie. not built into an <code>.exe</code> file, just as a loose collection of <code>.py</code> files), it uses the native-looking Windows theme, but when I run the built exe I see the default GTK theme.</p>
  
  <p>I know that this problem can be fixed by copying a bunch of files into the <code>dist</code> directory created by py2exe, but everything I've read involves manually copying the data, whereas I want this to be an automatic part of the build process. Furthermore, everything on the topic (including <a href="http://faq.pygtk.org/index.py?req=show&amp;file=faq21.005.htp" rel="noreferrer">the FAQ</a>) is out of date - PyGTK now keeps its files in <code>C:\Python2x\Lib\site-packages\gtk-2.0\runtime\...</code>, and just copying the <code>lib</code> and <code>etc</code> directories doesn't fix the problem.</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li><p>I'd like to be able to programmatically find the GTK runtime data in <code>setup.py</code> rather than hard coding paths. How do I do this?</p></li>
  <li><p>What are the minimal resources I need to include?</p></li>
  </ol>
  
  <p><strong>Update:</strong> I may have almost answered #2 by trial-and-error. For the "wimp" (ie. MS Windows) theme to work, I need the files from:</p>
  
  <pre><code>runtime\lib\gtk-2.0\2.10.0\engines\libwimp.dll
  runtime\etc\gtk-2.0\gtkrc
  runtime\share\icons\*
  runtime\share\themes\MS-Windows
  </code></pre>
  
  <p>...without the <code>runtime</code> prefix, but otherwise with the same directory structure, sitting directly in the <code>dist</code> directory produced by py2exe. But where does the <code>2.10.0</code> come from, given that <code>gtk.gtk_version</code> is <code>(2,22,0)</code>?</p>