If your making a game then will it even run on a machine still running Windows 95 or 98; will they even have a recent version of Java installed? I'd presume it's there but fall back onto asking or doing nothing if it's not.
%USERPROFILE% is not localized, it cannot be used but you're right, I'm even not sure it is possible to install Java 1.6 on Windows 95.
What is the likely hood of a pre-Vista Windows user (English or non-English) having a folder called 'Desktop' in their home directory which isn't their desktop? I'd bet it's extremely low. If it's there and you used it then I'd imagine it's the right place 99.9% of the time (although again I'd only do this as a fall back option).
Lots of people still use Windows XP and I have a lot of French users (as I'm French). I suggest using the following algorithm:
- use WScript.SpecialFolders("Desktop") as it is the most reliable and not deprecated way of getting this piece of information since Windows 98
if it does not work
- use the registry method and replace the environment variables by their values (as I did for Linux)
if it does not work
- try to use System.getProperty("user.home")+"\Desktop" as Riven says this directory always exists on Vista and 7
Can I use Runtime.getRuntime().exec() to execute the WShell command lines? What displays WScript.Echo(WScript.SpecialFolders("Desktop")); on your machine?
Edit.: Java 1.6 cannot be installed on Windows 98 but still on Windows 2000.
Edit.2: I will use a simple bash script on Mac as it seems very complicated to create an Alias