Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract ISO #84

Closed
ran-j opened this issue Oct 15, 2020 · 5 comments
Closed

Extract ISO #84

ran-j opened this issue Oct 15, 2020 · 5 comments

Comments

@ran-j
Copy link

ran-j commented Oct 15, 2020

I cant extrat files from an iso file.

const pathTo7zip = sevenBin.path7za
          const myStream = Seven.extract(path.join(directory, file), directory, {
            recursive: true,
            $cherryPick: '*.cnf',
            $bin: pathTo7zip
          })

I got this error:

Uncaught Error: C:\Users\ran-j\ps2Isos\tm.iso
    at Object.fromBuffer (error.js?b1de:30)
    at eval (events.js?f960:25)
    at Socket.eval (lifecycle.js?184a:64)
    at Socket.emit (events.js:223)
    at addChunk (_stream_readable.js:309)
    at readableAddChunk (_stream_readable.js:290)
    at Socket.Readable.push (_stream_readable.js:224)
    at Pipe.onStreamRead (internal/stream_base_commons.js:181)
@ran-j
Copy link
Author

ran-j commented Oct 15, 2020

I'm on windows 10 and running on electron 9.

@q2s2t
Copy link
Owner

q2s2t commented Oct 24, 2020

Hi. I've just tried to replicate the bug, but failed to find it.

// main.js
const Seven = require('node-7z')

const myStream = Seven.extract('debian.iso', 'output', {
    recursive: true,
    $cherryPick: '*.efi',
    $bin: '7z'
})

image

Any luck on your side ?

@ran-j
Copy link
Author

ran-j commented Oct 27, 2020

If do like you it works becouse I already have 7zip installed, but Im using 7zip-bin.

Heres the code :

extractCnf(directory, file) {
				return new Promise((resolve, reject) => {
					this.creteTempFolder()
					let output = path.join(this.dir, file.split(".")[0])
					if (!fs.existsSync(output)) {
						fs.mkdirSync(output);
					}
					const pathTo7zip = sevenBin.path7za
					var myStream = Seven.extract(path.join(directory, file), output, {
						recursive: true,
						$cherryPick: '*.cnf',
						$bin: pathTo7zip,
						$progress: true
					})
					myStream.on('end', function () {
						console.log('done')
						resolve(output)
					})
					myStream.on('error', (err) => {
						console.log(err)
						reject(err)
					})
					myStream.on('progress', function (progress) {
						console.log(progress) // ? { percent: 67, fileCount: 5, file: undefinded }
					})
				})
			}

image

@ran-j
Copy link
Author

ran-j commented Oct 27, 2020

No 7zip-bin :

extractCnf(directory, file) {
				return new Promise((resolve, reject) => {
					this.creteTempFolder()
					let output = path.join(this.dir, file.split(".")[0])
					if (!fs.existsSync(output)) {
						fs.mkdirSync(output);
					}
					const pathTo7zip = sevenBin.path7za
					var myStream = Seven.extract(path.join(directory, file), output, {
						recursive: true,
						$cherryPick: '*.cnf',
						$bin: '7z',
						$progress: true
					})
					myStream.on('end', function () {
						console.log('done')
						resolve(output)
					})
					myStream.on('error', (err) => {
						console.log(err)
						reject(err)
					})
					myStream.on('progress', function (progress) {
						console.log(progress) // ? { percent: 67, fileCount: 5, file: undefinded }
					})
				})
			}

image

@q2s2t
Copy link
Owner

q2s2t commented Nov 14, 2020

7za can't handle ISO files. You must use the full version of 7-Zip 7z

@q2s2t q2s2t closed this as completed Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants