public static void main(String[] args) {
		try {
			workDir=new File(ModManager.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath().replace("McLauncher.jar", ""));
			System.out.println("Running McLauncher from " + workDir);
		} catch (URISyntaxException e1) {
			workDir=new File("");
			e1.printStackTrace();
		}
//		try {
//	        // Get a file channel for the file
//			boolean FileNotLocked=false;
//
//	        
//	        try {
//				FileWriter file2 = new FileWriter(System.getProperty("java.io.tmpdir") + "/McLauncher.lock");
//				file2.write("McLauncher lock");
//				file2.close();
//			} catch (IOException e) {
//				FileNotLocked=true;
//			}
//	        
//	        File file = new File(System.getProperty("java.io.tmpdir") + "/McLauncher.lock");
//
//	        FileChannel channel = new RandomAccessFile(file, "rw").getChannel();
//	        if(file.renameTo(file)) FileNotLocked=true;
//	        if(FileNotLocked){
//	        	JOptionPane.showMessageDialog(null, "Already running McLauncher, Only one instance allowed at a time\n"
//						+ "Is this wrong? Delete McLauncher.lock in your temp folder");
//				System.out.println("Already running McLauncher, Only one instance allowed at a time");
//				System.exit(0);
//	        }
//	        lock = channel.lock();
//
//	        try {
//	            lock = channel.tryLock();
//	        } catch (OverlappingFileLockException e) {
//	        }
//	        channel.close();
//	    } catch (Exception e) {
//	    }
		
		//Not added because i do not want to lock people out from using McLauncher if somehow this fails.
//		if(new File(System.getProperty("java.io.tmpdir") + "/McLauncher.lock").exists()){
//			System.exit(0);//close this instance if McLauncher is already running.
//		}
//		try {
//			FileWriter file = new FileWriter(System.getProperty("java.io.tmpdir") + "/McLauncher.lock");
//			file.write("McLauncher one instance lock");
//			file.close();
//		} catch (IOException e) {
//			System.out.println("Severe, failed to create temp lock file");
//		}
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					con = new Console();
					con.setVisible(false);
					Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
				    int x = (int) ((dimension.getWidth() - con.getWidth()) / 2);
				    int y = (int) ((dimension.getHeight() - con.getHeight()) / 2);
				    con.setLocation(x, y);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
		EventQueue.invokeLater(new Runnable() {
			@Override
			public void run() {
				try {
					for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
				        if ("Nimbus".equals(info.getName())) {
				            UIManager.setLookAndFeel(info.getClassName());
				            break;
				        }
				    }
					ModManager frame = new ModManager();
					frame.setResizable(false);
					frame.setVisible(true);
					Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
				    int x = (int) ((dimension.getWidth() - frame.getWidth()) / 2);
				    int y = (int) ((dimension.getHeight() - frame.getHeight()) / 2);
				    frame.setLocation(x, y);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}