protected void update(final ModModel modModel) throws Exception {
		final IMod mod = modModel.getMod();
		final IUpdate current = modModel.getVersion();
		final IUpdate selected = modModel.getSelectedUpdate();
		final FullVersion v = selected.getVersion();
		out(Localization.translate("UpdaterDialogBase.update.updating",
				mod.getName(), v));
		if (!modModel.isInstalled()) {
			// The mod is not installed.
			out(Localization.translate("UpdaterDialogBase.update.notInstalled"));
			return;
		} else if (current.getVersion().compareTo(v) >= 0) {
			// The update is older than the current version.
			out(Localization.translate("UpdaterDialogBase.update.olderVersion"));
			return;
		}
		// Index of current version.
		final IUpdate[] l = mod.getUpdates();
		int currentIndex = Arrays.binarySearch(l, current);
		// Index of selected version.
		final int selectedIndex = Arrays.binarySearch(l, selected);
		// Get the previous checkpoint before selected version.
		for (int i = selectedIndex; i > currentIndex; --i) {
			final IUpdate t = l[i];
			if (t.isCheckpoint()) {
				// Install the checkpoint.
				mod.install(t, panel);
				// Replace current index a newer version is installed.
				currentIndex = i;
				i = -1;
			}
		}
		if (currentIndex != selectedIndex) {
			// Install not optional versions.
			for (int i = currentIndex + 1, s = selectedIndex - 1; i < s; ++i) {
				final IUpdate t = l[i];
				if (!t.isOptional()) {
					mod.install(t, panel);
				}
			}
			// Install selected version.
			mod.install(selected, panel);
		}
		out(Localization.translate("UpdaterDialogBase.update.updated"));
	}