wapt-fabulatech-webcam-work.../setup.py

42 lines
1.7 KiB
Python
Raw Normal View History

2019-07-31 14:40:11 +02:00
# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
def install():
print("Installing Fabulatech-Workstation")
version = control['version'].split('-',1)[0]
if iswin64():
arch='64'
else:
arch='32'
install_msi_if_needed('webcam-for-remote-desktop-workstation-%sbit.msi' % (arch), min_version=version, remove_old_version=True, killbefore=['ftwebcamwkssvc.exe','ftnlsv.exe'])
def update_package():
import re, os
from waptpackage import PackageEntry
print('Updating Fabulatech-Workstation')
page = wgets('https://www.fabulatech.com/webcam-for-remote-desktop-download.html')
latest_version = re.search('Download Webcam for Remote Desktop (\d+(.\d+)*) for Windows', page).group(1)
pe = PackageEntry()
control = pe.load_control_from_wapt(os.getcwd())
version = control['version'].split('-',1)[0]
if Version(latest_version) > Version(version):
for arch in ['32', '64']:
for old in glob.glob(r'webcam-for-remote-desktop-workstation-%sbit.msi' % arch):
remove_file(old)
if not isfile('webcam-for-remote-desktop-workstation-%sbit.msi' % (arch)):
filename ='webcam-for-remote-desktop-workstation-%sbit.msi' % (arch)
url = 'https://www.fabulatech.com/%s' % filename
print('Downloading version %s from %s' % (latest_version, url))
wget(url, filename)
if Version(latest_version) > Version(control['version'].split('-',1)[0]):
pe.version = latest_version + '-0'
pe.save_control_to_wapt(os.getcwd())
if __name__ == '__main__':
update_package()