Packages: how overwite existing plugin installs

When I run the .DMG created by Packages, it does not replace existing installs. Does anyone know how to allow overwriting? I have looked for a solution, but it has evaded me.

Thanks

We have uninstall scripts in our installers that run as pre-install scripts, so they remove any specific files we want to get rid of or replace. Never found any other reliable way to do that on the Mac.

Thanks Howard, I was looking into that. I thought I’d ask if there was a quicker way before delving into that!

Are you bumping the package version number? IIRC if the version contained in the installer is not newer than the version that exists on disk, the package will be skipped during installation.

1 Like

In my experience uninstall scripts are unfortunately necessary. Even if the new version overwrites old stuff, bundles are merged. If your new bundle no longer contains a file inside the bundle you end up with the old file inside the new bundle and that can mess up code-signing - unless you first make sure the whole bundle is deleted. I learned this the hard way and figuring it out took a lot of time. I was always manually deleting my files to do a proper fresh install, but customers had some random file and got very unhappy when running the installers wouldn’t fix anything. So better make sure you start with a clean slate.

1 Like

For plug-in and app bundles, you can turn on the “Allow downgrade” option in the “Rules” section (see screenshot)

The result will be that the installer replaces the bundle at that position with the one included in the package being installed, regardless of how its version compares with the one already on disk. Is this what you were looking for?

I don’t think there’s a similar option for data files though

2 Likes

You can do what @yfede suggests but especially for AAX plugins due to the signing and the risk of breaking the signature (the PACE one) I would recommend adding a pre-install script that removes everything, it’s not very hard to do. This also means if the location of anything has changed you can remove the old versions, or for example I’ve had to deal with the location of presets moving so the script has even dealt with copying user presets into a new location to prevent having to ask users to do it.

3 Likes

I used a pre-install script for the reason you have meantioned!

1 Like