RE: Database locked in merged application

Subject :RE: Database locked in merged application
From :Timothy Penner via 4D_Tech
Date :Thursday, December 21, 2017 at 10:27 AM
Link :https://kb.4d.com/resources/inug?msgid=GmailId1607a1da70d0a99b
My assumption is that the application is falling victim to Gatekeeper and being translocated to a read-only location. Apple documents how to get around this; they suggest signing the app and placing it on a dmg and then signing the dmg. Quote from Apple: "For distribution outside of the Mac App Store, the preferred options are to use a signed disk image (DMG) or signed installer package. Signing these allows validation of the contents and their source. ZIP archives may also be used, but this is discouraged."



However they also mention that if you still deliver the application as a zip file then you would need to place the application into the root of the /Applications/ folder; so if your application is named myApp.app it should be moved exactly to /Applications/myApp.app right after extracting it from the ZIP file (not after attempting to run it from somewhere else). But I am pretty sure for this to work the application is still supposed to be signed.



Sometimes you can right clicking on the application and choosing "Open" to get passed gatekeeper warning about unsigned applications, but I am not sure if this affects app translocation.



As a last minute alternative, maybe there is an extended attribute you can remove from the installed application (using 'xattr -cr /Applications/myApp.app' from a terminal) to get it out of quarantine. I don’t know if this will work, but maybe it can help.



Here are some references that may help:

http://kb.4d.com/assetid=77688

https://developer.apple.com/library/content/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG17

https://apple.stackexchange.com/questions/87313/how-to-remove-xattr-com-apple-quarantine-from-all-webarchive-files-with-that-ex





Hope that helps!



-Tim







**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-Unsubscribe@xxx.xxx
**********************************************************************

Subject :Re: Database locked in merged application
From :James Knight via 4D_Tech
Date :Thursday, December 21, 2017 at 1:47 AM
Link :https://kb.4d.com/resources/inug?msgid=GmailId160799442c8466ae
Can anyone help me with this?

Thanks

James


Thanks to those who’ve replied so far with this.

I’m using 4D 15.5 build 15.216758 on Mac OS X 10.13.1

I think that I’ve followed the instructions for creating a default data file - I have a Default Data folder next to my .4db file, and this contains the default data file (Default.4dd, Default.4Dindx and Default.Match).

Having built the application, if I inspect the package contents, I see Contents/Database and this contains my 4DC compiled application, with the populated Default Data folder alongside it.

However, I cannot make this application run at all. It tells me that the data file is locked and it’s impossible to open the database. The only way it will open is if I put a data file in the same folder as the built application,

So it looks like the data file which is wrapped up inside the application can’t be used, even though no write access is required.

I haven’t got as far as signing my application - I didn’t think I needed to do this, as I am simply copying the application directly to individual computers on the network. I usually use Remote Desktop to copy the built application to all computers on the LAN.

Hope someone can help further with this.

Cheers

James Knight
Waveney River Centre

james@xxx.xxx

> On 19 Dec 2017, at 23:16, Keisuke Miyako via 4D_Tech <4d_tech@xxx.xxx > wrote:
>
> I don't have a solution but to better understand the situation:
>
> are you actually using the v15 default.4dd system,
> or simply placing a {name}.4dd adjacent to the compiled structure file?
> http://doc.4d.com/4Dv15/4D/15/Default-data-file-in-merged-applications.300-2018649.en.html
>
> did you code sign (and verify) your built application?
>
> unlikely, but did you check if the read-only-allow property is passed on to your built application?
> (for example, by implementing OPEN SETTINGS WINDOW)
>
> http://doc.4d.com/4Dv15/4D/15.4/DatabaseData-storage-page.300-3285380.en.html
>
> least but not least, always good to include the build number of 4D and the OS.
>
>> 2017/12/20 7:41、James Knight via 4D_Tech <4d_tech@xxx.xxx> のメール:
>> It’s clearly permissions related - but how can I fix it?
>
>
>
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ: http://lists.4d.com/faqnug.html
> Archive: http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub: mailto:4D_Tech-Unsubscribe@xxx.xxx
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-Unsubscribe@xxx.xxx
**********************************************************************

Subject :Re: Database locked in merged application
From :James Knight via 4D_Tech
Date :Wednesday, December 20, 2017 at 6:00 AM
Link :https://kb.4d.com/resources/inug?msgid=GmailId16074035bfe63f17
Thanks to those who’ve replied so far with this.

I’m using 4D 15.5 build 15.216758 on Mac OS X 10.13.1

I think that I’ve followed the instructions for creating a default data file - I have a Default Data folder next to my .4db file, and this contains the default data file (Default.4dd, Default.4Dindx and Default.Match).

Having built the application, if I inspect the package contents, I see Contents/Database and this contains my 4DC compiled application, with the populated Default Data folder alongside it.

However, I cannot make this application run at all. It tells me that the data file is locked and it’s impossible to open the database. The only way it will open is if I put a data file in the same folder as the built application,

So it looks like the data file which is wrapped up inside the application can’t be used, even though no write access is required.

I haven’t got as far as signing my application - I didn’t think I needed to do this, as I am simply copying the application directly to individual computers on the network. I usually use Remote Desktop to copy the built application to all computers on the LAN.

Hope someone can help further with this.

Cheers

James Knight
Waveney River Centre

james@xxx.xxx

> On 19 Dec 2017, at 23:16, Keisuke Miyako via 4D_Tech <4d_tech@xxx.xxx > wrote:
>
> I don't have a solution but to better understand the situation:
>
> are you actually using the v15 default.4dd system,
> or simply placing a {name}.4dd adjacent to the compiled structure file?
> http://doc.4d.com/4Dv15/4D/15/Default-data-file-in-merged-applications.300-2018649.en.html
>
> did you code sign (and verify) your built application?
>
> unlikely, but did you check if the read-only-allow property is passed on to your built application?
> (for example, by implementing OPEN SETTINGS WINDOW)
>
> http://doc.4d.com/4Dv15/4D/15.4/DatabaseData-storage-page.300-3285380.en.html
>
> least but not least, always good to include the build number of 4D and the OS.
>
>> 2017/12/20 7:41、James Knight via 4D_Tech <4d_tech@xxx.xxx> のメール:
>> It’s clearly permissions related - but how can I fix it?
>
>
>
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ: http://lists.4d.com/faqnug.html
> Archive: http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub: mailto:4D_Tech-Unsubscribe@xxx.xxx
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-Unsubscribe@xxx.xxx
**********************************************************************

Subject :RE: Database locked in merged application
From :Timothy Penner via 4D_Tech
Date :Tuesday, December 19, 2017 at 4:17 PM
Link :https://kb.4d.com/resources/inug?msgid=GmailId1607111c69661e53
Please have a look here:

http://kb.4d.com/assetid=77688



TL/DR - you need sign the application, then place it on a disk image (DMG) and then sign the disk image, before transferring the disk image to the other machine.



-Tim













-----Original Message-----

From: 4D_Tech [mailto:4d_tech-bounces@xxx.xxx] On Behalf Of James Knight via 4D_Tech

Sent: Tuesday, December 19, 2017 2:41 PM

To: 4d_tech@xxx.xxx

Cc: James Knight

Subject: Database locked in merged application



Hi



I’ve recently upgraded our database to v15 and see that I should be able to set a default data file in a merged application.



We use the data file only to get the merged application running - all data is stored in a remote MySQL database (not 4D SQL) using MyConnect. Therefore the data file should in principle be capable of being read only for end users - it only stores the connection information for the MySQL database.



There are a number of Macs using network accounts on our network so historically I’ve stored the merged app and the data file in a folder within Users/Shared. But this has always caused issues with upgrading the app and setting permissions for different users.



Ideally I would like to store the merged application in the system Applications folder.



I’ve created a default data file and stored it next to the 4db file. I’ve also selected the ‘Allow read only data file use’ in the data storage section of database settings.



Having built the merged application, it opens just fine, in the location in which it is created.



However, if I move or copy the application to any other location at all, or on to another computer, it refuses to open and gives the message “The data file is locked. Impossible to open database”.



I started by trying to copy it to the Applications folder, but even moving the merged app into the parent folder is enough to give this error.



It’s clearly permissions related - but how can I fix it?



Cheers



James







**********************************************************************

4D Internet Users Group (4D iNUG)

FAQ: http://lists.4d.com/faqnug.html

Archive: http://lists.4d.com/archives.html

Options: http://lists.4d.com/mailman/options/4d_tech

Unsub: mailto:4D_Tech-Unsubscribe@xxx.xxx

**********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-Unsubscribe@xxx.xxx
**********************************************************************

Subject :Re: Database locked in merged application
From :Keisuke Miyako via 4D_Tech
Date :Tuesday, December 19, 2017 at 4:16 PM
Link :https://kb.4d.com/resources/inug?msgid=GmailId1607110552f412c8
I don't have a solution but to better understand the situation:



are you actually using the v15 default.4dd system,

or simply placing a {name}.4dd adjacent to the compiled structure file?

http://doc.4d.com/4Dv15/4D/15/Default-data-file-in-merged-applications.300-2018649.en.html



did you code sign (and verify) your built application?



unlikely, but did you check if the read-only-allow property is passed on to your built application?

(for example, by implementing OPEN SETTINGS WINDOW)



http://doc.4d.com/4Dv15/4D/15.4/DatabaseData-storage-page.300-3285380.en.html



least but not least, always good to include the build number of 4D and the OS.



> 2017/12/20 7:41、James Knight via 4D_Tech <4d_tech@xxx.xxx> のメール:

> It’s clearly permissions related - but how can I fix it?









**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-Unsubscribe@xxx.xxx
**********************************************************************