Page 1 of 1

[RESOLVED] Improvement idea: Options during package deployment

Published: January 6, 2021 - 11:37 AM
by Christophe0110
Hello,

I'd like to suggest an improvement for WAPT (I use WAPT Enterprise).
I've often encountered a choice to make during the deployment of a package I've created.
The most obvious example is the installation language.

One of our software programs, which is quite large to install (the package is around 6 GB), has a simple setting during installation allowing users to choose between French and English. Some of our users prefer to work with this software in French, and others in English.
I'd like to avoid having to create several different packages depending on the language, given its size, when it's just a matter of changing a setting.

What would be very useful is to be able to choose a specific option that the Python script could use during installation when adding a package to a machine. A kind of configurable variable, in a way.

I suspect this is a very complex improvement, but I'm putting it out there in case the idea interests you as well.

Best regards,
Christophe.

Re: Improvement idea: Package deployment options

Published: January 6, 2021 - 12:02 PM
by vcardon
Hi Christophe, your use case is covered. ;)

You should be able to manage using the dependency principle.

- package "generic 6GB software"
- package "software-en" (2KB with a setup.py and a session setup that configures the software in English) with a "depends" 6GB software
- package "software-fr" (2KB with a setup.py and a session setup that configures the software in French) with a "depends" 6GB software.

You deploy "software-en" on the PCs whose users want the 6GB software in English.

The "generic 6GB software" package will install before the "software-en" package.

Re: Improvement idea: Package deployment options

Published: January 6, 2021 - 1:41 PM
by Christophe0110
Hi Vincent,

Thanks for your quick reply. :)

Yes, I was aware of that technique, but in some cases, the parameter in question needs to be passed directly when running setup.exe... So, in the main package...

I also know I could use a package that creates a temporary file on the disk containing my parameters, followed by the main package reading that file to determine which parameter to pass to the setup script, but I think that's a bit of a hack... ;)

Cheers!

Re: Improvement idea: Package deployment options

Published: January 6, 2021 - 5:14 PM
by vcardon
Alternatively, the first package simply copies the 6GB software into a temporary directory without installing it.

Then, the same strategy is applied:

"logiciel-en" executes the installation with the correct parameters, using the .exe or .msi file stored in the temporary directory.

Re: Improvement idea: Package deployment options

Published: January 11, 2021 - 11:06 AM
by jpele
Good morning,

The Firefox example should help you manage your needs:
https://store.wapt.fr/store/tis-firefox

The code snippet:

Code: Select all

    # Translating locale
    for lang in list_lang:
        if control.locale in lang:
            locale = lang
    app_uninstallkey='Mozilla Firefox %s (%s %s)' % (package_version,app_arch,locale)
Sincerely,
Jimmy

Re: Improvement idea: Package deployment options

Published: January 11, 2021 - 11:10 AM
by jpele
With the multi-platform version of Firefox, you will also have other options:

https://store.wapt.fr/store/tis-firefox-multi

Part of the code:

Code: Select all

    # Changing default language
    data = json_load(policies_path)
    my_lang = get_language()
    for select_lang in list_pre_installed_lang:
        if my_lang in select_lang:
            if select_lang == 'en-GB':
                select_lang = 'en-US' 
            default_lang = {"RequestedLocales": ["%s" % select_lang]}
    data['policies'].update(default_lang)
    json_write(policies_path,data,indent=2)

Re: Improvement idea: Package deployment options

Published: January 11, 2021 - 2:54 PM
by Christophe0110
Hi Vincent,

Yes, that's another solution indeed.

Hi Jimmy,

Your example is interesting, thank you. Although this package will check the system language, whereas in my case, I'd like to choose during installation whether it's done in French or English (the OS is always in French).
Anyway, I'll look into it... ;)


Thanks.
Cheers,
Christophe.