Page 1 of 1

[SOLVED] Package creation problem: PDF24

Published: October 24, 2018 - 03:59
by DominiqueG
Hello everyone

After turning the problem over and over in my mind, I still haven't found the solution.

I'm looking to create a Wapt package for PDF24 With the MSI, I keep getting an error with the uninstallation key version:

Code: Select all

2018-10-23 11:14:03,700 CRITICAL Fatal error in install script: EWaptSetupException: Fatal error : MSI pdf24-creator-8.6.1.msi has been installed and the uninstall key {E6280618-D2EA-48D8-9CCA-D50BCCDBCD62} found but version is not good:
Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\common.py", line 3512, in install_wapt
    exitstatus = setup.install()
  File "c:\waptdev\ire-pdf24-creator-wapt\setup.py", line 53, in install
    install_msi_if_needed('pdf24-creator-%s.msi' %versionsoft, 'AUTOUPDATE=[No] DESKTOPICONS=[No] FAXPRINTER=[No] /[QN]',get_version=getversionpdf24, killbefore=['pdf24.exe'])
  File "C:\Program Files (x86)\wapt\common.py", line 3471, in new_func
    return func(*args,**kwargs)
  File "C:\Program Files (x86)\wapt\setuphelpers.py", line 3917, in install_msi_if_needed
    error('MSI %s has been installed and the uninstall key %s found but version is not good' % (msi,key))
  File "C:\Program Files (x86)\wapt\setuphelpers.py", line 4305, in error
    raise EWaptSetupException(u'Fatal error : %s' % reason)
EWaptSetupException: Fatal error : MSI pdf24-creator-8.6.1.msi has been installed and the uninstall key {E6280618-D2EA-48D8-9CCA-D50BCCDBCD62} found but version is not good

However, the version and uninstallation key do appear in the MSI properties:

Code: Select all

version_msi = get_msi_properties('pdf24-creator-%s.msi' %versionsoft)
print(version_msi)
    
    ## me retourne :
{u'PRIMARYFOLDER': u'INSTALLDIR', u'UpgradeCode': u'{8D2DF301-CE53-4939-81C2-D659E7B857BE}', u'WixUI_Mode': u'FeatureTree', u'FAXPRINTER': u'Yes', u'SecureCustomProperties': u'INSTALLDIR;PREVIOUSVERSIONSINSTALLED', u'AUTOUPDATE': u'No', u'ALLUSERS': u'1', u'ARPPRODUCTICON': u'ProductIcon.exe', u'DefaultUIFont': u'WixUI_Font_Normal', u'ProductLanguage': u'1033', u'ARPHELPLINK': u'http://www.pdf24.org', u'PROGRAMMENU': u'Yes', u'INSTALLLEVEL': u'3', u'Manufacturer': u'www.pdf24.org', u'ProductCode': u'{E6280618-D2EA-48D8-9CCA-D50BCCDBCD62}', u'ARPURLUPDATEINFO': u'http://www.pdf24.org', u'ProductVersion': u'8.6.1', u'ErrorDialog': u'ErrorDlg', u'EXEUNINSTALL': u'False', u'WixUIRMOption': u'UseRM', u'UPDATEMODE': u'1', u'DESKTOPICONS': u'Yes', u'ProductName': u'PDF24 Creator', u'InstallMode': u'Complete'}


 wapt-get list-registry pdf24
 
     ## me retourne :
     
UninstallKey                           Software        Version      Uninstallstring
------------------------------------------------------------------------------------------------------------------------
{E6280618-D2EA-48D8-9CCA-D50BCCDBCD62} PDF24 Creator   8.6.1        MsiExec.exe /I{E6280618-D2EA-48D8-9CCA-D50BCCDBCD62}
What I've already tried:

* Look for a solution in the Wapt documentation: https://www.wapt.fr/fr/doc/Frequent-pro ... s-not-good

* Tried to force the version in the command

Code: Select all

    versionsoft = control['version'].split('-',1)[0]
    def getversionpdf24(key):
        return get_msi_properties('pdf24-creator-%s.msi' %versionsoft)['ProductVersion']
    install_msi_if_needed('pdf24-creator-%s.msi' %versionsoft, 'AUTOUPDATE=[No] DESKTOPICONS=[No] FAXPRINTER=[No] /[QN]',get_version=getversionpdf24, killbefore=['pdf24.exe'])

Does anyone have any ideas?
Thank you in advance


System :
* Wapt server Windows 7 64-bit
* Package creation machine: Win7 64-bit / pyscripter

PS1: Arguments for the installer with the MSI: https://help.pdf24.org/en/forums/topic/ ... -arguments
https://help.pdf24.org/en/forums/topic/ ... -arguments

PS: As an alternative, I know there's PDF Creator on the WAPT repository, but it annoys me by constantly prompting me to install another program every time I print. Personally, I find PDF24 cleaner

PS3: I tried to use other scripts as inspiration for the update_package() function, but I couldn't find a solution. If anyone has any ideas to help me move forward, I'd appreciate it :D

Re: Problem creating package: PDF24

Published: October 24, 2018 - 3:08 PM
by dcardon
Hello DominiqueG,
DominiqueG wrote: Oct 24, 2018 - 03:59

Code: Select all

    versionsoft = control['version'].split('-',1)[0]
    def getversionpdf24(key):
        return get_msi_properties('pdf24-creator-%s.msi' %versionsoft)['ProductVersion']
    install_msi_if_needed('pdf24-creator-%s.msi' %versionsoft, 'AUTOUPDATE=[No] DESKTOPICONS=[No] FAXPRINTER=[No] /[QN]',get_version=getversionpdf24, killbefore=['pdf24.exe'])
On the `install_msi_if_needed` line, "properties" is a named variable. If "properties" is omitted, it becomes a positional variable and replaces the min_version number. And it's well known that AUTOUPDATE > 8.6.1...

Code: Select all

install_msi_if_needed('pdf24-creator-8.6.1.msi', properties={'AUTOUPDATE':'[No]','DESKTOPICONS':'No','FAXPRINTER':'[No]'})
If you have several interesting packages, you can create your own personal repository, like Simon did with the web ants. All you need is a web server and to generate a Packages file. To generate the Packages index file, you need the wapt-scanpackages.py tool; it used to come with the tis-waptrepo package, but now it's included directly in the tis-waptserver package. Worth checking out.

Sincerely,

Denis

Re: [SOLVED] Package creation problem: PDF24

Published: October 26, 2018 - 06:43
by DominiqueG
Hi @dcardon

Nilkel, it works great, :D thank you very much.

Regarding the code, I'll try to do that, but I think I'll just put the script on a Git repository.

Actually, and to give you some background, I'm working on a ship laying submarine cables around the world. While these cables, once operational, will easily exceed 1 terabyte per second per fiber pair, on board we're stuck with a meager satellite internet connection, roughly 256K for about 30 workstations...

It's incredibly slow, and all this to say that managing program updates (in addition to their centralized installation) is a real challenge, and your solution is particularly interesting.

For the moment, I'm just rewriting the packages so they include both 64-bit and 32-bit installers. But when I know a bit more, I'll share everything.

By the way, if anyone finds a way to create an `update()` function for this package, I'd be interested.

The download link is simple: https://www.pdf24.org/products/pdf-crea ... reator.msi,
but I'm having trouble setting up the check for a new version before starting the download.

Sincerely,
Dominique