ben2011
09-15-2011, 01:31 AM
I have Java console program packaged using InstallAnywhere 2009 and the program is wrapped the using Launcher. Inside the program it access user's current directory using :
String path = ".";
String currentdir = File(path).getCanonicalPath();
I realized that the return value (currentdir) always repsected to the location of the wrapper program (i.e. c:\program files\myapp\bin if the wrapper is located in C:\program files\myapp\bin\myprog.exe). If path is absolute path then it is okay. How can I fix this to return the actual path from where the launcher is called?
Best Regards,
Ben
String path = ".";
String currentdir = File(path).getCanonicalPath();
I realized that the return value (currentdir) always repsected to the location of the wrapper program (i.e. c:\program files\myapp\bin if the wrapper is located in C:\program files\myapp\bin\myprog.exe). If path is absolute path then it is okay. How can I fix this to return the actual path from where the launcher is called?
Best Regards,
Ben