[SOLVED] Package creation problem: PDF24

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
DominiqueG
Messages: 2
Registration: Oct 23, 2018 - 06:21

October 24, 2018 - 03:59

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
Last edited by DominiqueG on Oct 26, 2018 - 06:02, edited 1 time.
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

October 24, 2018 - 3:08 PM

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
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
DominiqueG
Messages: 2
Registration: Oct 23, 2018 - 06:21

October 26, 2018 - 06:43

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
Locked