LinusU / node-appdmg

💾 Generate your app dmgs
MIT License
1.67k stars 149 forks source link

Command failed: hdiutil convert #139

Open michaelmou opened 7 years ago

michaelmou commented 7 years ago

[ 1/20] Looking for target... [ OK ] [ 2/20] Reading JSON Specification... [ OK ] [ 3/20] Parsing JSON Specification... [ OK ] [ 4/20] Validating JSON Specification... [ OK ] [ 5/20] Looking for files... [ OK ] [ 6/20] Calculating size of image... [ OK ] [ 7/20] Creating temporary image... [ OK ] [ 8/20] Mounting temporary image... [ OK ] [ 9/20] Making hidden background folder... [ OK ] [10/20] Copying background... [ OK ] [11/20] Reading background dimensions... [ OK ] [12/20] Copying icon... [ OK ] [13/20] Setting icon... [ OK ] [14/20] Creating links... [ OK ] [15/20] Copying files... [ OK ] [16/20] Making all the visuals... [ OK ] [17/20] Blessing image... [ OK ] [18/20] Unmounting temporary image... [ OK ] [19/20] Finalizing image... [FAIL] [20/20] Removing temporary image... [ OK ]

Error: Command failed: hdiutil convert /var/folders/gq/6l_r12q14nx5r0qrg_xqtv680000gn/T/57FGT6R.dmg -format UDZO -imagekey zlib-level=9 -o /Users/ci/Desktop/MacKugouTest/kugou_mac/dmgExport/xxxx.dmg

hdiutil: convert failed - 无效的自变量 正在准备映像引擎… 正在读取Protective Master Boot Record(MBR:0)…

michaelmou commented 7 years ago

hdiutil: convert failed - Invalid argument Preparing imaging engine… Reading Protective Master Boot Record (MBR : 0)…

