Re: Sqlite and Monterey on M1

2022-06-08 Thread Ludovic THEBAULT via use-livecode
Hello,

These were file's attributes that were blocking the writing (noticed by an @ 
with an ‘ls’).
They had to be removed with a "sudo xattr -c ..." (deleting only the 
com.apple.quarantine was not enough)

HTH !

> Le 15 mai 2022 à 17:30, Ludovic THEBAULT  a 
> écrit :
> 
> 
> 
>> Le 12 mai 2022 à 20:23, ludovic.theba...@laposte.net a écrit :
>> 
>> 
>> 
>> Bonsoir Ludovic,
>> 
>> on the Mac we have write permissions here -> specialFolderPath("preferences")
>> Works on Monterey as well and is "out of sight" of the user. ;-)
>> 
>> 
>> 
> 
> 
> Hello, Thanks
> 
> But it seems is don’t work for my app.
> 
> The sqlite file was copied from an Time Machine backup (but manually).
> But i tested it on my Mac (Big Sur) and all work fine…
> 
> there must be something else that blocks the writing in the database. The 
> processor (M1) ? the user id ?
> 
> I'll dig and test more deeply!
> Ludovic

Ludovic


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sqlite and Monterey on M1

2022-05-12 Thread Paul Dupuis via use-livecode

On 5/12/2022 2:25 PM, Richard Gaskin via use-livecode wrote:

Bob Sneidar wrote:

> I don't think the latest Apple operating systems allow the writing
> to the App Support folder, even if you have explicit write
> permissions.

Where are we supposed to write application support files if not to 
Application Support?


First they demanded control of the file format apps use for Prefs, now 
this...




I did a little bit of research when I ran into my app breaking on 
Catalina and up when trying to reach a folder at 
specialFolderPath("temporary") and write files in that folder. The 
problem is that newer macOSes use an runtime algorithm to try to 
determine when an application is asking for access in "special" places. 
If the algorithm detect special access (sat to the Desktop or Documents 
folder or a Webcam and so on) the OS pops up the "Do you want to allow 
.. " dialog for the user to allow or deny access. An application signed 
and notarized WITH entitlements can specify some entitlements that are 
checked and if the App has declared these entitlements to protected 
resources, they are allowed. Some "protected" resources have NOT 
corresponding entitlements (at least currently). For disk access to 
folder paths without entitlements, the user can grant an application 
Full Disk Access, from System Preferences > Security, but and App can 
not specify an entitlement for Full Disk Access. It must be granted by 
the user.


Further, an Apple Engineer is a forum response (or someone claiming to 
be an Apple Engineer) noted that the algorithm to detect requests for 
special access resources can make mistakes and not recognize a request 
as a request and there for present a dialog to the user for allowing or 
denying and the default is to deny. So some circumstances, like apps 
running  in multiple processes (was an example cited, but it was implied 
there are other circumstances) your app MIGHT get the allow/deny dialog 
OR it might not - depending on your app. And for some resources, it just 
won't get any dialog and no entitlement will allow access, only 
instructions to the user to grant Full Disk Access (or some other 
similar ONLY allowed by the user permissions) will work.


In short, Apple's sandboxing is a developer mess. If you can, placing 
files in the Documents folder is best as (A) you can specify the 
Documents folder in an entitlement and (C) the sandboxing algorithm does 
seem to always detect (first time) Documents access requests and pop up 
the dialog.


DISCLAIMER: I did not have time to research this in detail and the 
"apple engineer" may or may not have been a real Apple engineer or knew 
what they were posting about. Our installer asks people on the last 
screen to grant our apps full disk access (if they are on Catalina+) and 
most people do and it solved a lot of recoding.




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sqlite and Monterey on M1

2022-05-12 Thread Richard Gaskin via use-livecode

Bob Sneidar wrote:

> I don't think the latest Apple operating systems allow the writing
> to the App Support folder, even if you have explicit write
> permissions.

Where are we supposed to write application support files if not to 
Application Support?


