Search code examples
javainstall4j

Delete a node in java preference store that contains a period


Im trying to clear the users' java.util.prefs.Preferences node of my java application when uninstalling. For this, im using the "Delete a node or key in the Java preference store" action in my uninstaller step to delete the package that i save the preferences in.

This works (on windows) for a package name that contains no period ("test"). The package gets deleted in the registry.

However, if the package contains a period ("test.test"), i can't get it to work.

The error message I get in the installation.log:

[INFO] com.install4j.runtime.beans.actions.registry.DeletePreferenceItemAction [ID 1006]: Execute action
       Property key: 
       Property onlyIfEmpty: false
       Property preferenceDeleteType: User specific
       Property packageName: test.test
       Property rollbackSupported: true
[ERROR] com.install4j.runtime.beans.actions.registry.DeletePreferenceItemAction [ID 1006]: Package test.test does not exist
        Execute action not successful after 2 ms

This is the configuration of the "Delete a node or key in the Java preference store" action:

Package name: test.test
Key: i left this empty (i want to delete the entire package)
Preference root: User specific

the other values are the defaults.

I've also tried the following package name values:

test\.test
"test.test"

But to no avail. We already have alot of users with the registry entries, so preferably we do not rename the package name. Is there a way to do this?

Thanks!


Solution

  • install4j transforms entered package names to path names, so "." is replaced with "/". I have have added escaping to 6.0.5, so entering "test.test" will work starting with that version. To get a pre-release build, please contact [email protected].