# -*- coding: utf-8 -*-
from setuphelpers import *
"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()
"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
def install():
# Declaring local variables
remove_programs_menu_shortcut("Navigatis")
# remove_user_desktop_shortcut('Navigatis')
if isfile(makepath(user_appdata, "Microsoft", "Windows", "Start Menu", "Programs", "Startup", "LanceurOperisFlexConnect.exe")):
print("le fichier est present")
remove_file(makepath(user_appdata, "Microsoft", "Windows", "Start Menu", "Programs", "Startup", "LanceurOperisFlexConnect.exe"))
else:
print("pas flexconnect")
if isdir(makepath(user_local_appdata, "Programs", "Operis")):
remove_tree(makepath(user_local_appdata, "Programs", "Operis"))
print("Operis present, desinstallation")
else:
print("Operis local non present")
# Installing the software
print("Installing: %s" % control.package)
install_msi_if_needed("Navigatis_V2.1.0.6_x86_ProgramFiles.msi")
run(r'regsvr32 /s "C:\Program Files (x86)\Operis\Navigatis\ocx\HCSFP-V1.0.ocx"')
registry_setstring(HKEY_LOCAL_MACHINE, "SOFTWARE\\OPERIS\\Navigatis", "repertoire", "C:\\Program Files (x86)", type=REG_SZ)
registry_setstring(HKEY_LOCAL_MACHINE, "SOFTWARE\\OPERIS\\Navigatis", "version", "2.1.0.6", type=REG_SZ)
registry_setstring(HKEY_LOCAL_MACHINE, "SOFTWARE\\OPERIS\\Navigatis", "repository", "https://server_fqdn/Oxalis", type=REG_SZ)
registry_setstring(HKEY_LOCAL_MACHINE, "SOFTWARE\\OPERIS\\Navigatis", "defaut", "Oxalis", type=REG_SZ)
registry_setstring(HKEY_LOCAL_MACHINE, "SOFTWARE\\OPERIS\\Navigatis", "bloquerMajAuto", "1", type=REG_SZ)
registry_setstring(HKEY_LOCAL_MACHINE, "SOFTWARE\\OPERIS\\Navigatis\\favoris", "Oxalis", "Oxalisñhttps://server_fqdn/Oxalis/", type=REG_SZ)
registry_setstring(
HKEY_LOCAL_MACHINE, "SOFTWARE\\OPERIS\\Navigatis\\favoris", "OperisAdmin", "OperisAdminñhttps://server_fqdn/Oxalis/OperisAdmin", type=REG_SZ
)
registry_setstring(
HKEY_LOCAL_MACHINE,
"SOFTWARE\\OPERIS\\Navigatis\\favoris",
"OperisOffice",
"OperisOfficeñhttps://server_fqdn/Oxalis/OperisOffice",
type=REG_SZ,
)
registry_setstring(
HKEY_LOCAL_MACHINE,
"SOFTWARE\\OPERIS\\Navigatis\\favoris",
"OperisRequest",
"OperisRequestñhttps://server_fqdn/Oxalis/OperisRequest",
type=REG_SZ,
)
registry_setstring(HKEY_LOCAL_MACHINE, "SOFTWARE\\OPERIS\\Navigatis\\Preferences", "OpenSIGInWebBrowser", "False", type=REG_SZ)
create_programs_menu_shortcut(
"Navigatis", target=r"C:\Program Files (x86)\Operis\Navigatis\navigatis.exe", wDir=r"C:\Program Files (x86)\Operis\Navigatis"
)
create_desktop_shortcut(
"Navigatis", target=r"C:\Program Files (x86)\Operis\Navigatis\navigatis.exe", wDir=r"C:\Program Files (x86)\Operis\Navigatis"
)
print("%s est installé" % control.name)
def uninstall():
# Désincription de l'ocx
run(r'regsvr32 /u /s "C:\Program Files (x86)\Operis\Navigatis\ocx\HCSFP-V1.0.ocx"')
# run(r'MsiExec.exe /X{54705012-50C7-4742-9137-1E375A6897AD} /qn')
# Suppression des clés de registre
registry_deletekey(HKEY_LOCAL_MACHINE, "SOFTWARE", "OPERIS")
# Suppression des raccourcis
remove_desktop_shortcut("Navigatis")
remove_programs_menu_shortcut("Navigatis")
def session_setup():
if isfile(makepath(user_appdata, "Microsoft", "Windows", "Start Menu", "Programs", "Startup", "LanceurOperisFlexConnect.exe")):
print("le fichier est present")
remove_file(makepath(user_appdata, "Microsoft", "Windows", "Start Menu", "Programs", "Startup", "LanceurOperisFlexConnect.exe"))
else:
print("pas flexconnect")
remove_file(makepath(user_appdata, "Microsoft", "Windows", "Start Menu", "Programs", "Startup", "LanceurOperisFlexConnect.exe"))
if isdir(makepath(user_local_appdata, "Programs", "Operis")):
remove_tree(makepath(user_local_appdata, "Programs", "Operis"))
print("Operis present")
else:
print("Operis local non present")