Any help much appreciated
It was written on windows and works on that platform. Once upon a time I would’ve had Livecode installed on a mac too and would build the Mac standalone there. Now, what with licence requirements and all I’m trying to do the build on windows and simply install the finished .app folder for testing.
On the mac I put the built .app folder into the applications folder (where it crashes when clicked).
The app uses a standalone splash-screen, on windows this get put in the program files(x86) folder, on macs it gets put in a folder contents/macOS in the .app folder.
The splash-screen opens a livecode ‘home’ stack where everything else is done.
On windows this livecode home stack gets put in /AppData/Roaming.
On the mac I’ve put it into the .app folder/resources folder.
A preferences text file is created, so users can set their own scaleFactor and font choice. This I try to put in Documents (nothing gets created on the mac, it crashes beforehand).
The file-paths get put into globals (splashscreen, prefsFile, HomeStak) so hopefully it shouldn't matter if they're different.
I have no idea why it’s crashing. I tried putting answer messages in the standalone but they’re not working (presumably the crash happens before then).
I could perhaps install livecode on the mac (switching seats? not sure if I can do this with my employer's indy licence, and I'd rather not unless I have to -- this project is already overdue).
The main stack (in the code below this is 'homeStak') has sound files and is quite large (144mb). It also has thousands of lines of code. I can't see any easy way of providing it. I don’t think it’s getting as far as opening the main stack.
The issue may even be with my standalone build mac settings. (Which I could supply if it'd help).
The splash-screen stack (pre-build) is tiny. Here's the code:
Code: Select all
on preOpenStack if the platform is Win32 then put Arial into theFont else put Helvetica into theFont end if repeat with i = 1 to the number of flds of this stack set the textFont of this stack to theFont end repeat set the loc of this stack to the screenloc set the passkey of this stack to [password goes here] set the navigationArrows to false set the visible of this stack to true set the loc of this stack to the screenLoc -- middle of screen show img 1 set lockcursor to true end preOpenStack on openStack global splashScreen, homeStak, prefsFile, fullScn, theScale, openCount -- all set/initialised here put 0 into openCount get the long name of this stack --file path on hard drive delete the first word of it --stack delete the first char of it -- " delete the last char of it -- " put it into splashScreen -- exe file put it into thisStackPath set itemDel to "/" delete the last item of thisStackPath --the name of the current stack, leaving the file path (separated by commas) if the platform is Win32 then set the dontuseqteffects to true set the dontuseQT to true put specialfolderpath(0x001a) into appData --C:/Users/Steve/AppData/Roaming put specialfolderpath(0x0005) into myDocs --C:\Users\Steve\Documents CSIDL_PERSONAL = 0x0005 put "/Gupapuyngu_" & fld exeVerFld after appData else put specialfolderpath(resources) into appData put specialfolderpath(documents) into myDocs -- end if put "/Gupapuyngu_" & fld exeVerFld after myDocs if there is not a folder myDocs then create folder myDocs end if put appData & "/Gup_main.livecode" into homeStak put myDocs & "/Gupapuyngu_prefs.txt" into prefsFile -- global set here put empty into theScale if there is a file prefsFile then open file prefsFile for read read from file prefsFile until EOF put it into fld prefsFld of cd 1 of stack homeStak else -- create text file put fld prefsDefaultFld of cd 1 of stack homeStak into fld prefsFld of cd 1 of stack homeStak open file prefsFile for write write fld prefsFld of cd 1 of stack homeStak to file prefsFile end if close file prefsFile if the platform is Win32 then put lineOffset("winfont:", fld prefsFld of cd 1 of stack homeStak) into fontLine else put lineOffset("macfont:", fld prefsFld of cd 1 of stack homeStak) into fontLine end if put line fontLine of fld prefsFld of cd 1 of stack homeStak into theFont set itemDel to ":" put item 2 of theFont into theFont repeat with p = 1 to the number of cds of stack homeStak repeat with i = 1 to the number of flds of cd p of stack homeStak set the textFont of fld i of cd p of stack homeStak to theFont end repeat end repeat put lineOffset("scale:", fld prefsFld of cd 1 of stack homeStak) into viewSetting put item 2 of viewSetting into viewSetting if viewSetting is "Full" then -- will start in fullscreen mode put "true" into fullScn end if if viewSetting is a number then -- will start at this scale put viewSetting into theScale end if if there is a stack homeStak then if fullScn is "true" then set the fullscreenmode of stack homeStak to "letterbox" set the fullscreen of stack homeStak to true else set the fullscreen of stack homeStak to false if theScale is not empty then -- will be a number from above set the scaleFactor of stack homeStak to theScale end if end if end if set the passkey of stack homeStak to [password goes here] set the loc of stack homeStak to the screenLoc set the visible of stack splashScreen to false set the visible of stack homeStak to true set lockMessages to false set the loc of stack homeStak to the screenLoc go to cd 1 of stack homeStak set cursor to arrow lock cursor unlock screen end openStack