First they demanded control of the file format apps use for Prefs, now 
this...


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sqlite and Monterey on M1

2022-05-12 Thread J. Landman Gay via use-livecode

On 5/12/22 1:01 PM, Klaus major-k via use-livecode wrote:

on the Mac we have write permissions here -> specialFolderPath("preferences")
Works on Monterey as well and is "out of sight" of the user. ;-)


Am 12.05.2022 um 19:56 schrieb Bob Sneidar via 
use-livecode:

Sandboxing. I don't think the latest Apple operating systems allow the writing 
to the App Support folder,


That's kind of strange, since Mac OS provides the Application Support folder specifically for 
apps to store their data. Has that changed?


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sqlite and Monterey on M1

2022-05-12 Thread Klaus major-k via use-livecode
Bonsoir Ludovic,

on the Mac we have write permissions here -> specialFolderPath("preferences")
Works on Monterey as well and is "out of sight" of the user. ;-)

> Am 12.05.2022 um 19:56 schrieb Bob Sneidar via use-livecode 
> :
> 
> Sandboxing. I don't think the latest Apple operating systems allow the 
> writing to the App Support folder, even if you have explicit write 
> permissions. It's better if you put the file into her documents folder 
> somewhere. To answer the question you are about to ask, it's likely that her 
> old Mac OS was not current enough to have the sandboxing limitations, and so 
> it worked. 
> 
> Bob S
> 
>> On May 12, 2022, at 10:10 , ludovic.thebault--- via use-livecode 
>>  wrote:
>> Hello All,
>> 
>> I've made an macOS app for my sister that use an sqlite database located in 
>> the application support folder (~/library/Application Support/myApp/base.db)
>> Since she replaced her old mac with an iMac M1, the app cannot write on the 
>> database. I've checked the permissions on the folder and the sqlite file and 
>> all seem ok.
>> (-rwxr-xr-x for the database).
>> The app is not notarized, but at first launch (I recompiled the app with 
>> Livecode 9.6.4), an alert to give permissions to the "document" folder is 
>> displayed (and accepted).
>> What I miss ?
>> Thanks !

Best

Klaus

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sqlite and Monterey on M1

2022-05-12 Thread Bob Sneidar via use-livecode
Sandboxing. I don't think the latest Apple operating systems allow the writing 
to the App Support folder, even if you have explicit write permissions. It's 
better if you put the file into her documents folder somewhere. To answer the 
question you are about to ask, it's likely that her old Mac OS was not current 
enough to have the sandboxing limitations, and so it worked. 

Bob S


> On May 12, 2022, at 10:10 , ludovic.thebault--- via use-livecode 
>  wrote:
> 
> ‌
> 
> ‌
> 
> ‌
>  
> 
> Hello All,
> 
> I've made an macOS app for my sister that use an sqlite database located in 
> the application support folder (~/library/Application Support/myApp/base.db)
> 
> Since she replaced her old mac with an iMac M1, the app cannot write on the 
> database. I've checked the permissions on the folder and the sqlite file and 
> all seem ok.
> (-rwxr-xr-x for the database).
> 
> The app is not notarized, but at first launch (I recompiled the app with 
> Livecode 9.6.4), an alert to give permissions to the "document" folder is 
> displayed (and accepted).
> 
> What I miss ?
> 
> Thanks !
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Sqlite and Monterey on M1

2022-05-12 Thread ludovic.thebault--- via use-livecode
‌

‌

‌
 

Hello All,

I've made an macOS app for my sister that use an sqlite database located in the 
application support folder (~/library/Application Support/myApp/base.db)

Since she replaced her old mac with an iMac M1, the app cannot write on the 
database. I've checked the permissions on the folder and the sqlite file and 
all seem ok.
(-rwxr-xr-x for the database).

The app is not notarized, but at first launch (I recompiled the app with 
Livecode 9.6.4), an alert to give permissions to the "document" folder is 
displayed (and accepted).

What I miss ?

Thanks !
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode