macOS installer skipping new packet due to old version, but still performs scripts

Hi,

I've built an installation package (file with .pkg suffix).

when I double click the pkg file whereas newer version of the package is already installed, then the installer skip the downgrade process due to the following reason.

2023-02-22 20:19:11+02 my-Mac installd[744]: PackageKit: Skipping component 
“com.myapp.mycompany” (22.9.0-2209.0.0-*) 
because the version 23.2.3559-2302.3559.11638-* is already installed at /Applications/myapp.app.

However, I still see that the preinstall and postinstall script being executed. Perhaps there's a way to either enable the downgrade, or disable it completely, so I won't get this partial install scenario.

Is there a way I can get indication that the installer has skipped the file copying of the target pkg, from within the post/pre install scripts (so I can handle it properly) ?

macOS installer skipping new packet due to old version, but still performs scripts
 
 
Q