Closed anm43 closed 11 years ago
Best way I can think of for now is the following:
import org.boris.winrun4j.Native;
public class WinRun4JTest
{
public static boolean isRunningInLauncher() {
try {
Native.loadLibrary("kernel32");
return true;
} catch(Throwable t) {
return false;
}
}
public static void main(String[] args) throws Exception {
System.out.println(isRunningInLauncher());
}
}
thank you for the fast answer. It works. I find it kind of "heavy". It would be nice to have an FAQ and this question in my opinion belongs there. I would suggest setting a property like "winrun4j" to "true" that could be later read using System.getProperty()
Agreed. You could always set it in your INI file:
vmarg.1=-Dwinrun4j=true
How can I detect from a running program whether it is run via WinRun4j or not?