From 7fbe0b271abff3312d5a04d2774f12fca5753b87 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 17 Apr 2019 17:58:44 +0200 Subject: [PATCH] Write package setup and add msi for x64 and x86 --- WAPT/control | 6 +++--- ddaddin32.msi | 3 +++ ddaddin64.msi | 3 +++ setup.py | 22 +++++++++++++++++----- 4 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 ddaddin32.msi create mode 100644 ddaddin64.msi diff --git a/WAPT/control b/WAPT/control index fc8eeb3..efdab1c 100644 --- a/WAPT/control +++ b/WAPT/control @@ -1,5 +1,5 @@ package : fws-outlook-ddaddin -version : 1.0.12-0 +version : 1.0.12-3 architecture : all section : base priority : optional @@ -7,7 +7,7 @@ maintainer : Daniel Berteaud description : Drag and Drop from Outlook to Web Page, SAP, Java, etc. depends : conflicts : -maturity : DEV +maturity : PROD locale : target_os : windows min_os_version : @@ -29,4 +29,4 @@ package_uuid : signer : signer_fingerprint: signature_date : -signed_attributes : +signed_attributes : \ No newline at end of file diff --git a/ddaddin32.msi b/ddaddin32.msi new file mode 100644 index 0000000..7a8f3ba --- /dev/null +++ b/ddaddin32.msi @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54bde9ad1e9d5bc29daaf501caddccf8072be1e86d3172f63340dfdc17e0b14a +size 699904 diff --git a/ddaddin64.msi b/ddaddin64.msi new file mode 100644 index 0000000..1e9ea2c --- /dev/null +++ b/ddaddin64.msi @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b92a59825f408a83db704e3a44ed6d5a043dd67c04cb696f1ac86245feb4a82 +size 1300992 diff --git a/setup.py b/setup.py index 0f1cba2..ab2a723 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,29 @@ # -*- coding: utf-8 -*- from setuphelpers import * -import json -from cryptography.fernet import Fernet -import os -from jinja2 import Environment, FileSystemLoader uninstallkey = [] +variables = { + # 'ddaddin_license': '[2][FWS #-1][2019-04-17 12:41:43][-1][21][123456789]' +} # Read local variables file if available if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(makepath(programfiles32,'wapt','private','variables.txt')): print('Reading local encrypted variables file') + from cryptography.fernet import Fernet + import yaml f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read()) - variables.update(json.loads(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))) + variables.update(yaml.safe_load(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))) def install(): + version = control['version'].split('-',1)[0] + print('Installing Outlook DDAddin plugin %s' % version) + if not 'ddaddin_license' in variables: + error('DDAddin license not set in variables, can\'t install') + props = { + 'DDADDIN_LICENSE': '"' + variables['ddaddin_license'] + '"' + } + install_msi_if_needed('ddaddin32.msi',min_version=version,properties=props) + # On x64, install both versions + if iswin64(): + install_msi_if_needed('ddaddin64.msi',min_version=version,properties=props) \ No newline at end of file