@Override
    protected Void doInBackground() throws Exception {
        File destDirectory = new File(ConfigManager.getInstance().pathToJar);
        if (!destDirectory.exists()) {
            destDirectory.mkdirs();
        }
        try (ZipInputStream zipIn = new ZipInputStream(new FileInputStream(pack))) {
            ZipEntry entry = zipIn.getNextEntry();
            
            // iterates over entries in the zip file
            while (entry != null) { 
                String filePath = destDirectory + File.separator + entry.getName();
                if (!entry.isDirectory()) {
                    this.currentFile = entry.getName();
                    publish(new ExtractState(this.currentFile, this.totalFiles, this.filesDone++));
                    
                    // if the entry is a file, extracts it
                    extractFile(zipIn, filePath);
                } else {                   
                    // if the entry is a directory, make the directory
                    File dir = new File(filePath);
                    dir.mkdirs();
                    
                    this.currentFile = "creating dir: " + dir.getName();
                    publish(new ExtractState(this.currentFile, this.totalFiles, ++this.filesDone));
                }
                
                zipIn.closeEntry();
                entry = zipIn.getNextEntry();
            }
        }
        
        publish(new ExtractState(this.currentFile, this.totalFiles, this.totalFiles));
        
        return null;
    }