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

some extra files are not placed at the specified coordinates #33

Closed
dliessi opened this issue May 7, 2014 · 10 comments
Closed

some extra files are not placed at the specified coordinates #33

dliessi opened this issue May 7, 2014 · 10 comments

Comments

@dliessi
Copy link

dliessi commented May 7, 2014

This seems to depend on the file name: e.g. an empty ChangeLog file is placed ignoring Xpos and Ypos, while the same empty file renamed to DangeLog is placed at the specified coordinates.

@LinusU
Copy link
Owner

LinusU commented May 8, 2014

Could it have something to do with the length of the name? Could you please try 1ChangeLog, ChangeLog, hangeLog and angeLog...

@dliessi
Copy link
Author

dliessi commented May 8, 2014

I tried different combinations of 1ChangeLog, ChangeLog, hangeLog, angeLog:

  • if angeLog was present, it was wrongly placed and also the application was wrongly placed;
  • all other combinations of 1ChangeLog, ChangeLog, hangeLog were correctly placed;
  • when I added a README file to 1ChangeLog, ChangeLog and hangeLog, the placement of hangeLog was wrong, while the other files were correctly placed.

@dliessi
Copy link
Author

dliessi commented May 9, 2014

Some more examples (you can see also examples of issue #32).
All files have exactly the same content and the same attributes (creation and modified times, permissions, ownership).
The difference between examples with the same number of extra files is only the name of the included files.

2 extra files, correctly placed:
test7

2 extra files, wrongly placed:
test6

3 extra files, correctly placed:
test10
test12

3 extra files, wrongly placed:
test5
test9
test11

4 extra files, correctly placed:
test4

4 extra files, wrongly placed:
test13

@dliessi
Copy link
Author

dliessi commented May 9, 2014

[In case you're wondering, Pippo is the Italian name of Goofy and is one of the most used metasyntactic variable names in Italian, usually accompanied by Pluto and Paperino (= Donald Duck). :) ]

@LinusU
Copy link
Owner

LinusU commented May 11, 2014

Hehe, nice trivia :)

I have very little time at the moment but will try to look at this more within a week. I think that it might have something to do with the ordering in the ds-store file. If you have more time to test, try and see if you can find a link between the alphabetical ordering of the files and the breakage. I remember that the entries had to be ordered in a specific order for the file to be valid, maybe I made a misstake there.

@LinusU
Copy link
Owner

LinusU commented May 11, 2014

Hmm, the entries are sorted but maybe the sorting is wrong.

https://github.com/LinusU/node-ds-store/blob/master/lib/ds-store.js#L278

@dliessi
Copy link
Author

dliessi commented May 14, 2014

If you have more time to test, try and see if you can find a link between the alphabetical ordering of the files and the breakage.

I was short of time the last days, but tomorrow morning I should be able to do some more tests.

@jschmidt42
Copy link

I have the same issue here, as soon as I use spaces in my file name I get some icons being misplaced.

In the example above, if I change "Project Scotty.app" to "ProjectScotty.app" I get proper placement.

Here is my spec:

{
"title": "M&E Cloud Services",
"app": "Project Scotty.app",
"background": "ScottyMacInstaller.png",
"icon": "Scotty.icns",

"icons": {
"size": 80,
"app": [158, 184],
"alias": [400, 184]
},

"extra": [
["ash.mod", 158, 350],
["readme.txt", 555, 275]
]
}

@dliessi
Copy link
Author

dliessi commented Jun 17, 2014

I did some tests.
I noticed that extra files are misplaced if their name comes before the application name or the Applications folder name in alphabetical order.
(Numbers apparently are sorted after letters, for what concerns this problem: in my tests files with names beginning with a number were always placed correctly.)
Sometimes also the application icon and the Applications folder icon are misplaced if some extra files are misplaced, but I didn't notice any regularities in this.

I couldn't reproduce what @jschmidt42 describes: I get the same wrong placement of the icons both with and without the space in the application name.

Maybe the localCompares at https://github.com/LinusU/node-ds-store/blob/master/lib/entry.js#L38 need some options.
I tried some changes, but they were ineffective.
But I actually don't know what I'm doing. :D

@LinusU Any ideas?

dliessi added a commit to dliessi/node-ds-store that referenced this issue Jul 6, 2014
From http://search.cpan.org/~wiml/Mac-Finder-DSStore/DSStoreFormat.pod:
"My guess is that the string comparison follows the same rules as HFS+
described in Apple's TN1150."
https://developer.apple.com/legacy/library/technotes/tn/tn1150.html
specifies that "Unicode strings will be stored in fully decomposed form,
with composing characters stored in canonical order" and contains a
FastUnicodeCompare routine defined as the "HFS Plus case-insensitive
string comparison algorithm"

The unorm module is used to fully decompose and canonically order
filename strings.  The FastUnicodeCompare routine is implemented as
HFSPlusFastUnicodeCompare and used in Entry.sort instead of
localeCompare.

This solves LinusU/node-appdmg#33.

(At first I only added .toLowerCase() to filename strings in Entry.sort,
which solved the issue, but only in case of names containing only latin
letters without diacritics.)
dliessi added a commit to dliessi/node-ds-store that referenced this issue Jul 6, 2014
From http://search.cpan.org/~wiml/Mac-Finder-DSStore/DSStoreFormat.pod:
"My guess is that the string comparison follows the same rules as HFS+
described in Apple's TN1150."
https://developer.apple.com/legacy/library/technotes/tn/tn1150.html
specifies that "Unicode strings will be stored in fully decomposed form,
with composing characters stored in canonical order" and contains a
FastUnicodeCompare routine defined as the "HFS Plus case-insensitive
string comparison algorithm"

The unorm module is used to fully decompose and canonically order
filename strings.  The FastUnicodeCompare routine is implemented as
HFSPlusFastUnicodeCompare and used in Entry.sort instead of
localeCompare.

This solves LinusU/node-appdmg#33.

(At first I only added .toLowerCase() to filename strings in Entry.sort,
which solved the issue, but only in case of names containing only latin
letters without diacritics.)
@LinusU
Copy link
Owner

LinusU commented Jul 7, 2014

This is now fixed in 0.1.13 thanks to @dliessi :)

@LinusU LinusU closed this as completed Jul 7, 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