[RESOLVED] f.lux 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
elelay
Messages: 27
Registration: Oct 20, 2020 - 12:39

June 4, 2021 - 11:10

Good morning,

I'm trying to create a package for the small tool f.lux.
The problem is that f.lux installs itself in the PC's user profiles and more specifically in the AppData Local directory.
And since the installation is launched as NT Authority\System, f.lux tries to install itself in the system's user profile, which obviously does not exist and therefore returns an error.
install_error.png
install_error.png (9.31 KiB) Viewed 3424 times
Ignoring the error makes everything work, but it's not very clean.
Is there a way, for example, to launch this installation as another user? Like the local administrator account?

Here is my current code:

Code: Select all

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

bin_name = 'flux-setup.exe'
package_version = control.version.split('-',1)[0]

def install():
    killalltasks("flux.exe")
    install_exe_if_needed(bin_name,'/S /alluser',key='',min_version=package_version)

def uninstall():
    killalltasks("flux.exe")
    for user in local_users_profiles():
        flux_uninstall_path = makepath(user, '\AppData\Local\FluxSoftware\Flux\uninstall.exe')
        if isfile(flux_uninstall_path):
            run('{} /S'.format(flux_uninstall_path))
Last edited by elelay on June 8, 2021 - 09:11, edited 1 time.
WAPT Server version: 2.0 Enterprise
Console installed on a Windows Server 2019
Debian 10 Buster server
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

June 4, 2021 - 11:47

Hello elelay,

one way to deal with this kind of podoware is to have the install() function copy the file to c:\program files\f.lux and then have session_setup() launch the installation in the user's home directory (there are examples on the forum).

That said, the best way would be to contact the developer to ensure their software installs properly in c:\program files. On a well-secured network with SRP/AppLocker, this kind of software behavior should be avoided (unless you're trying to retrieve ransomware...).

Regards,
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
elelay
Messages: 27
Registration: Oct 20, 2020 - 12:39

June 4, 2021 - 2:32 PM

Hello Denis,

Thank you very much for your quick reply.
If I understand correctly, this means that the installation will only take place the next time the user logs in?

Sincerely,
WAPT Server version: 2.0 Enterprise
Console installed on a Windows Server 2019
Debian 10 Buster server
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

June 7, 2021 - 9:24 PM

In setup.py, the `def install()` section runs as the system account, so it's not very useful for a poorly developed app like Podoware that installs itself in the user's AppData. Therefore, the best way to handle this is to use `def session_setup()`, and yes, the app will be "installed" (if you can even call putting DLLs and EXEs in AppData "installing"...) when the user logs in.
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
Locked