[Twisted-Python] Re: Fixes for windows installer
theller at python.net
Fri Feb 28 14:40:42 EST 2003
Cory Dodt <corydodt at yahoo.com> writes:
> 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?
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).
> * 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.
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
> * 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.
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
look for the CreateShortcut function.
More information about the Twisted-Python