at ChildProcess.exithandler (child_process.js:205:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

Error: Command failed: hdiutil convert /var/folders/fz/ky985bpj56l59kz3p5t89g940000gn/T/WEQDP08.dmg -format UDZO -imagekey zlib-level=9 -o /Users/kugou_mac_dev/Documents/workspace/KugouMac/dmgExport/酷狗音乐.dmg

hdiutil: convert failed - Invalid argument Preparing imaging engine… Reading Protective Master Boot Record (MBR : 0)…

LinusU commented 7 years ago

Hmm, I wonder if maybe hdiutil doesn't like 酷狗音乐 in the filename, could you try naming it something else, using only ascii characters, and see if that works?

michaelmou commented 7 years ago

rm: /Users/michaelmo/Documents/WorkSpace/Project/mac_lib/dmgExport/dmgName.dmg: No such file or directory [ 1/20] Looking for target... [ OK ] [ 2/20] Reading JSON Specification... [ OK ] [ 3/20] Parsing JSON Specification... [ OK ] [ 4/20] Validating JSON Specification... [ OK ] [ 5/20] Looking for files... [ OK ] [ 6/20] Calculating size of image... [ OK ] [ 7/20] Creating temporary image... [ OK ] [ 8/20] Mounting temporary image... [ OK ] [ 9/20] Making hidden background folder... [ OK ] [10/20] Copying background... [ OK ] [11/20] Reading background dimensions... [ OK ] [12/20] Copying icon... [ OK ] [13/20] Setting icon... [ OK ] [14/20] Creating links... [ OK ] [15/20] Copying files... [ OK ] [16/20] Making all the visuals... [ OK ] [17/20] Blessing image... [ OK ] [18/20] Unmounting temporary image... [ OK ] [19/20] Finalizing image... [FAIL] [20/20] Removing temporary image... [ OK ]

Error: Command failed: hdiutil convert /var/folders/lq/qd446rws43q61zm8yn8vb3_h0000gn/T/HVDB27R.dmg -format UDZO -imagekey zlib-level=9 -o /Users/michaelmo/Documents/WorkSpace/Project/mac_lib/dmgExport/dmgName.dmg

hdiutil: convert failed - 无效的自变量 正在准备映像引擎… 正在读取Protective Master Boot Record(MBR:0)…

michaelmou commented 7 years ago

the same...

michaelmou commented 7 years ago

I can run it perfectly by run "appdmg xxx" separately , not use shell script.And this it the question

michaelmou commented 7 years ago

What 's different between them ??

michaelmou commented 7 years ago

MichaelMos-iMac:mac_lib michaelmo$ appdmg /Users/michaelmo/Documents/WorkSpace/Project/mac_lib/dmg/appdmg.json s.dmg [ 1/20] Looking for target... [ OK ] [ 2/20] Reading JSON Specification... [ OK ] [ 3/20] Parsing JSON Specification... [ OK ] [ 4/20] Validating JSON Specification... [ OK ] [ 5/20] Looking for files... [ OK ] [ 6/20] Calculating size of image... [ OK ] [ 7/20] Creating temporary image... [ OK ] [ 8/20] Mounting temporary image... [ OK ] [ 9/20] Making hidden background folder... [ OK ] [10/20] Copying background... [ OK ] [11/20] Reading background dimensions... [ OK ] [12/20] Copying icon... [ OK ] [13/20] Setting icon... [ OK ] [14/20] Creating links... [ OK ] [15/20] Copying files... [ OK ] [16/20] Making all the visuals... [ OK ] [17/20] Blessing image... [ OK ] [18/20] Unmounting temporary image... [ OK ] [19/20] Finalizing image... [ OK ] [20/20] Removing temporary image... [ OK ]

Your image is ready: s.dmg

drjasonharrison commented 7 years ago

I'm having a similar problem, however I'm using all ascii characters, with no spaces in the filenames. I can see the .dmg created in /var/folders and then deleted. Is there a way to halt the progress before step 19/20?

[1/20] Looking for target [ok] [2/20] Reading JSON Specification [skip] [3/20] Parsing JSON Specification [skip] [4/20] Validating JSON Specification [ok] [5/20] Looking for files [ok] [6/20] Calculating size of image [ok] [7/20] Creating temporary image [ok] [8/20] Mounting temporary image [ok] [9/20] Making hidden background folder [ok] [10/20] Copying background [skip] [11/20] Reading background dimensions [skip] [12/20] Copying icon [ok] [13/20] Setting icon [ok] [14/20] Creating links [ok] [15/20] Copying files [ok] [16/20] Making all the visuals [ok] [17/20] Blessing image [ok] [18/20] Unmounting temporary image [ok] [19/20] Finalizing image [error] [20/20] Removing temporary image [ok] error: Error: Command failed: hdiutil convert /var/folders/bm/xkpm676919ngrp_rwqdyl1jw0000gq/T/PJK5ZER.dmg -format UDZO -imagekey zlib-level=9 -o /Users/jameshar/Intel/Code/novel/build/../dist/installerdarwin/novel.dmg

hdiutil: convert failed - Invalid argument Preparing imaging engine… Reading Protective Master Boot Record (MBR : 0)…

elissa-ross commented 7 years ago

I suddenly started having this problem too. The fix for me was to change where I was trying to put the generated dmg. I was originally generating it on the desktop, which failed exactly as described about. However, when I did the following it worked:

appdmg myApp.json myApp.dmg

oxguy3 commented 6 years ago

I'm having this issue as well, using create-dmg (a tool that wraps appdmg):

$ create-dmg Subtitle\ Edit\ Launcher.app
✖ Error: Command failed: hdiutil convert /var/folders/s2/dvvmm0cj7jsbzdm_7z2hf58c0000gn/T/6HV25A0.dmg -format ULFO -imagekey zlib-level=9 -o Subtitle-Edit-Launcher-1.0.dmg

Usage:  hdiutil convert -format <format> -o <outfile> [options] <image>
    hdiutil convert -help

None of the fixes/workarounds described here have worked for me. I even tried running chmod -R 777 . in the directory I'm trying to build the DMG in, to no avail. My app has no weird characters, it's just "Subtitle Edit Launcher.app". FYI, I'm on OS X 10.10.5, and you can find the json that create-dmg passes to appdmg over here.

Blatman commented 6 years ago

FWIW I started getting this after it had been working fine and thinking that it may have been related to relative paths I used full paths but in the end it was an incorrect path that I had specified - so if the path specified doesn't exist an Invalid Argument error will occur. This may account for some occasions when this error is encountered.

iAnish commented 6 years ago

I had the exact same issue. my output directory parameter was "osx" and it was non-existant. After I created that directory and rerun the commands, the dmg was created without issues

Note: I was ran into this issue while trying to create a electronjs based app mac installer