[Python-Dev] VC 7.1 maintenance?

"Martin v. Löwis" martin at v.loewis.de
Fri Jul 9 22:28:28 CEST 2004


Thomas Heller wrote:
> Wise gives an example.  It stores the previous value in it's INSTALL.LOG
> file.  Whether this makes sense in general or not I cannot tell,
> although it's convenient for me.

This is unreliable, of course: the original software may get
uninstalled, in which case uninstall would restore an invalid
association.

Or, something might install on top of Python, and back up the Python
association in its own logfile. Then, uninstalling Python would break
the associations of that software.

I just learned in microsoft.public.platformsdk.msi that Windows does
not have a mechanism for that feature, and neither does MSI.

> I thought MSI were able to 'restore the system to the state it had
> before the installation', but maybe this is just a dream, may it isn't
> supposed to do this, maybe one has to use system restore points for
> that, and maybe this only shows how much I know about this stuff.

MSI does support rollbacks; invoking a rollback is supposed to fully
restore the system to its original state (although the MSI author
has to work to make sure it really does in all cases).

However, rollback only applies to the installation. If, in the course
of the installation, something fails (e.g. an essential file cannot
be written, because permissions are incorrect), installer will invoke
a rollback and restore all original registry keys. Once the installation
is committed, rollback is not possible anymore (and installer removes
the Cancel button from the UI after the commit until the end of the
installation).

> Well, the docs for msilib could tell that associations are not restored.

Actually, msilib is (currently) completely unaware of associations. The 
Python associations are generated in the fragment starting

     # File extensions, associated with the REGISTRY.def component
     # IDLE verbs depend on the tcltk feature.
     # msidbComponentAttributesRegistryKeyPath = 4
     # -1 for Root specifies "dependent on ALLUSERS property"
...
     add_data(db, "Registry",
             [# Extensions
              ("py.ext", -1, r"Software\Classes\."+ext, "",
               "Python.File", "REGISTRY.def"),

This is literally what it says it is: it adds data to the Registry
MSI table. See the documentation of the Registry table for details
of the fields.

Installer, in turn, literally does what the Registry table tells it to
do: it adds keys to the registry.

If you want to perform backup of the existing registry keys to a
file, you need a Custom Action.

> BTW: Python-2.4a1.msi misses to install the
> distutils/command/wininst-6.exe file.  Should I fix this myself (i guess
> I could figure *this one* out) or do you prefer a bug report?

Please go ahead and make any changes to the scripts you feel necessary.
If you are uncertain, make a patch and assign it to me. If you don't
know how to make a patch, or have no time to do so, submit a bug report.

Regards,
Martin



More information about the Python-Dev mailing list