LinusU / node-appdmg

💾 Generate your app dmgs
MIT License
1.68k stars 152 forks source link

Option to hide extension of a file #96

Closed sindresorhus closed 8 years ago

sindresorhus commented 8 years ago

I have Show all filename extensions set in the Finder preferences. Would be nice if the file extensions could be forcefully hidden in the DMG.

Seems to be possible as create-dmg has an option for it:

--hide-extension [file name]: hide the extension of file

cstruct commented 8 years ago

That option does not work on OS X 10.11.4.

create-dmg uses set extension hidden from AppleScript which does not work. SetFile -a E <file> from SetFile(1) does not seem to do the trick either.

Closing this. I can reopen if you have any other idea how to implement this.

sindresorhus commented 8 years ago

I think I have an idea for this. According to https://github.com/LinusU/node-appdmg/pull/67, it's possible to set a custom title, since it's symlinked, so couldn't we just remove the extension from the title if this option is set?

cstruct commented 8 years ago

Did some testing and that seems like a viable solution.

Reopening.

LinusU commented 8 years ago

I don't understand, #67 only modifies the name of the file inside the image. If we remove the extension from that, we'll also remove the extension from the actual file, potentially rendering it broken?

cstruct commented 8 years ago

I think I jumped the gun here. Did some more testing, removing the .app extension makes it a normal folder, all application semantics are lost.

LinusU commented 8 years ago

This is actually a duplicate of #36 which also got closed without a solution...

Closing this for now, but I'll be happy to reopen if any solution comes to light 👌

sindresorhus commented 8 years ago

Oh right. I was thinking aliases, but you're right, will not work with symlinks...

LinusU commented 8 years ago

@sindresorhus Actually, which part is it that you wan't to hide? The .app on the actual app that's included?

I'm open to switching between symlinks and aliases

sindresorhus commented 8 years ago

The .app on the actual app that's included?

Yes

I'm open to switching between symlinks and aliases

I wouldn't use aliases as they add an alias badge on the icon.

LinusU commented 8 years ago

The app is neither a symlink nor an alias though, it's just a folder with the .app extension, so switching between them wouldn't help anything...

I wouldn't use aliases as they add an alias badge on the icon.

👍