Fixing Mac OS X standalones
Sarah Reichelt
sarah.reichelt at gmail.com
Tue Aug 22 22:28:32 EDT 2006
> When you build a standalone for Mac OS X, at the moment (Rev 2.7.x)
> the required display plugins are not copied over, so the app looks
> like it was built for OS 9. Also, if you have specified a custom icon,
> it does not get displayed.
>
> Here is a script that fixes all that. It is set to work only when
> building on OS X systems, I don't know if it is needed on others. Just
> put this in the stack script of your mainStack and it will happen
> auto-magically after the standalne has been created.
Sorry all, some last minutes changes made it stop working :-(
Here is the correct version.
Cheers,
Sarah
-- after a standalone is created, this is called
-- pFolder is the name of the folder containing the standalone's folder
--
-- this routine copies over the missing display plugins
-- and "touches" the app tho make the icon appear
--
on standaloneSaved pFolder
-- only works when building on Mac OS X
if the platform <> "MacOS" then exit standaloneSaved
set the itemdel to "."
if item 1 of the systemversion < 10 then exit standaloneSaved
put the short name of this stack into tStackName
-- check if building any Mac OS X version
put the cRevStandaloneSettings["MacOSX"] of stack tStackName into tMacUB
put the cRevStandaloneSettings["MacOSX PowerPC-32"] of stack
tStackName into tMacPPC
put the cRevStandaloneSettings["MacOSX x86-32"] of stack
tStackName into tMacIntel
if tMacUB = false and tMacPPC = false and tMacIntel = false then
exit standaloneSaved
-- get the full name of the standalone folder
put the cRevStandaloneSettings["name"] of stack tStackName into tName
put pFolder & tName & "/" into tAppFolder
-- if building multiples, there will be a Mac OS X folder,
otherwise, just .app
if there is a folder (tAppFolder & "MacOSX") then
put "MacOSX/" after tAppFolder
end if
-- get out if can't find the new app
if there is not a folder (tAppFolder & tName & ".app") then exit
standaloneSaved
-- get the new app's plugins folder so the display plugins can be
copied across
put tAppFolder & tName & ".app" & "/Contents/PlugIns/" into tAppPlugins
-- get the path to the Rev app's plugins folder to find the originals
put the effective filename of stack "Home" into tRevPath
set the itemdel to "/"
delete item -2 to -1 of tRevPath
put "/Revolution.app/Contents/PlugIns/" after tRevPath
-- list the plugins
put the defaultfolder into tOldDefault
set the defaultfolder to tRevPath
put the folders into tPlugins
filter tPlugins with "*.bundle"
-- copy them to the new app
-- bundles need revCopyFolder despite what the docs say
-- revCopyFolder needs the full path for source & destination
repeat for each line i in tPlugins
put tRevPath & i into tSource
revCopyFolder tSource, tAppPlugins
end repeat
-- 'touch' new app to make it's icon appear
put "touch '" & tAppFolder & tName & ".app'" into tCmd
get shell(tCmd)
-- reset default folder
set the defaultfolder to tOldDefault
end standaloneSaved
More information about the use-livecode
mailing list