#15 HKEY_CLASSES_ROOT vs HKEY_CURRENT_USER

open-accepted
None
5
2011-02-08
2010-12-31
Anonymous
No

Hi Peter,

WinRun4J is an incredibly great tool, which has made my application deployment very comfortable. One little thing is nagging me, though, and I would like to suggest an improvement:

For registering file associations you have to run WinRun4J with administrator privileges, because it wants to make changes to HKEY_CLASSES_ROOT. Personally, I think that's an overkill for my application and I would like to register file associations only for the current user. It seems that writing to HKEY_CLASSES_ROOT is deprecated anyway: http://msdn.microsoft.com/en-us/library/ms724475\(v=vs.85).aspx

I wasn't able to recompile the C++ source as I am developing on a Mac, so I modified FileAssociations.java in WinRun4J.jar to
1) be backwards-compatible by keeping the same behavior of the static functions,
2) offer more flexiblility by letting the caller decide where to read/write/delete a file association.

Now one can say either:
FileAssociation fa = FileAssociations.load(".myext");
or
FileAssociations.CURRENT_USER.save(fa);

Obviously, it would be nicer if WinRun4J.exe would provide this flexibility too – by, say, interpreting a new ini-file setting "file.n.registrykey", but I didn't want to mess with code that I can't compile.

Cheers and happy new year,
Christian

Discussion

  • Peter Smith

    Peter Smith - 2011-02-08

    Thanks for the suggestion and patch! This will be included in the next version.

     
  • Peter Smith

    Peter Smith - 2011-02-08
    • assigned_to: nobody --> poida_smith
    • status: open --> open-accepted
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks