Geez we need real example here!
My NSIS install builder for Windows
Mac and Linux versions are obviously just a case of take a peek and change what you will. I may actually get around to compiling the launcher for those two OSes as well but… meh.
Cas
So the exe needs to be compiled? :’(
Well, yeah, but you can do it with free tools, obviously.
Cas
To make sure it,
Windows target can be targeted with launch4j running on all OS (not counting Solaris or Haiku :P)
I’m surprised not to see zeroing out of environment variables.
How does one do that?
Cas
Under windows if you want to nuke all (to be sure none will effect HotSpot) GetEnvironmentStrings returns a list of all. Then SetEnvironmentVariable to clear.
I would be interested too in how to make mac and linux deployments.
like I have a structure, a private jre, a shell script or whatever and I want to make a DMG on mac / app whatever
and on linux, to me personally, a .deb would be the greatest - with dependencies… then maybe you can even leave out the jre
so:
- How to make a DMG / APP on mac
- how to make a .deb
On windows I personally dont use launchj4, I always had problems, I export using Eclipse, create a batch which uses my private jre and calls my game and then use a batch to exe tool - and lastly NSIS for installer
Doh! I searched high and low on the internet for something to do exactly this, but failed. The answer is of course completely obvious now you point it out. Thanks! I’m going to update my code asap. There are a bunch of annoying crazy bugs caused by this.
Cas
I guess for completeness, for POSIX systems you have ‘environ’ to get the list (also available as third parameter to main) and ‘unsetenv’. (unistd.h maybe…too lazy to reboot or fire up VirtualBox). I have touched a mac in a bagillion years, but it should be similar.
What would it fix?
If you’re asking about clearing environment variables, then HotSpot can be configured by various environment variables which could cause the game to explode or not behave as expected and would be a real nightmare to track down these kinds of “bugs”.
…exactly what happens to us I’m slightly wary of nulling ALL the environment variables out though… are there any known gotchas?
Cas
Environment variables are per process where they are copied from the parent, so no it only effects the game’s process. zeroing out JAVA_HOME and JAVA_TOOL_OPTIONS is probably more than sufficient however.
FOLLOW-UP: It just occurred to me that it’s pretty possible that examining environment variables only occurs inside the default launcher which would make all of this moot.
It seems to occur from my embedded stuff as well, so far as I can guess (it’s very hard to pinpoint)
Cas
Been meaning to write this up for months so this was the final nudge ;D This is how Praxis LIVE is packaged as a .deb - http://praxisintermedia.wordpress.com/2013/03/28/packaging-as-a-deb/ It’s for a NetBeans platform application, but should be dead easy to adapt if you’ve got a shell script to launch from.
We ditched .debs.
Cas
Reasoning? In favour of what?