From: Thomas J. <pre...@pr...> - 2005-01-24 02:50:25
|
Hi, As the topic states; Is it possible to embed the zip into the exe, while still putting the pyd's and dll's into a subdir? I'm guessing just modifying the path that py2exe inserts would do the trick, but how can I do this? - Thomas Johansson |
From: Thomas H. <th...@py...> - 2005-01-26 20:38:30
|
Thomas Johansson <pre...@pr...> writes: > Hi, > > As the topic states; Is it possible to embed the zip into the exe, > while still putting the pyd's and dll's into a subdir? The subdir that is used is the directory part of the zipfile. zipfile is specified as None to embed it onto the exe, so, there's no way to specify a subdirectory. > I'm guessing just modifying the path that py2exe inserts would do the > trick, but how can I do this? You subclass the py2exe.build_exe.py2exe class, and override the create_directories method - changing self.lib_dir should do the trick, although I've never tried this. The "extended" sample shows how to install the subclass into the build. Thomas |
From: Thomas J. <pre...@pr...> - 2005-01-28 11:49:08
|
Thomas Heller wrote: > You subclass the py2exe.build_exe.py2exe class, and override the > create_directories method - changing self.lib_dir should do the trick, > although I've never tried this. The "extended" sample shows how to > install the subclass into the build. > I tried this, as a rough first try: class build_exe(py2exe): def create_directories(self): py2exe.create_directories(self) self.lib_dir += "\\lib" self.mkpath(self.lib_dir) This does make it output data to the lib subdir, but the exe still only looks in the current directory, not the subdir, for dependencies. Unfortunately I'm quite new to python and I've not messed with distutils at all before so I'm kinda fumbling in the dark here. - Thomas Johansson |
From: Thomas H. <th...@py...> - 2005-01-28 12:17:41
|
Thomas Johansson <pre...@pr...> writes: > Thomas Heller wrote: >> You subclass the py2exe.build_exe.py2exe class, and override the >> create_directories method - changing self.lib_dir should do the trick, >> although I've never tried this. The "extended" sample shows how to >> install the subclass into the build. >> > > I tried this, as a rough first try: > > class build_exe(py2exe): > def create_directories(self): > py2exe.create_directories(self) > self.lib_dir += "\\lib" > self.mkpath(self.lib_dir) > > This does make it output data to the lib subdir, but the exe still > only looks in the current directory, not the subdir, for dependencies. Yes, it seems that this approach does not work. But, if you have a subdirectory anyway containing supporting files, why do you want the zip-archive appended to the exe at all? > Unfortunately I'm quite new to python and I've not messed with > distutils at all before so I'm kinda fumbling in the dark here. > > - Thomas Johansson Thomas |
From: Thomas J. <pre...@pr...> - 2005-01-29 01:09:50
|
Thomas Heller wrote: > Yes, it seems that this approach does not work. But, if you have a > subdirectory anyway containing supporting files, why do you want the > zip-archive appended to the exe at all? Well, its just a personal preference, to reduce the file count, as well as prevent the 1337 h4x0r scriptkiddie from bothering me with "haha I got your source" (yes, I've had those.) As a sidenote, I'm not attempting to hide my code (then I'd look into obfuscation), merely to avoid the above class of smartasses. > Thomas - Thomas Johansson |