[Twisted-Python] Re: Long patch: Win32 Shortcuts

Thomas Heller theller at python.net
Mon Dec 9 03:11:56 EST 2002


"Cory Dodt" <cdodt at fcoe.k12.ca.us> writes:

> Description
> -----------
> This patch establishes the beginning stages of creating shortcut Icons
> on Win32.  It uses a new feature in distutils 1.03(CVS) which allows
> post-installation code to run by specifying --install-script on the
> command line.
[...]
> Known Bugs
> ----------
> The shortcuts are not removed when Twisted is uninstalled from
> Add/Remove Programs.  The post-install script also gets run
> post-uninstallation so, in theory, twisted-post-install could detect
> whether installation or uninstallation was taking place and decide
> whether to add or remove icons on that basis.  In practice, the only way
> to detect this is to see if the icons are already there, and this method
> will create havoc if you're installing over an existing installation.

Cory,

I really should write up some docs for the postinstall command on windows.
Here is some info which should probably solve some of your problems:

The postinstall script is run witt sys.argv[1] set to '-install' or
'-remove' depending on what is done, so there is no guesswork needed.

The easiest way to make sure files or directories are removed at
uninstallation is to register them with the installation log file,
then they will automatically be removed.  This can be done by calling
the file_created(path) or directory_created(path) functions. These
functions are available when bdist_wininst runs the postinstall script.

Thomas






More information about the Twisted-Python mailing list