[SOLVED] Creating Sphinx v5 software package

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
olaplanche
Messages: 178
Registration: January 26, 2017 - 11:11

December 14, 2017 - 09:38

Good morning,

I am opening a new thread to finalize my Sphinx software installation package.

I found a simpler silent installation procedure than my initial approach in the "character encoding error" thread. Simply create a license.dat file with the correct information in it at the root of the installation folder.
Next, we launch the setup with the following command: install.exe /s

The installation works without problems outside of wapt, however once packaged the installation proceeds but without the license.
Upon closer inspection, I notice that as soon as the install.exe file is executed, the temporary folder for the package is deleted.
I assume, therefore, that the setup doesn't have time to read the license file; is it possible to delay the deletion of the temporary folder?

Just FYI, here's my code:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = []

def install():
    print('installing wapt-sphinxv5')
    install_exe_if_needed("SphinxV5\Install.exe",'/s')

def uninstall():
    run(r'"C:\SphinxV5\licence\UNWISE.EXE" /s C:\SphinxV5\licence\install.log')
    remove_tree(r'C:\SphinxV5')
For your information:
- Installed WAPT version: 1.3.13
- Server OS: Debian Jessie
- Operating system of the administration/package creation machine: Windows 10

THANKS
Last edited by olaplanche on Dec 14, 2018 - 13:37, edited 1 time.
- Installed WAPT version: 2.6.0.16795 Enterprise
- Server OS: Linux / Debian Bookworm
- Administration/package creation machine OS: Windows 10
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

December 19, 2017 - 6:57 PM

Good evening Olaplanche,

the temporary directory created by WAPT during package installation is deleted after the `install()` function executes. Therefore, the file is available when `SphinxV5\Install.exe` is run.

You need to check whether the data file should be placed in the package root directory (`basedir`) or in the SphinxV5 directory (the binary's directory).

Also, pay attention to backslashes; you must either double them or add an 'r'' before the string, e.g., `r'Install\Sphinxv5.exe'`
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
olaplanche
Messages: 178
Registration: January 26, 2017 - 11:11

December 20, 2017 - 9:05 AM

Hello and thank you

The license file must be located in the same folder as the binary.
I just ran a test to confirm my hypothesis with this new code:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = []

def install():
    print('installing wapt-sphinxv5')
    mkdirs(r'c:\temp')
    copytree2('SphinxV5',r'c:\temp\SphinxV5')
    install_exe_if_needed(r'c:\temp\SphinxV5\Install.exe','/s')

def uninstall():
    run(r'"C:\SphinxV5\licence\UNWISE.EXE" /s C:\SphinxV5\licence\install.log')
    remove_tree(r'C:\SphinxV5')
This way, activation works correctly. If I let the installation proceed from the basedir, I clearly see that as soon as install.exe is executed, some of the files in the basedir are deleted (probably those not locked by the binary), including the license file. Consequently, the binary, which is supposed to access it later, can't find it.
- Installed WAPT version: 2.6.0.16795 Enterprise
- Server OS: Linux / Debian Bookworm
- Administration/package creation machine OS: Windows 10
olaplanche
Messages: 178
Registration: January 26, 2017 - 11:11

December 14, 2018 - 1:37 PM

Package finalized!
Here is the final version of the code:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *
import time

uninstallkey = []

def install():
    print('installing wapt-sphinxv5')
    install_exe_if_needed("SphinxV5\Install.exe","/s")
    time.sleep(60)
    killalltasks('Licence.exe')

def uninstall():
    run(r'"C:\SphinxV5\licence\UNWISE.EXE" /s C:\SphinxV5\licence\install.log')
    remove_tree(r'C:\SphinxV5')
- Installed WAPT version: 2.6.0.16795 Enterprise
- Server OS: Linux / Debian Bookworm
- Administration/package creation machine OS: Windows 10
Locked