title: Registry checking if path/key exists
body: <p>Hei guys, quick stupid question...</p>
  
  <p>I got this code:</p>
  
  <pre><code>String arch = System.getenv("PROCESSOR_ARCHITECTURE");
  String wow64Arch = System.getenv("PROCESSOR_ARCHITEW6432");
  String realArch = arch.endsWith("64") || wow64Arch != null &amp;&amp; wow64Arch.endsWith("64") ? "64" : "32";
  String setWin = ((realArch.contains("64")) ? "SOFTWARE\\Wow6432Node\\path" : "SOFTWARE\\path");
  String check = Advapi32Util.registryGetStringValue (HKEY_LOCAL_MACHINE, setWin, "InstallDir");
  </code></pre>
  
  <p>Which strings a path to a installed application, but if the registry doesn't exists my program stops.
  How i can check if the registry exists and if doesn't bypass it?</p>
  
  <p>and also to add <code>system.err.println("Application not installed.");</code> if the key doesn't exists.</p>
  
  <p>PS: The program is a GUI so i want to show it even if the key is missing.</p>
  
  <p>Thank you!</p>