Page 1 of 1

[SOLVED] Symantec Endpoint package and client system

Published: October 17, 2018 - 12:51
by skoizer
Good morning,
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']))

Re: Symantec Endpoint protection and client system package

Published: October 20, 2018 - 09:51
by dcardon
Hello Skoizer,
skoizer wrote: Oct 17, 2018 - 12:51 PM I'm currently creating a package for 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 it. "return 0"?
A `sys.exit(1)` kills the current Python process, so yes, it's not a good option. `return 0` should do the trick if everything went smoothly.

skoizer wrote: Oct 17, 2018 - 12:51 Is there a variable to indicate to Wapt an installation error?
a raise('error during installation') should do the trick.

skoizer wrote: Oct 17, 2018 - 12:51 Is there a way to prevent installation on client-type Windows operating systems (different from server-type systems, for example, Windows Server 2016)?
I'm using the registry. But is there a better way?
The difference between a server and a client is very subjective. A server provides a service, a client consumes it, and a machine can be both a client and a server. I know quite a few places that host virtualized Windows 7 systems for small business applications. If the registry key you provided works for you, that's great. Otherwise, you can create a "client workstation" group and a "server workstation" group and assign your package to the correct group.

skoizer wrote: Oct 17, 2018 - 12:51 I love Python, great language!
That's WAPT's great strength: no need to learn an exotic language. And the setuphelpers library makes things incredibly easy. Many deployment environments create their own pseudo-language to define deployment steps. From my perspective, Python is much more suitable because it's more widespread and easy to debug: just set a breakpoint in PyScripter and you're good to go!

Sincerely,

Denis

Re: Symantec Endpoint protection and client system package

Published: October 22, 2018 - 10:14 AM
by skoizer
Thanks Drcaron for your answers.
It shocks me when you tell me that a client OS can act as a server.
This is not considered good practice.
I have already created a "Client and server" group, but nothing prevents a mistake from installing this on a server.
This can have unfortunate consequences, as an antivirus client can block essential applications.
So I do a check and I put a raise('error during installation, only for client-type OS')

for the raise
It's more like this

Code: Select all

raise Exception('Symantec Endpoint Protection uniquement pour les versions client, Pas besoin dinstaller cette version')

Re: Symantec Endpoint protection and client system package

Published: October 24, 2018 - 3:58 PM
by dcardon
skoizer wrote: Oct 22, 2018 - 10:14 Thanks drcaron for your answers
Nice to meet you, I'm dcardon... :-)

skoizer wrote: Oct 22, 2018 - 10:14 AM It shocks me when you say that a client OS can act as a server.
That's not good practice.
It depends on your machine configuration. A Debian machine can be used as a workstation or a server, depending on what you install on it. I have no problem using Debian as a server. :-) If all Windows servers were installed in core mode, I might reconsider what I said...

skoizer wrote: Oct 22, 2018 - 10:14 AM I've already created a "Client and Server" group, but nothing prevents a mistake and installing it on a server.
This could have unfortunate consequences, as an antivirus client might block essential applications.
So I'm performing a check and adding a `raise('error during installation, only for client-type OS')`.
This means that system administrators are also human, because they also make mistakes!

skoizer wrote: Oct 22, 2018 - 10:14 for the raise
It's more like this

Code: Select all

raise Exception('Symantec Endpoint Protection uniquement pour les versions client, Pas besoin dinstaller cette version')
Indeed, my fingers slipped on my keyboard

Sincerely,

Denis