Page 1 of 1

Block the installation of a package

Published: Dec 17, 2025 - 5:02 PM
by Damien Touraine
Hello,
In what order are package installations evaluated on the machine?
We need to deploy a package to an OU, but some agents MUST NOT deploy it. So, if it evaluates the addition first and then the conflict, it might add the package and then remove it when it detects the conflict.

I was thinking of adding the package in question to the "conflicts" list of the affected computers. But are we sure the package will never install while it's in a conflict?
What happens if we install a new version of the package? Will the new version still be considered a conflict, or should we add the new version to the conflict list?

Sincerely,
Damien

Re: Blocking the installation of a package

Published: Dec 18, 2025 - 09:08
by htouvet
There is no concept of "exception" when you put a dependency in place.
So if the package is placed as a dependency on the OU, all machines in that OU are expected to install it.

The safest way to prevent machines from installing the software or configuration is to put the rule in the setup.py / install code of the package itself with an "if" condition.
It is obviously necessary to be able to code the criterion (machine name? group membership? machine type?)

Code: Select all

from setuphelpers import *

exclusions = ['pc1','pc2','pc10']

def install():
    if not get_computername in exclusions:
        install_msi_if_needed('logiciel_install.msi')

Re: Blocking the installation of a package

Published: January 6, 2026 - 5:52 PM
by Damien Touraine
Hello,
I don't have direct access to the package.
But I don't understand: if the package is marked as "conflict" on one machine and then deployed to an OU where that machine is located,
what happens?
Will it first install it on the machine and then uninstall it?
Sincerely,
Damien

Re: Blocking the installation of a package

Published: January 7, 2026 - 7:15 PM
by vcardon
Hello, WAPT uninstalls conflicting packages (attributed to "conflicts") before installing dependent packages (attributed to "depends") of the machine package.

It needs testing, but it should work for your use case.