NSUpdateSecurityPolicy don't work

I have two apps written in MAUI Mac Catalyst Framework -- one is main app, second is app updater. My updater works this way: it is located in the same directory as main app: firstly it deletes MainApp.app/Contents folder, then unzips new Contents folder that was downloaded from server.

I added NSUpdateSecurityPolicy dictionary as in https://developer.apple.com/documentation/bundleresources/information_property_list/nsupdatesecuritypolicy and create application like . It looks that I wrote everything fine

pkgbuild --install-location '/Library/Application Support/First' --root root --ownership preserve # aslo signing, etc

But on user's macOS, system does not allow to delete Contents folder: I have IO_Access denied exception. Can it be because main app is sandboxing or something else?

What I can do wrong? Thanks a lot in advance!

Answered by rieznikov_bohdan in 784877022

I figured it out, customer used older version of app, thanks

Accepted Answer

I figured it out, customer used older version of app, thanks

I’m glad to hear you got it working but this seems weird:

firstly it deletes MainApp.app/Contents

Is there a reason you don’t delete the top-level item, that is, MainApp.app? That has a couple of benefits:

  • It avoids the need to mess around inside a bundle, which is what triggered this problem.

  • It means that the target app is always in a consistent state. If your updater fails halfway through, the user will be left with either the old app or the new app, not something in between.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"