public void update () {
        String path = null;
        try {
            path = new File(LaunchFrame.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getCanonicalPath();
            path = URLDecoder.decode(path, "UTF-8");
            Logger.logDebug("Launcher Install path: " + path);//we need this to make sure that the app behaves correctly when updating
        } catch (IOException e) {
            Logger.logError("Couldn't get path to current launcher jar/exe", e);
        }
        String temporaryUpdatePath = OSUtils.getCacheStorageLocation() + File.separator + "updatetemp" + "/" + path.substring(path.lastIndexOf(File.separator) + 1);
        String extension = path.substring(path.lastIndexOf('.') + 1);
        extension = "exe".equalsIgnoreCase(extension) ? extension : "jar";
        try {
            URL updateURL = new URL(!useBeta ? DownloadUtils.getCreeperhostLink(downloadAddress + "." + extension) : betaAddress.replace("${ext}", extension).replace("${jenkins}", Integer.toString(betaJenk)).replace("${version}", betaStr));
            File temporaryUpdate = new File(temporaryUpdatePath);
            temporaryUpdate.getParentFile().mkdir();
            DownloadUtils.downloadToFile(updateURL, temporaryUpdate);//TODO hash check this !!!!
            if(useBeta && betaHash != null){
                String sha = DownloadUtils.fileSHA(temporaryUpdate);
                if(betaHash.contains(sha))
                    SelfUpdate.runUpdate(path, temporaryUpdate.getCanonicalPath());
                else {
                    Logger.logDebug("TempPath" + temporaryUpdatePath);
                    throw new IOException("Update Download failed hash check please try again! -- fileSha " + sha);
                }
            }else{
                SelfUpdate.runUpdate(path, temporaryUpdatePath);
            }
        } catch (Exception e) {
            Logger.logError("Error while updating launcher", e);
        }
    }