Create Folder [Merry Christmas]

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
hrcap
Posts: 141
Joined: Mon Jan 14, 2019 5:20 pm

Create Folder [Merry Christmas]

Post by hrcap » Wed Dec 23, 2020 4:07 pm

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.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Create Folder [Merry Christmas]

Post by jmburnod » Wed Dec 23, 2020 5:28 pm

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
https://alternatic.ch

hrcap
Posts: 141
Joined: Mon Jan 14, 2019 5:20 pm

Re: Create Folder [Merry Christmas]

Post by hrcap » Wed Dec 23, 2020 5:50 pm

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

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Create Folder [Merry Christmas]

Post by Klaus » Wed Dec 23, 2020 6:02 pm

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!

hrcap
Posts: 141
Joined: Mon Jan 14, 2019 5:20 pm

Re: Create Folder [Merry Christmas]

Post by hrcap » Wed Dec 23, 2020 6:09 pm

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

Post Reply