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

Error in dmg -> "internetEnabled": true -> verb not recognized hdiutil internet-enable -quiet verb not recognized #4405

Closed
sergeyd63 opened this issue Nov 8, 2019 · 8 comments · Fixed by #4531

Comments

@sergeyd63
Copy link

sergeyd63 commented Nov 8, 2019

The entire process works fine (signing, notarizing, building....) with internetEnabled: false
Once i change it to true (for it to unmount the image after install) i get that error

  • Version: 22.1.0
  • Target: dmg

Exit code: 1. Command failed: hdiutil internet-enable -quiet
hdiutil: internet-enable: verb not recognized

@kzimny
Copy link

kzimny commented Nov 10, 2019

How do you pass the option internetEnabled: false? No such command found in documentation https://www.electron.build/cli

@sergeyd63
Copy link
Author

As it shown here:
https://www.electron.build/configuration/dmg

@gergof
Copy link

gergof commented Nov 19, 2019

This started to affect us as well.

We upgraded to MacOS Catalina on our builder and it appears that they removed the internet-enable verb from hdiutil.

The build log:

Copying native dependencies package
  • electron-builder  version=21.2.0
  • loaded configuration  file=/XXX/electron-builder.json
  • installing production dependencies  platform=darwin arch=x64 appDir=/XXX/build/electron
Build started at  2:45:51
  • electron-builder  version=21.2.0 os=19.0.0
  • loaded configuration  file=/XXX/electron-builder.json
  • rebuilding native dependencies  dependencies=desktop-idle@1.1.2 platform=darwin arch=x64
  • packaging       platform=darwin arch=x64 electron=7.1.1 appOutDir=build/installers/mac
Skipping afterPack hook on non-Linux platforms
  • signing         file=build/installers/mac/XXX.app identityName=X identityHash=X provisioningProfile=none
AfterSignHook triggered
Notarizing XXX found at /XXX.app
Done notarizing XXX
  • building        target=macOS zip arch=x64 file=build/installers/XXX.zip
  • building        target=DMG arch=x64 file=build/installers/XXX.dmg
  • building embedded block map  file=build/installers/XXX.zip
error: Error: Exit code: 1. Command failed: hdiutil internet-enable -quiet /XXX/build/installers/XXX.dmg
hdiutil: internet-enable: verb not recognized
Usage: hdiutil <verb> <options>
<verb> is one of the following:
help
attach
detach
eject
verify
create
compact
convert
burn
info
checksum
chpass
erasekeys
unflatten
flatten
imageinfo
isencrypted
makehybrid
mount
mountvol
unmount
plugins
resize
segment
pmap
udifderez
udifrez

hdiutil: internet-enable: verb not recognized
Usage: hdiutil <verb> <options>
<verb> is one of the following:
help
attach
detach
eject
verify
create
compact
convert
burn
info
checksum
chpass
erasekeys
unflatten
flatten
imageinfo
isencrypted
makehybrid
mount
mountvol
unmount
plugins
resize
segment
pmap
udifderez
udifrez

The relevant part of configuration:

{
	"dmg": {
		"background": "electron-resources/dmg_background.tiff",
		"iconTextSize": 14,
		"iconSize": 100,
		"contents": [
			{
				"x": 130,
				"y": 200
			},
			{
				"x": 410,
				"y": 200,
				"type": "link",
				"path": "/Applications"
			}
		],
		"internetEnabled": true
	},
	"mac": {
		"category": "public.app-category.productivity",
		"icon": "electron-resources/icons/mac/icon.icns",
		"artifactName": "${name}-${version}.${ext}",
		"hardenedRuntime": true,
		"entitlements": "electron-resources/entitlements.mac.plist",
		"extendInfo": {
			"NSAppTransportSecurity": {
				"NSAllowsArbitraryLoads": true
			}
		}
	}
}

@migliorinie
Copy link
Contributor

I too have the exact same problem when building for Mac OS (Catalina).
I'm using electron 7.1.2 and electron-builder 22.2.0.

@migliorinie
Copy link
Contributor

migliorinie commented Dec 11, 2019

I actually managed to find a quick and ugly fix: removing lines 162-164 from node_modules/dmg-builder/out/dmg.js

if (this.options.internetEnabled {
    await (0, _builderUtil().exec)("hdiutil", addLogLevel(["internet-enable"]).concat(artifactPath));
}

makes the error disappear.
If whoever maintains dmg-builder could give a look, it would be highly appreciated.

@sergeyd63
Copy link
Author

thanks @migliorinie
does it unmount the disk image after install once you make that change?

@migliorinie
Copy link
Contributor

migliorinie commented Dec 12, 2019

@sergeyd63 No, apparently that function has been eliminated from hdiutil on the update to Catalina.
There has been no deprecation warning or any official word from Apple.

EDIT: I re-read my package.json file, and I noticed that I had set the internetEnabled flag to true. It's likely that just setting it to false when building on Catalina would be enough to remove the bug, although of course they still won't be internet enabled, unless you downgrade your OS.

@sergeyd63
Copy link
Author

@migliorinie i know that setting it to false eliminates the exception
but, is there another, working, way to auto unmount a disk image after install?

develar pushed a commit that referenced this issue Jan 16, 2020
* fix(mac): remove internet-enable from macOS 10.15 (#4405)

Prevent the internet-verb from being used with hdiutil on macOS 10.15
"Catalina" or newer, since it was removed

Fixes #4405

* fix: add radix to parseInt
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

Successfully merging a pull request may close this issue.

4 participants