Page 1 of 1

Create Folder [Merry Christmas]

Posted: Wed Dec 23, 2020 4:07 pm
by hrcap
Happy Christmas Everybody.

I am in the process of finishing my build and converting to standalone... all has gone smoothly except for one issue that I can't figure out.


On first opening of my solution the script creates a folder titled 'My App' within the Mac 'Applications' folder. This is new folder is used to store the database for the solution....

When working from the LC development environment this 'create folder' step works fine...

When I build the app into a stand alone and install onto a new computer the create folder step doesn't work...

If I then install LiveCode on to the new computer the 'create folder' step will work again...



My thoughts are that"

- maybe i'm missing an inclusion in the standalone settings that allows the 'create folder' step to work? If so what is this inclusion?

- Do I need to make the MyApp ask for permission to create folders on first install? if so how do I do this?

- Maybe I'm wrong and there is a different work around?




Any help on this would be greatly appreciated.



Many Thanks and Happy Christmas.

Re: Create Folder [Merry Christmas]

Posted: Wed Dec 23, 2020 5:28 pm
by jmburnod
Hi,
This is new folder is used to store the database for the solution....
I always use documents folder to store data.
Not sure that is possible to create a new folder in Applications folder but i'm curious to know why you need a new folder in Applications folder.
Beat regards
Jean-Marc

Re: Create Folder [Merry Christmas]

Posted: Wed Dec 23, 2020 5:50 pm
by hrcap
Hi Jean-Marc

Thanks for the swift reply, what path do you use to get to the documents folder?

Is it the standard documents folder on Mac? Or is it the documents folder within the app bundle

(The reason I was storing the applications folder on Mac was just so the ‘application files’ we’re all in the same place).

Many Thanks

Re: Create Folder [Merry Christmas]

Posted: Wed Dec 23, 2020 6:02 pm
by Klaus
Only ADMINS have write permission in the -> Application folder on any platform!

So as Jean-Marc pointed out, use
-> specialfolderpath("documents")
or even
-> specialfolderpath("preferences")
on the Mac to store and open your db file.
Check the dictionary for more specialfolderpath() codes for Mac and Windows!
Is it the standard documents folder on Mac?

Yes.
Or is it the documents folder within the app bundle
No, this is only the case on the mobile platform!

Re: Create Folder [Merry Christmas]

Posted: Wed Dec 23, 2020 6:09 pm
by hrcap
Thats lovely, thank you very much Klaus

I will try and implement this change shortly.


...As a note its strange that you can write to the applications folder when LiveCode is installed on the users computer.


Many Thanks