Форум на Kuban.ru (http://forums.kuban.ru/)
-   Разработка программ (http://forums.kuban.ru/f1024/)
-   -   Как можно перевести Window-приложение под Macintosh (http://forums.kuban.ru/f1024/kak_mozhno_perevesti_window-prilozhenie_pod_macintosh-2439584.html)

ComAlex 02.04.2012 19:44

Как можно перевести Window-приложение под Macintosh
 
Как программу, написанную на Delphi под Windows (имеются все её исходники) перенести под MAC. Есть ли средства (программы), позволяющие сделать такую конвертацию?

CPU 02.04.2012 19:50

Хотел посоветовать посмотреть в сторону Lazarus'a, но в его описании в википедии есть строки:
[em]"Начиная с Delphi XE2 в самом Delphi имеется возможность компиляции программ для Mac OS X и iOS."[/em]

Если это правда, то можно самими Дельфями и перекомпилить.. если не юзается что-то такое Windows-only.

ComAlex 03.04.2012 12:15

Дельфями перекомпилировать не хотелось бы, так как много доп. компонентов. При использовании Lazarus`а натнулся на ошибку "Fatal: Circular unit reference between types and Windows", через которую не могу перескочить. Не поможете?

TVV1 03.04.2012 13:57

Если в проекте много сторонних компонентов, и он еще сделан на версии Delphi < 2009, то переход на XE2 это будет еще тот пельмень (Imho). Перегон же под Lazarus тоже будет не прост. Конечно все зависит от количества сторонних компонентов и их специфики.

Что касается сообщения об ошибке, то если верить этому
[url]http://lazarus-ccr.sourceforge.net/fpcdoc/user/userse68.html[/url]
[quote]
Fatal: Circular unit reference between arg1 and arg2
Two units are using each other in the interface part. This is only allowed in the implementation part. At least one unit must contain the other one in the implementation section. [/quote]

Здесь пишут про тоже, только еще с примерами
[url]http://wiki.lazarus.freepascal.org/Lazarus_Faq[/url]

economist 04.04.2012 07:46

Если есть исходники - проще переписать. Если используются специфические компоненты - может запуститься и под Linux. А если нет - проще заново переписать ее на Python, так можно обеспечить кроссплатформенность. Просто эпидемия какая-то началась: понапокупат сначала огрызков яблочных на всю контору, а потом подкидываются с рабочим софтом.

ComAlex 04.04.2012 07:53

Спасибо, с этим почти разобрался.

Еще маленький вопрос от ламера:
Мне нужно создать CD-диск с автозапуском из-под MAC. Какой файл мне нужно записать на нем, что CD запускался при вставке? Есть ли в MAC что-то подобное Autorun.inf под Windows или другие механизмы?

TVV1 04.04.2012 15:59

Фиг его знает как там этот автозапуск делается, я эту фигню и под win не выношу и всегда отрубаю ибо толку от нее ноль, а вот вирусню какую нибудь так запросто можно занести.
Однако, если верить яндексу, то на mac придерживаются таких же взглядов. Впрочем есть некий финт ушами для автозапуска с CD
"Because of this virus fear, the autostart feature was silently dropped under Mac OS X. The read-me file is therefore the only solution if you target Macintosh OS X users.
It doesn't seem that there are any plans to change this.
For computers still having the Classic execution environment, it remains possible to launch it and to check the QuickTime autorun feature in the Apple menu. This would be useful if you're planning a presentation of several CD-ROMs on a Macintosh.

Autorun under Mac OS X
Because of this virus fear, the autostart feature was silently dropped under Mac OS X. The read-me file is therefore the only solution if you target Macintosh OS X users.
It doesn't seem that there are any plans to change this.
For computers still having the Classic execution environment, it remains possible to launch it and to check the QuickTime autorun feature in the Apple menu. This would be useful if you're planning a presentation of several CD-ROMs on a Macintosh.

From Which CD-ROM?
The autostart feature works only from an HFS (Hierarchical File System) volume, that is from a real Macintosh volume. That means that you cannot have an ISO 9660 CD-ROM with autostart features for Macintosh (even in the case of an ISO CD-ROM with Apple Extensions).

Technical Aspects
The first two bytes of the sector 0 of the HFS volume must be set to zero. At offset 106d (0x6A) there begins a magical signature 0x006A7068 (big endian!), followed by a Pascal string (length in the first byte, then the bytes forming the string) designating a file which must be in the root folder (it can also be an alias [shortcut] pointing to a file stored deeper in the files and folders tree). The total length of the Pascal string is 12 bytes. The maximum length of the filename is therefore 11 bytes.
Since the effects of the autostart feature are the same as double-clicking on the icon, it also means that the signature of this file should be correct (see also the Signature Page). If not, the user will get a dialog box displayed by the Finder, asking for the application which should open the file. The effects on the end-user are of course very, very bad.
Apple has published a Technical note on this subject."

TVV1 04.04.2012 16:05

Вот еще про запись гибридных дисков для mac и win
[url=http://www.uic.edu/depts/accc/newsletter/adn34/cdhowto.html#Both]CD-Writing How-Tos[/url]

ELEAv4 06.04.2012 09:03

XE2 может 100%
Только ОС зависимые участки придется переписывать...


Текущее время: 17:21. Часовой пояс GMT +3.