-
Notifications
You must be signed in to change notification settings - Fork 152
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
How difficult it is to make appdmg cross-platform? #14
Comments
Information regarding the Roadmap:
We use
We need to be able to create a dmg file from a folder, this shouldn't be too hard.
We use the
This is, AFAIT, the hardest part. Right now we use apple script to open up the finder, rearrange the icons and set the background. Then sleep for some seconds which makes Finder save the changes to the The best way to do this would is writing the file directly from the program, but we need to figure out how the file format works and what bits and bytes we need to set in order to accomplish the following:
|
I'm going to start investigating |
I don't know if When I read about DMG images themselves it looks like more of a hedache http://newosxbook.com/DMG.html |
Ohh, I actually thought that dmg images was just a raw binary file with a file system... I have some reading up to do :) |
The This is the output on a clean folder with only the
This project might have some relevant info as well: https://code.google.com/p/profuse/wiki/XattrUtility |
Fun fun fun, I think I actually have a way to do
|
Okay, so I don't know why this works (in that I don't know what the different bits mean) but this should create a buffer that can be written to the var buf = new Buffer(32);
buf.fill(0);
buf.writeUInt8(4, 8);
return buf.toString('binary'); |
Seems like most of the things we need for
This seems easy! 🍻 |
I tried looking at the
|
I have now stopped using |
The FinderInfo data is documented (see the man page for getattrlist on a Mac OS X system), so there’s really no need to guess at its contents. FWIW, I’ve already got portable Python code for reading/writing/editing There’s also my dmgbuild tool, which is based on the above; that currently uses |
Cool, I'm gonna have a look when I have time and updated my code. Had a quick look at your documentation, it seems to be well done, keep up the good work! Feel free to contact me at any time if you need any help or want to discuss some file format :) |
This would be unbelievable! |
For hdutil replacement, maybe hfsutils can do the job. hfsutils is licensed under GPLv2 license and seems to have ports for windows: |
There is also https://github.com/planetbeing/libdmg-hfsplus which supports HFS+ It seems to be buildable for both linux and windows: https://github.com/planetbeing/libdmg-hfsplus/blob/master/CMakeLists.txt |
+1 |
You can also create a dmg (uncompressed tough) on linux, with an iso9660/udf hybrid filesystem, with the command:
|
@guidograzioli There’s nothing special about uncompressed DMGs — they’re just raw disk image files, so you can equally create one using It’s also worth pointing out that the Mac is able to handle a number of filesystems, besides HFS+, out of the box, including FAT, NTFS (read-only) and ExFAT as well as a variant of UFS. There’s nothing stopping you from creating DMGs using those filesystems; modern Mac software doesn’t really use many of the special features of HFS+ anyway, and most users won’t notice and don’t care anyway, so you won’t be losing much by doing that, and no need for an HFS driver. |
I managed to build a working dmg under Linux, using genisoimage and the dmg tool from this repo to compress it (its image building doesn't work, but compresses fine). Turned out since OS X and Linux are both unix based, you only need to have in the root a hidden .background folder with background.png in it for the image, the said .DS_Store with the background specified (which I built on a real OS X in order to use it), a .VolumeIcon.icns holding the icons and a normal symlink called Applications to /Applications. And of course the .app folder. Something like this:
Then I used genisoimage like this (where image/ is the dmg root above):
And dmg like this:
However afterwards I've hit another roadblock - codesign, so I moved my build to an OS X machine. :( I hope this helps. |
@bundyo The |
@LinusU It’s better to use a symlink rather than an alias for |
Thanks. @LinusU I basically did the same the first time, though with GHex :) |
Is there an alternative to codesign, aside from ldid, which AFAIK doesn't work on Linux or for OS X apps? |
Dropping You can use fs-extra's |
No problem, thank you. I'll have a look this weekend |
@LinusU , what is missing for cross platform support? |
I think that should be it, there was some work by someone working on packaging electron apps. I think that they had solved it. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Is there a way to not throw an error on npm install so as to be able to build our apps on CI environments which typically use ubuntu? No appdmg method will be called on those environments. What do you do today to test your apps that require appdmg? |
@thanpolas add it to "optionalDependencies": {
"appdmg": "^0.3.5"
} |
@jakubzitny doesn't work if you shrinkwrap :( npm/npm#2679 |
@thanpolas maybe a bit late, but what I did was to put appdmg as an optional dependency. it now looks like "devDependencies": {
// ...
},
"optionalDependencies": {
"appdmg": "^0.3.5"
},
"dependencies": {
// ...
} |
@LinusU What's the current status of this? Is electron-userland/electron-builder#14 did help in any way? |
@lyssdod You can sign app only on macOS. And unsigned app is blocked. So, for what you need to build DMG? |
@develar I'm trying to setup a multiplatform build via Jenkins using electron-builder. I also have a spare mac which can be used for signing. Would it be simpler to build mac version on mac? |
@lyssdod Please see https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build
Will be simpler and more robust :) Yes, for example, in my company we do use separate servers to sign products, but only due to security reasons. So, I suggest just use mac to build version for mac. Or use Travis/CircleCI. |
@develar Thanks! |
@gbaumgart ...and then your app will be blocked in any case because unsigned ;) If you can use unsigned app (i.e. it is ok for your users) — well, just use |
By the way, we have the source code for https://opensource.apple.com/source/bless/bless-105/ Thus, if there are any doubts about the functionality of |
I wonder if isign might be the missing peice of the puzzle here, to replace codesign. |
This comment has been minimized.
This comment has been minimized.
case of dmg for OSX, I have made dmg file generator server in linux system and serve this dmg file to client. according to previous comment, I used genisoimage, libdmg that is modified by me, ds-store npm that is modified by me. use theses things, you can make dmg is compressed and designed in linux system. hmm, windows system have some file system problem. |
You can build dmg on Deb/Ubuntu via: sudo apt install hfsprogs
dd if=/dev/zero of=./$name.dmg bs=1M count=16 status=progress
mkfs.hfsplus -v Install ./$name.dmg Does this help? Source: https://askubuntu.com/questions/1117461/how-do-i-create-a-dmg-file-on-linux-ubuntu-for-macos |
Hello again.
This lib could be intergallactically awesome if dependent only on pure-js node libraries, so it can run on every OS node is running on. How difficult it is to make it this way?
You mentioned previously building
.DS_Dtore
.What are the other problems to address?
If this is relatively easy I might be interested in contributing to this effort.
The text was updated successfully, but these errors were encountered: