IBM Notes Package

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
FGA Intern
Messages: 4
Registration: June 18, 2015 - 12:17

June 18, 2015 - 1:56 PM

Good morning,

I need to create a package for an application that is not available in the official TIS repositories.
IBM Notes 9.0.1

I have two executables; the first cleanly uninstalls any version of Lotus Notes that might be installed on the client machine. The second installs IBM Notes 9.0.1.

I managed to create one package for uninstalling and another for installing separately, it works very well, but unfortunately it does not handle remote uninstallation, you have to alternate with the packages and it's not really a great technique.

So I end up with two packages, two scripts, completely independent.

Code: Select all

def install():
    print('Désinstallation de IBM Notes')
    run(r'"nice.exe" -rp -rd -wipe /qn+')

Code: Select all

def install():
    print('Installation de IBM Notes 9.0.1')
    run(r'"IBM_NOTES_CLIENT_9.0.1_WIN_FR.exe" -s -a /s /v"ADDFEATURES=NotesPlugin /qn+"')
I would like :
  1. Merge the two codes so that you can install or uninstall from the console using the dedicated button, instead of switching between two separate packages.
  2. When installing on a machine, check if Notes is already installed; if so, uninstall it first
  3. Knowing how to stop services and processes in Python.
I am not necessarily asking you to provide the code directly (that would be really nice, but I am not asking for that much), among the applications in the official repository, there must surely be an example using the same installation scheme to inspire me.

Having no knowledge of Python or any other language, it is very difficult for me to create a script without an example.

Thank you in advance.
User avatar
Frédéric Bonnier
Messages: 24
Registration: June 23, 2014 - 10:10
Location: Nantes
Contact :

June 18, 2015 - 2:23 PM

Hello,

I think the LibreOffice package can help you: http://wapt.tranquil.it/wapt/tis-libreo ... 0_all.wapt.

It detects if OpenOffice is installed, and if so, it uninstalls it. The same goes for other versions of LibreOffice.

As a last resort, we organize WAPT training sessions. :D

- Frédéric
Frédéric Bonnier - Tranquil IT Systems.
Display yourself on the WAPT user map by completing the questionnaire.
Discover our service offerings at Tranquil IT Systems and join us on Twitter.
FGA Intern
Messages: 4
Registration: June 18, 2015 - 12:17

June 19, 2015 - 10:34

Thank you, I was inspired by the LibreOffice suite to a lesser extent. Here is the code I created:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *
import os

uninstallkey = []
uninstallstring = []

def install():
	if os.path.exists("C:\Program Files (x86)\IBM\Notes" or "C:\Program Files (x86)\IBM\Lotus\Notes"):
		print('Désinstallation des anciennes version de Notes')
		run(r'"IBM_Notes\nice.exe" -rp -rd -wipe /qn+')
		print('Installation de IBM Notes 9.0.1')
		run(r'"IBM_Notes\IBM_NOTES_CLIENT_9.0.1_WIN_FR.exe" -s -a /s /v"ADDFEATURES=NotesPlugin /qn+"')
	else:
		print('Installation de IBM Notes 9.0.1')
		run(r'"IBM_Notes\IBM_NOTES_CLIENT_9.0.1_WIN_FR.exe" -s -a /s /v"ADDFEATURES=NotesPlugin /qn+"')
I don't quite understand how uninstalling from the console works.
Notably
uninstallkey = []
uninstallstring = []

In the documentation, for uninstallstring it says "command line to launch the software uninstallation." So I quickly added:

Code: Select all

run(r'"IBM_Notes\IBM_NOTES_CLIENT_9.0.1_WIN_FR.exe" -s -a /s /v"ADDFEATURES=NotesPlugin /qn+"')
I tried it in brackets, but without success.

For uninstallkey = [], is it up to us to find the registry key that allows us to uninstall the software, or does WAPT handle retrieving it during installation? Because I've noticed that it's not often filled in, and the same goes for uninstallstring = [], which isn't always used.

Thank you for your time.
FGA Intern
Messages: 4
Registration: June 18, 2015 - 12:17

June 24, 2015 - 3:33 PM

I managed on my own and eventually I understood how packages work, especially uninstallation using the registry.
Here is my script, perhaps it will be useful to others.

Code: Select all

# -*- coding: utf-8 -*-

from setuphelpers import *
import platform

uninstallkey = []

def uninstall():
	# liste des logiciels nommés notes
	notes = installed_softwares('notes')
	# si cette liste n'est pas vide, on desinstalle explicitement chaque logiciel
	if notes:
		# boucle pour chaque logiciel trouvé
		for uninstall in notes:
			# on regarde si la version 9 est installée
			if uninstall['version'].startswith('9.'):
				# on recupere la commande de desinstallation correspondant à la clé du logiciel
				cmd = WAPT.uninstall_cmd(uninstall['key'])
				print(u'uninstalling %s' % (uninstall['name'],))
				# on execute la commande de desinstallation
				run_notfatal(cmd)
				# on supprime les dossiers restants
				run_notfatal(r'rmdir "C:\Program Files (x86)\IBM" /s /q ')

def install():
	# liste des logiciels nommés notes
	old_notes = installed_softwares('notes')
	zipmail = installed_softwares('zipmail')
	swiftfile = installed_softwares('swiftfile')
	# si zipmail est installé on desinstalle explicitement chaque logiciel
	if zipmail:
		# boucle pour chaque logiciel trouvé
		for uninstall in zipmail:
			# on regarde si la version 12 est installée
			if uninstall['version'].startswith('12.'):
				# on recupere la commande de desinstallation correspondant à la clé du logiciel SwiftFile 4.2
				cmd = WAPT.uninstall_cmd(uninstall['key'])
				print(u'uninstalling %s' % (uninstall['name'],))
				# on execute la commande de desinstallation
				run_notfatal(cmd)
	# pour désinstaller les anciennes version de zipmail
	zipmail = installed_softwares('zipmail')
	if zipmail:
		print('Supression de Zipmail v10')
		run_notfatal(r'C:\Windows\IsUn040c.exe -a -x -f"c:\Program Files (x86)\IBM\Lotus\Notes\Data\zmlnl.isu" -c"C:\Program Files (x86)\IBM\Lotus\Notes\Uninst.dll')
	# si swiftfile est installé on desinstalle explicitement chaque logiciel
	if swiftfile:
		# boucle pour chaque logiciel trouvé
		for uninstall in swiftfile:
			# on regarde si la version 4.2 est installée
			if uninstall['version'].startswith('4.2'):
				# on recupere la commande de desinstallation correspondant à la clé du logiciel SwiftFile 4.2
				cmd = WAPT.uninstall_cmd(uninstall['key'])
				print(u'uninstalling %s' % (uninstall['name'],))
				# on execute la commande de desinstallation
				run_notfatal(cmd)
	# pour désinstaller les anciennes version de zipmail
	zipmail = installed_softwares('zipmail')
	if swiftfile:
		print('Supression de SwiftFile 4.00')
		run_notfatal(r'MsiExec.exe /qn /x {34843AB3-8DBA-4388-8838-080635E1EDB6}')
	# si notes est installé, on desinstalle explicitement chaque logiciel
	if old_notes:
		# boucle pour chaque logiciel trouvé
		for uninstall in old_notes:
			# on regarde si la version 8 est installée
			if uninstall['version'].startswith('8.'):
				print('Supression de Notes 8.x')
				run_notfatal(r'"nice.exe" -rp -rd -wipe /qn')
			if uninstall['version'].startswith('9.'):
				print('Supression de Notes 9.x')
				run_notfatal(r'"nice.exe" -rp -rd -wipe /qn')
			# on supprime les dossiers restants
			run_notfatal(r'rmdir "C:\Program Files (x86)\IBM" /s /q ')
	
	# on installe ibm notes
	print('Installation de IBM Notes 9.0.1')
	run_notfatal(r'"IBM_NOTES_CLIENT_9.0.1_WIN_FR.exe" -s -a /s /v"ADDFEATURES=NotesPlugin,ClientSingleLogon /qn+"')
ZipMail and SwftFile software are specific to the workstations on which our software is deployed; adapt the script according to your needs.
Locked