PreferenceLoader.setValue("hostname", "localhost");
    private static void launch() {    	/* we are running, so we make this available to other instances */        PreferenceLoader.setValue("running", true);        PreferenceLoader.saveStore();        Object waiterObject = new Object();        myPrefs = new Preferences(PreferenceLoader.getPreferenceStore());        // create our main shell for displaying stuff        shell = new Shell(display);                // should the core be spawned by the gui?        // if yes, set hostname to localhost		boolean runCore = false;		if (!PreferenceLoader.loadString("coreExecutable").equals("") && !PreferenceLoader.isRelaunching()) {			if (debug) System.out.println("Setting hostname=localhost");			runCore = true;			PreferenceLoader.setValue("hostname", "localhost");		}					// create the splash        if (PreferenceLoader.loadBoolean("splashScreen"))            if ( runCore )	            new Splash( display, 7 );	        else	         	new Splash( display, 5 );            // Needed on GTK to dispatch paintEvent.        // SWT is idiotic.        display.update();		// launch the core if requested		if (runCore) {			Splash.increaseSplashBar("launching core");	        spawnCore();		}					Splash.increaseSplashBar("initializing connection");        /* if the gui isnt set up yet launch the preference window */        if (!(PreferenceLoader.getBoolean("initialized"))) {        	PreferenceLoader.setValue("initialized", true);            Splash.setVisible(false);            myPrefs.open(shell, null);            // crashes if you call myPrefs.open again             // if you don't create a new Preferenes() - Why?            // a jface.Wizard would be better            // temporary hack            myPrefs = new Preferences(PreferenceLoader.getPreferenceStore());			Splash.setVisible(true);			display.update();        }                // we're almost done with restarting, so set it to false        PreferenceLoader.setRelaunching(false);                // read parameters from our preferencestore        readParams();        if (debug) System.out.println("Host: " + hostname + ":" + port + " User: " + username);        Socket socket = initializeSocket( false );		if (socket == null ) return;        PreferenceLoader.saveStore();                core = startCore( waiterObject, socket, false );        		// handle some errors the core can cause		// connection denied        if (core.getConnectionDenied()) {        	core.disconnect();        	connectDeniedHandling(); 		// bad password        } else if (core.getBadPassword()) {            core.disconnect();            badPasswordHandling();        // connection is setup successfully        } else {			// launch the view			Splash.increaseSplashBar("connection to core successfully created");            new MainWindow(core, shell);        }        // disconnect the core        core.disconnect();                /*         * we are not running anymore, so we can allow another instance to         * be started         */        PreferenceLoader.setValue("running", false);        /* save our preferences */        PreferenceLoader.saveStore();        if (debug) System.out.println("G2gui shut down.");    }