Possible Duplicate:
Get login username in java
I am looking for a way to find you the name of the user in the OS in java so I can get the right directory on how to find out whether a there is a missing file on the user's appdata. I am using this code:
`File myFile = new File("C:" + File.separator + "Users" + File.separator, "Matty" + File.separator, "AppData" + File.separator, "Roaming");
System.out.println(myFile.isDirectory());
if (myFile.isDirectory() = true)
{
//This will install the program, but i need to find out whether it is already installed
installer.install()
}`
There must be a code for this as most installers have to know what the user's name is!