Knowing when a new version of app is installed

We have developed our applicaiton using electron,

and sandboxed for the benefit of Mac App Store distribution.


the app file generated by electron is packaged using tool 'productbuild'

So this will convert .app to .pkg and syntac used is

productbuild --component "$APP_PATH" /Applications --sign "$INSTALLER_HASH" "$RESULT_PATH"


Issue is

Let say if v1.0.0 of app is installed and running,

Then if we update v.1.1 of app -> Old version of app is still running

This causing issue with old app instance.


So how to make mac stop/exit old version of app before installaing new version?

is there way to include additional scripts while creating pkg file?

alteast I want mac to prevent new version of app installation when old version is already runing.

Accepted Reply

You can’t test the Mac App Store installation process locally. Even if you ignore this issue, you won’t be able to run a distribution-signed versions of your app.

On iOS you have TestFlight, which installs your app in almost exactly the same way as the App Store. Alas, this isn’t available on the Mac )-:

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

The Mac App Store installation process should stop the old version of your app before installing the new one. Is that not work for you?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for quick answer.

I have not yet tried to install from store directy.

Currently I am installaling from pkg file geneared in one Mac in another MAC PC. and previous instance is not closed.

The previous instance is also installed by running pkg file of our application.

You can’t test the Mac App Store installation process locally. Even if you ignore this issue, you won’t be able to run a distribution-signed versions of your app.

On iOS you have TestFlight, which installs your app in almost exactly the same way as the App Store. Alas, this isn’t available on the Mac )-:

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"