I am currently developing a package for the Symantec Endpoint Protection antivirus.
I have a few questions that I haven't found answers to on the wiki.
What is the command to exit the installation?
Exit isn't that. "return 0"?
Is there a variable to indicate to Wapt an installation error?
Is there a way to prevent installation on client-type Windows operating systems (as opposed to server-type systems, for example, Windows Server 2016)?
I'm using the registry. But is there a better way?
I love Python, it's a great language!
Code: Select all
# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
NomDuLogiciel = "Symantec Endpoint Protection"
VersionAinstaller = "14.2.770.0000"
def install():
VersionInstaller = "0"
VersionOs = registry_readstring(HKEY_LOCAL_MACHINE,r'SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'InstallationType')
print(VersionOs)
print('WAPT Instalation endpoint Protection')
print('test de la version a installer et celle presente sur le pc')
for soft in installed_softwares(NomDuLogiciel):
print(soft['version'])
VersionInstaller = soft['version']
if VersionInstaller == VersionAinstaller:
print("Pas besoin dinstaller cette version ", VersionAinstaller, " version presente sur pc ", VersionInstaller )
return 0
elif VersionOs != "Client":
print("Pas besoin dinstaller cette version ", VersionAinstaller, " uniquement pour les version windows client", VersionInstaller )
return 0
else:
print('Ce pc a besoin de Symantec Endoint protection ', VersionAinstaller)
run('EndPointProtectionclient.exe /s')
def uninstall():
for soft in installed_softwares(NomDuLogiciel):
print('desinstallation automatique Symantec endpoint Protection de ', control['version'].split('-',1)[0] )
run(WAPT.uninstall_cmd(soft['key']))
