[SOLVED] Symantec Endpoint package and client system

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
skoizer
Messages: 54
Registration: June 19, 2018 - 4:45 PM

October 17, 2018 - 12:51

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']))
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

October 20, 2018 - 09:51

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
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
skoizer
Messages: 54
Registration: June 19, 2018 - 4:45 PM

October 22, 2018 - 10:14

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')
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

October 24, 2018 - 3:58 PM

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
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Locked