Page 1 of 1

[SOLVED] Creating Sphinx v5 software package

Published: Dec 14, 2017 - 09:38
by olaplanche
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

Re: Creating Sphinx v5 software package

Published: Dec 19, 2017 - 6:57 PM
by dcardon
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'`

Re: Creating Sphinx v5 software package

Published: Dec 20, 2017 - 09:05
by olaplanche
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.

Re: Creating Sphinx v5 software package

Published: Dec 14, 2018 - 1:37 PM
by olaplanche
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')