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

50 lines
1.8 KiB
Python
Raw Permalink Normal View History

2019-07-31 14:40:11 +02:00
# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
def install():
2019-08-01 11:45:51 +02:00
print("Installing Fabulatech Webcam RDP Workstation")
2019-07-31 14:40:11 +02:00
version = control['version'].split('-',1)[0]
if iswin64():
2019-08-01 15:20:49 +02:00
msi='webcam-for-remote-desktop-workstation-64bit.msi'
2019-07-31 14:40:11 +02:00
else:
2019-08-01 15:20:49 +02:00
msi='webcam-for-remote-desktop-workstation-32bit.msi'
2019-07-31 14:40:11 +02:00
2019-08-01 11:05:11 +02:00
install_msi_if_needed(
msi,
min_version=version,
remove_old_version=True,
killbefore=['ftwebcamwkssvc.exe','ftnlsv.exe']
)
2019-07-31 14:40:11 +02:00
def update_package():
import re, os
from waptpackage import PackageEntry
2019-08-01 11:45:51 +02:00
print('Updating Fabulatech Webcam RDP Workstation')
2019-07-31 14:40:11 +02:00
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):
2019-08-01 11:45:51 +02:00
print('Found new version %s, updating ...' % (latest_version))
2019-07-31 14:40:11 +02:00
for arch in ['32', '64']:
2019-08-01 11:45:51 +02:00
print('Remove old binary %sbit' % (arch))
2019-07-31 14:40:11 +02:00
for old in glob.glob(r'webcam-for-remote-desktop-workstation-%sbit.msi' % arch):
remove_file(old)
2019-08-01 11:45:51 +02:00
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)
pe.version = latest_version + '-0'
pe.maturity = 'PREPROD'
pe.save_control_to_wapt(os.getcwd())
else:
print('No update found, version %s is aleready the latest' % (latest_version))
2019-07-31 14:40:11 +02:00
if __name__ == '__main__':
update_package()