Ajouter setup.py
This commit is contained in:
commit
53782e49fb
1 file changed
+36
@@ -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")
|
||||
Reference in new issue
Block a user