[izpack-devel] Writing a TopLevel Registry Key...

Markus Schlegel markus.schlegel at pulinco.com
Tue Nov 28 12:09:19 CET 2006

Our Application requires wirting Toplevel keys to the Windows Registry for File-ending and URL-Protocol Registration.
For Example we have to write a Key "HKCR\.xte". While this should be a very common task for an Installer operation in Windows, this is not supported with the current release of IzPack (3.9.0).
First of all, when defining such an entry in the RegistrySpec.xml file, it just stops writing to the registry with an error, but no Error-Text, because the Native Exception is wrapped by a "WrappedNativeException" which has no Message anymore. Thus its very annoying to track down the reason of this failure. 
I have fixed this (give the message to the WrappedNativeExcpetion). 
I then took a look into the implementation (RegistryImpl.java) and found out, that there is no good reason why setting a toplevel RegistryKey should be "forbidden". So I enhanced the code in RegistryImpl to accept TopLevel Registry Keys.
The remaining problem is now, that it seems not possible to remove such Toplevel Keys from the registry at uninstallation. Without a modification of "RegistryImpl.deleteKeyIfEmpty()", I get the following Exception on uninstallation:
(from native Method "RegistryImpl.deleteKeyN()")
...WrappedNativeException: Der Registry-Schlüssel HKCR\.xte konnte nicht gelöscht werden.
Fehlernummer des Betriebssystems: 2
Fehlertext des Betriebssystems: Das System kann die angegebene Datei nicht finden.
I now made a temporary solution for this by not trying to delete toplevel keys at all. But I think this could be solved inside the native code. Maybe someone of you who knows the native code could fix this?
Markus Schlegel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.berlios.de/pipermail/izpack-devel/attachments/20061128/6b8fa681/attachment.html 

More information about the izpack-devel mailing list