• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating Registry Entry for my java program

 
Jonathan Culloty
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I've a small java program that displays info in the windows system tray.
I want the program to start on bootup so I've manually added it to the registry under:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

This works nicely but I'd like to automate the registry update if possible, so its easier for people I distribute my program too.
Can anyone suggest a neat way to do this? I'm currently considering
1. Write an installation .bat file to update registry
2. Do the registry update from within my code

Any suggestions or tips much appreciated.
Thanks,

Jonathan
 
Dawn Charangat
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One alternate way to edit/add/update the registry manually [other than browsing through the regedit programs explorer interface] is to place the key[with its complete path] and value pair in a *.reg file - save this file, and double-clicking [execute] it.

Why dont we try to create such a file from within your java application and do a runtime.exec(the_reg_file) ???
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may help: How to read the Windows Registry
 
Jonathan Culloty
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys for the suggestions.
I went with the writing to .reg file and calling Runtime on it.
Works nicely
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic