# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = ['VSDC Free Video Editor_is1']
def install():
softname = 'VSDC Free Video Editor'
versionsoft = '3.2.1.373'
check_installed = installed_softwares(softname)
# si cette liste globale n est pas vide, on check chaque logiciel
if check_installed:
# boucle pour chaque logiciel trouvée
for uninstall in check_installed:
if uninstall['version'] == versionsoft :
print(u'The software is already installed' )
return (0);
if uninstall['version'] > versionsoft :
print(u'The software is already installed and its version is newer than the version of the package' )
return (0);
#Recherche du Logiciel logiciel
check_installed_soft = installed_softwares(softname)
# si cette liste globale n est pas vide on remove chaque logiciel
if check_installed_soft:
# boucle pour chaque logiciel trouvee
for uninstall in check_installed_soft:
# Si la version est differente que la version du fichier controle:
if uninstall['version'] < versionsoft:
print(u'remove old software' )
# Surpression grece a la a la uninstall string présente dans la uninstall key.
cmd = WAPT.uninstall_cmd(uninstall['key'])
run(cmd)
print('installing smp-vsdcfreevideoeditor')
run(r'"video_editor.exe" /VERYSILENT')
check_installed_out = installed_softwares(softname)
if check_installed_out:
for uninstall in check_installed_out:
if uninstall['version'] == versionsoft:
print(u'The software installation was successful')
return (0);
for uninstall in check_installed_out:
if uninstall['version'] > versionsoft:
print(u'The software is already installed and its version is newer than the version of the package' )
return (0);
for uninstall in check_installed_out:
if uninstall['version'] != versionsoft:
error('The output verification has found a old version of software')
error('End audit did not find the software.')