From 53782e49fbe66245f84df43790fca9e6eeb08c31 Mon Sep 17 00:00:00 2001 From: Pierre Cosson Date: Wed, 28 Oct 2026 08:19:39 +0000 Subject: [PATCH] Ajouter setup.py --- setup.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..ccf5720 --- /dev/null +++ b/setup.py @@ -0,0 +1,36 @@ +from setuphelpers import * + +def get_computer_type(): + chassis_types = run_powershell( + '(Get-CimInstance Win32_SystemEnclosure).ChassisTypes' + ) + + if not isinstance(chassis_types, list): + chassis_types = [chassis_types] + + laptop_types = {8, 9, 10, 14, 30, 31, 32} + desktop_types = {3, 4, 5, 6, 7, 13, 15, 16, 24} + + chassis = {int(t) for t in chassis_types if t is not None} + + if chassis & laptop_types: + return "laptop" + elif chassis & desktop_types: + return "desktop" + else: + return "unknown" + + +def install(): + computer_type = get_computer_type() + + if computer_type == "laptop": + print("Portable détecté") + # Configuration laptop + + elif computer_type == "desktop": + print("Poste fixe détecté") + # Configuration desktop + + else: + print("Type de machine inconnu") \ No newline at end of file