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

Drop apple-script #18

Closed
LinusU opened this issue Dec 4, 2013 · 19 comments
Closed

Drop apple-script #18

LinusU opened this issue Dec 4, 2013 · 19 comments

Comments

@LinusU
Copy link
Owner

LinusU commented Dec 4, 2013

See comments in #14

@szwacz
Copy link
Contributor

szwacz commented Dec 5, 2013

Hello. But did you find way to do that? It appeared to me that it means writing DMG implementation from scratch in node.

@LinusU
Copy link
Owner Author

LinusU commented Dec 5, 2013

I sort of did, the only thing that apple script is used for is to write the .DS_Store file. The format seems to be enough reverse engineered for us to write our own files.

So what is really needed is a function that takes icon positions and window size and returns a Buffer that can be written to a .DS_Store file.

I'm trying to find to do it but as we all know time is always short, pull requests welcome.

@szwacz
Copy link
Contributor

szwacz commented Dec 5, 2013

I'm a moron, I thought part of applescript is hdiutil :)
My time is also scarce, but I will try to contribute something in incoming weeks.

@LinusU
Copy link
Owner Author

LinusU commented Dec 5, 2013

Cool, thanks man!

@LinusU
Copy link
Owner Author

LinusU commented Jan 5, 2014

Oh god, I have been doing extensive work on the .DS_Store and it's a fucking pain! Anyhow, should hopefully have something that works sometime not too far in the future.

@szwacz did you get any time to look at it?

@szwacz
Copy link
Contributor

szwacz commented Jan 7, 2014

I didn't, but have free time just now for couple of days. Could you talk a little about your discoveries so I can start from there?

@LinusU
Copy link
Owner Author

LinusU commented Jan 7, 2014

I just got my first functional image without apple-script! I'll try to upload everything now... Are you on Mac or Linux? If you want to get Linux working now I don't think that it would be to much work...

@LinusU
Copy link
Owner Author

LinusU commented Jan 7, 2014

I have created to other projects for support:

https://github.com/LinusU/node-alias
https://github.com/LinusU/node-ds-store

Haven't pushed anything to the second yet but will soon, just need to patch https://github.com/joeferner/node-bplist-creator

@LinusU
Copy link
Owner Author

LinusU commented Jan 7, 2014

Currently everything breaks if the image dosen't get mounted to exactly /Volumes/<name>. If 1 is appended it doesn't work :(

@LinusU
Copy link
Owner Author

LinusU commented Jan 7, 2014

I think it has to do with how node-alias gets the Volume Name (path.basename(mountPoint)) so that should be fixable.

@LinusU
Copy link
Owner Author

LinusU commented Jan 7, 2014

Okay, finally! I have a version that works in the ds-store branch.

https://github.com/LinusU/node-appdmg/tree/ds-store

@szwacz could you please test this on your computer and see if it works?

I think that I need to fix LinusU/node-alias#1 before we can merge this into master.

@szwacz
Copy link
Contributor

szwacz commented Jan 7, 2014

Sure, may I know how you are testing development version of appdmg? Somehow I just can't get it to work.

@LinusU
Copy link
Owner Author

LinusU commented Jan 7, 2014

git clone git@github.com:LinusU/node-appdmg.git
git checkout ds-store
npm install
bin/appdmg test/appdmg.json ~/Desktop/test.dmg

That should build the test image and dump it to the desktop.

@szwacz
Copy link
Contributor

szwacz commented Jan 7, 2014

(Ah, I didn't try the /bin thing)
Yes it works fine :)

From where did you get the knowledge how to build aliases?

@LinusU
Copy link
Owner Author

LinusU commented Jan 9, 2014

Mostly wikipedia actually, and reverse engineering what I got from my original .DS_Store file. It seems the extra fields with type > 10 isn't documented anywhere...

@szwacz
Copy link
Contributor

szwacz commented Jan 9, 2014

I'm trying to get familiar with your code, but are confused a little.
This issue is called "Drop applescript", and as I see you already done that :)
In branch ds-store you are not using right now node-alias lib, and this is not needed to drop apple script. Why you need node-alias to merge this?

@LinusU
Copy link
Owner Author

LinusU commented Jan 9, 2014

The ds-store branch depends on node-ds-store which in turn depends on node-alias. Since node-alias sometimes gets the Volume Name wrong, node-ds-store sometimes produce faulty .DS_Store files which don't show the background.

If we can close LinusU/node-alias#1 we can merge ds-store into master and close this issue.

@loryk
Copy link

loryk commented Jan 12, 2014

How I see volume name/title is limit to 27 symbols.
Second thing, no need to attach dmg by title, you can use temporary folder like image_rnd_111 (For unique name can be used timer or function that create temporary name) and this can help to fix any issues, that can be with image name. But for background image you use absolute path (Like /Volumes/My image/.background/app.tiff)... and this hold using alternate name. I try to change it, and use relative path, but background wasn't show =(
(Something I did wrong, or relative path didn't work for this)

@LinusU
Copy link
Owner Author

LinusU commented Jan 13, 2014

@loryk The problem is that mac os aliases contains so much more than just a path, which is good. This is what will make it work if the user decides to mount the dmg somewhere else than we had intended.

Basically, the alias contains the name of the volume (e.g. Test Title) and the absolute path inside the volume (e.g. .background/TestBkg.tiff). So it doesn't matter where the image is mounted at all.

The problem we are facing right now is that node-alias dosen't know the name of the volume, and assumes it to be path.basename(volumePath). This only works when the dmg is mounted with it's exact name when the alias is created.

@LinusU LinusU closed this as completed in b7b9761 Jan 13, 2014
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

3 participants