public Server() throws IOException
	{
		// ======== INITIALIZATION ======== //
		try {
			if( Settings.OS == Settings.OS_ENUM.WINDOWS )
				Settings.loadLibrary("DLLInterface" + System.getProperty("sun.arch.data.model") + ".dll");
		} catch (UnsatisfiedLinkError e) {
			// If we can't find the dll then don't error
		} catch (Exception e) {
			trace(STDERR, e);
			BugReportUtils.showBugReportDialog(e);
		}

		Settings.canQuit = false;
		if( !Settings.hasUniqueID() ) {
			Settings.UNIQUE_ID = IdentityUtils.createID();
			traceln(STDOUT, INFO, "Generated new UniqueID: " + Settings.UNIQUE_ID);
			Settings.save();
		}
		Settings.canQuit = true;
		
		TrayManager.initializeTray(this);
		ConfigManager.getConfigManager().initializeConfigs();
		

		// ======== STRUCTURING ========= //
		setSize(600, 450);
		setResizable(false);
		setLayout(null);
		setTitle(Settings.SERVER_TITLE);
		setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		setLocation(screen.width/2 - getWidth()/2, screen.height/2 - getHeight()/2);
		setIconImage(ImageIO.read(ResourceManager.ICON_TRAY_LOGO));
		

		// ======== CREATE LEFT PANEL ======== //
		leftPanel = new SetupPanel();
		leftPanel.setLayout(null);
		leftPanel.setBounds(0, 0, SetupPanel.LEFT_PANEL_WIDTH, SetupPanel.LEFT_PANEL_HEIGHT);
		leftPanel.setBackground(new Color(0xEEEEEE));
		leftPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, Color.black));

		BufferedImage wvaLogo = ImageUtils.fit(ImageIO.read(ResourceManager.IMAGE_W_LOGO), 125, 65);
		JLabel wvaLabel = new JLabel("", new ImageIcon(wvaLogo), JLabel.CENTER);
		wvaLabel.setBounds(10, 10, 125, 65);
		leftPanel.add(wvaLabel);
		
		serverCheckbox = new CustomCheckbox("Select Server");
		serverCheckbox.setBounds(10, 120, 125, 25);
		serverCheckbox.setBackground(leftPanel.getBackground());
		serverCheckbox.setSelected(false);
		serverCheckbox.setVisible(!Settings.SETUP_COMPLETE);
		serverCheckbox.setToolTipText("Select the application server");
		leftPanel.add(serverCheckbox);
		
		databaseCheckbox = new CustomCheckbox("Select Database");
		databaseCheckbox.setBounds(10, 150, 125, 25);
		databaseCheckbox.setBackground(new Color(0xEE, 0xEE, 0xEE, 125));
		databaseCheckbox.setOpaque(false);
		databaseCheckbox.setSelected(false);
		databaseCheckbox.setVisible(!Settings.SETUP_COMPLETE);
		databaseCheckbox.setToolTipText("Select the database server.");
		leftPanel.add(databaseCheckbox);

		installCheckbox = new CustomCheckbox("Install Weave");
		installCheckbox.setBounds(10, 180, 125, 25);
		installCheckbox.setBackground(leftPanel.getBackground());
		installCheckbox.setSelected(false);
		installCheckbox.setVisible(!Settings.SETUP_COMPLETE);
		installCheckbox.setToolTipText("Click Install on the Weave tab.");
		leftPanel.add(installCheckbox);
		
		configCheckbox = new CustomCheckbox("Configure");
		configCheckbox.setBounds(10, 210, 125, 25);
		configCheckbox.setBackground(leftPanel.getBackground());
		configCheckbox.setSelected(false);
		configCheckbox.setVisible(!Settings.SETUP_COMPLETE);
		configCheckbox.setToolTipText("<html>Open the Admin Console on the Sessions tab.<br>Configure Weave for first time use.</html>");
		leftPanel.add(configCheckbox);
		
		final JLabel iweaveLink = new JLabel(Settings.IWEAVE_HOST);
		iweaveLink.setBounds(30, SetupPanel.LEFT_PANEL_HEIGHT - 30, 125, 20);
		iweaveLink.setCursor(new Cursor(Cursor.HAND_CURSOR));
		iweaveLink.setFont(new Font(Settings.FONT, Font.PLAIN, 15));
		iweaveLink.addMouseListener(new MouseListener() {
			@Override public void mouseReleased(MouseEvent e) {}
			@Override public void mousePressed(MouseEvent e) {}
			@Override public void mouseExited(MouseEvent e) {}
			@Override public void mouseEntered(MouseEvent e) {}
			@Override public void mouseClicked(MouseEvent e) {
				try {
					LaunchUtils.browse(Settings.IWEAVE_URL);
				} catch (Exception ex) {
					trace(STDERR, ex);
					BugReportUtils.showBugReportDialog(ex);
				}
			}
		});

		leftPanel.add(iweaveLink);
		leftPanel.setVisible(false);
		add(leftPanel);
		
		
		
		// ======== CREATE BOTTOM PANEL ======== //
		bottomPanel = new SetupPanel();
		bottomPanel.setLayout(null);
		bottomPanel.setBounds(0, SetupPanel.LEFT_PANEL_HEIGHT, SetupPanel.BOTTOM_PANEL_WIDTH, SetupPanel.BOTTOM_PANEL_HEIGHT);
		bottomPanel.setBackground(new Color(0x507AAA));
		bottomPanel.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, Color.black));
		//////////////////////////////////////////////////////////////////////////////////
		configureButton = new JButton("Configure");
		configureButton.setBounds(150, 10, 120, 30);
		configureButton.setOpaque(true);
		configureButton.setBackground(new Color(0x507AAA));
		configureButton.setToolTipText("Edit configuration settings");
		configureButton.setVisible(false);
		//////////////////////////////////////////////////////////////////////////////////
		backButton = new JButton("< Back");
		backButton.setBounds(260, 10, 100, 30);
		backButton.setOpaque(true);
		backButton.setBackground(new Color(0x507AAA));
		//////////////////////////////////////////////////////////////////////////////////
		nextButton = new JButton("Next >") ;
		nextButton.setBounds(360, 10, 100, 30);
		nextButton.setOpaque(true);
		nextButton.setBackground(new Color(0x507AAA));
		//////////////////////////////////////////////////////////////////////////////////
		helpButton = new JButton("Help");
		helpButton.setBounds(10, 10, 100, 30);				// 10, 13, 80, 25
		helpButton.setOpaque(true);
		helpButton.setBackground(new Color(0x507AAA));
		helpButton.setToolTipText("Open wiki page for help");
		helpButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				try {
					LaunchUtils.browse(Settings.WIKI_HELP_PAGE);
				} catch (Exception e) {
					trace(STDERR, e);
					BugReportUtils.showBugReportDialog(e);
				}
			}
		});
		helpButton.setVisible(true);
		//////////////////////////////////////////////////////////////////////////////////
		cancelButton = new JButton("Close");
		cancelButton.setBounds(480, 10, 100, 30);				// 400, 13, 80, 25
		cancelButton.setBackground(new Color(0x507AAA));
		cancelButton.setToolTipText("Close the " + Settings.SERVER_NAME);
		cancelButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				int response = JOptionPane.showConfirmDialog(null, "Are you sure you want to quit?", "Quit", JOptionPane.YES_NO_OPTION ) ;
				if( response == JOptionPane.YES_OPTION ){
					System.gc();
					Settings.shutdown();
				}
			}
		});
		//////////////////////////////////////////////////////////////////////////////////
		bottomPanel.add(helpButton);
		bottomPanel.add(configureButton);
		bottomPanel.add(backButton);
		bottomPanel.add(cancelButton);
		bottomPanel.add(nextButton);
		add(bottomPanel);
		
		
		
		// ======== CREATE RIGHT PANEL ======== //
		rightPanel = new SetupPanel();
		rightPanel.setLayout(null);
		rightPanel.setBounds(SetupPanel.LEFT_PANEL_WIDTH, 0, SetupPanel.RIGHT_PANEL_WIDTH, SetupPanel.RIGHT_PANEL_HEIGHT);
		rightPanel.setBackground(new Color(0xFFFFFF));
		rightPanel.setVisible(false);
		add(rightPanel);

		
		
		// ======== FINISHING TOUCHES ======== //
		rightPanel.requestFocus();
		rightPanel.setVisible( true );
		bottomPanel.setVisible( true );
		leftPanel.setVisible( true );

		setVisible(true);
		if( !Settings.isOfflineMode() )
			startTimers();
		else
			setTitle(getTitle() + " [OFFLINE MODE]");
		
		// Listen for network socket requests
		Settings.startListenerServer();
		
		// Delay renaming in case updater is still open.
		new Timer().schedule(new TimerTask() {
			@Override
			public void run() {
				try {
					traceln(STDOUT, WARN, StringUtils.rpad("Updating " + Settings.UPDATER_NEW_JAR, ".", Settings.LOG_PADDING_LENGTH));
					updateToNewUpdater();
					Settings.setDirectoryPermissions();
					put(STDOUT, "DONE");
				} catch (Exception e) {
					trace(STDERR, e);
					BugReportUtils.showBugReportDialog(e);
					put(STDOUT, "FAILED (" + getSimpleClassAndMsg(e) + ")");
				}
			}
		}, 5000);
		
		switchToWelcomeSetupPanels(rightPanel);
	}