private static void handleUpdate() {
        final ClientUpdater.Update update = ClientUpdater.getUpdate();
        if (update != null && update.getVersionNum() > Client.VERSION_ID) {
            if (curFile.toString().endsWith(".jar")) {
                final int option = JOptionPane.showConfirmDialog(client, "A new update is available, update now?",
                        "New Update!", JOptionPane.YES_NO_OPTION);

                if (option == JOptionPane.YES_OPTION) {
                    try {
                        client.close();
                        final File destination = update.getDestination(curFile);

                        if (ClientUpdater.download(destination, update.getUrl())) {
                            Runtime.getRuntime().exec("java -jar " + destination.toString());

                            if (!curFile.equals(destination) && !curFile.delete()) {
                                throw new RuntimeException("Could not delete original file: " + curFile.toString());
                            }
                            System.exit(0);
                        } else {
                            JOptionPane.showMessageDialog(null, "New Update could not be installed!",
                                    "Update Failed!", JOptionPane.OK_OPTION);
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            } else {
                JOptionPane.showMessageDialog(client, "A new version is available, please update your sources.",
                        "New Update!", JOptionPane.OK_OPTION);
            }
        }
    }