[Twisted-Python] Re: Fixes for windows installer
![](https://secure.gravatar.com/avatar/a5c643ae477f4183ea1a93465e936761.jpg?s=120&d=mm&r=g)
I like where this is going, and I certainly have no complaints about dumping shortcut.py, but could you please review a few things before I commit this: * Putting install-script into setup.cfg makes your change visible to everyone who's building a distribution of Twisted. As you pointed out yourself, you can't use install-script without distutils 1.0.3, and Twisted has to support pythons 2.1 and 2.2. Will this config parameter be ignored by setup.py when building a Twisted install on distutils <1.0.3 or will it cause an error? * You made this change to the test I use for isWinNT: - if platform.isWinNT(): - return os.path.join(os.getenv("SYSTEMROOT"), - "system32", "shell32.dll") + # If SYSTEMROOT is not found (on Win98), guess the name + # of the windows directory + isNT = 0 + try: + get_special_folder_path("CSIDL_COMMON_PROGRAMS") + isNT = 1 + except OSError: # probably Win98 + pass Is the implementation of platform.isWinNT() broken? If so, I'd rather you patched it there. If not, I'd rather keep using it. * Most important thing: test_postinstall doesn't work with this patch, because create_shortcut and get_special_folder_path appear to be magical builtins installed by distutils. I'll be happy to rewrite the test if you can point me to the right place to import this code when it's not available as a builtin. __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/
![](https://secure.gravatar.com/avatar/b61315ad4ac9a887387d4ee835bd80c0.jpg?s=120&d=mm&r=g)
Cory Dodt <corydodt@yahoo.com> writes:
I think it will raise an error. Feel free to remove it again. (Another approach would be to handle it programatically in the setup.py script, you can somehow find out whether it is supported or not, and in the former case pass it through the options parameter).
I don't think it is broken. But we're not interested if this is NT or not, we only try to find shell32.dll. And I wanted to remove the requirement that win32all be installed for full functionality if the installer only (actually that's the reason I integrated them in bdist_wininst).
These are builtin commands in the bdist_wininst stub used to create the installer. AFAIK, there's no way to access them from somewhere else ;-( You could, of course, simulate them for the test stuff in Python with win32all, you could even look up the C sources in http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/PC/bdi... look for the CreateShortcut function. Thomas
![](https://secure.gravatar.com/avatar/b61315ad4ac9a887387d4ee835bd80c0.jpg?s=120&d=mm&r=g)
Cory Dodt <corydodt@yahoo.com> writes:
I think it will raise an error. Feel free to remove it again. (Another approach would be to handle it programatically in the setup.py script, you can somehow find out whether it is supported or not, and in the former case pass it through the options parameter).
I don't think it is broken. But we're not interested if this is NT or not, we only try to find shell32.dll. And I wanted to remove the requirement that win32all be installed for full functionality if the installer only (actually that's the reason I integrated them in bdist_wininst).
These are builtin commands in the bdist_wininst stub used to create the installer. AFAIK, there's no way to access them from somewhere else ;-( You could, of course, simulate them for the test stuff in Python with win32all, you could even look up the C sources in http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/PC/bdi... look for the CreateShortcut function. Thomas
participants (2)
-
Cory Dodt
-
Thomas Heller