[SOLVED] Installing the FlameShot 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
scarf
Messages: 19
Registration: Nov 22, 2023 - 3:27 p.m.

February 21, 2024 - 4:33 PM

WAPT Server: Debian 11
WAPT version: 2.4.0.14143
Console: Windows 10

Hello, I'd like to ask a question on the forum. To give you some context, we want to replace GreenShot with FlameShot.
Since the package is not available on your repository, I then download the MSI which I store in C:\FlameShot.

I generate the package by specifying the path and then edit it.

I add the following line

Code: Select all

run('msiexec /norestart /q /i "Flameshot-12.1.0-win64.msi"')
Then I tested a manual installation first, and it worked.

Next, I want to build the package, so I run it, and that's when the problems start: FATAL ERROR


I tried it without editing it; it builds fine, but it fails to install on the agents. I've attached a screenshot of the error and the Python code. Thank you for your help

Commander
Attachments
2024-02-21 16_23_04-PyScripter - C__waptdev_rpb-flameshot_12.1.0_Windows_PROD_setup.py.png
2024-02-21 16_23_04-PyScripter - C__waptdev_rpb-flameshot_12.1.0_Windows_PROD_setup.py.png (29.75 KB) Viewed 7815 times
2024-02-21 16_25_40-PyScripter - C__waptdev_rpb-flameshot_12.1.0_Windows_PROD_setup.py.png
2024-02-21 16_25_40-PyScripter - C__waptdev_rpb-flameshot_12.1.0_Windows_PROD_setup.py.png (5.22 KB) Viewed 7815 times
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

February 21, 2024 - 5:43 PM

Hi Romain,

"build upload" is a deprecated method; we'll remove it from the menu to avoid confusion.

We need to remove the build-upload action from PyScripter. The method to upload the package now is to go to:

"Private Repository" -> "Import a Package" -> "Build and Import a Package,"

then select the corresponding working directory in WaptDev.

Regards,

Simon
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

February 21, 2024 - 5:52 PM

Hi again Romain,

I'd also like to add that it's preferable to use PyScript 3 for package creation (PyScript 4 has issues in some cases, particularly with code completion).

Furthermore, in your code you call both the `install_msi_if_needed` command and a `run('msiexec')` command immediately afterward. The first function runs `msiexec`, so the second line isn't necessary.

Best 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
scarf
Messages: 19
Registration: Nov 22, 2023 - 3:27 p.m.

February 22, 2024 - 08:54

Hello, thank you for your replies. I tried the method with building and importing a package from the repository, and there were no errors. However, it would have been too easy!

When I deploy it to my machine to test, the package installs correctly on WAPT but not on my machine…

Note that installing and removing it works fine in PyScripter.

I've attached screenshots for better understanding

. Regards
Attachments
Screenshot 2024-02-22 085329.png
Screenshot 2024-02-22 085329.png (147.13 KB) Viewed 7793 times
2024-02-22 08_52_21-WAPTConsole Enterprise version 2.4.0.14143.png
2024-02-22 08_52_21-WAPTConsole Enterprise version 2.4.0.14143.png (37.89 KB) Viewed 7793 times
italbot
Messages: 61
Registration: Sep 26, 2023 - 3:50 p.m.

February 22, 2024 - 11:33

Good morning,

When I tried it on my end with the following lines of code, there were no errors and the application was correctly installed with the shortcuts in the menu:

Code: Select all

def install():

    # Installing the software
    print("Installing: Flameshot-12.1.0-win64.msi")
    install_msi_if_needed('Flameshot-12.1.0-win64.msi')
Except in exceptional cases, there is no need to add any other command lines for the installation of an msi file.

Sincerely,

Ingrid
Tranquil IT
scarf
Messages: 19
Registration: Nov 22, 2023 - 3:27 p.m.

February 22, 2024 - 12:10

italbot wrote: Feb 22, 2024 - 11:33 Good morning,

When I tried it on my end with the following lines of code, there were no errors and the application was correctly installed with the shortcuts in the menu:

Code: Select all

def install():

    # Installing the software
    print("Installing: Flameshot-12.1.0-win64.msi")
    install_msi_if_needed('Flameshot-12.1.0-win64.msi')
Except in exceptional cases, there is no need to add any other command lines for the installation of an msi file.

Sincerely,

Ingrid
Hello, when you push the package to your agents, do you encounter any problems? I tried it myself, even without modifying the code, and it still won't install. :/
Regards
italbot
Messages: 61
Registration: Sep 26, 2023 - 3:50 p.m.

February 23, 2024 - 10:13

Good morning,

It is indeed installed correctly; however, the shortcuts are located at the administrator user level. If you want them to appear in the menu on the user's computer, you can add the following line to def install():

Code: Select all


create_programs_menu_shortcut("Flameshot", makepath(programfiles, "Flameshot","bin", "flameshot.exe"))
And to then delete the shortcut:

Code: Select all

def uninstall() : 
remove_programs_menu_shortcut("Flameshot")
Sincerely,

Ingrid
Tranquil IT
scarf
Messages: 19
Registration: Nov 22, 2023 - 3:27 p.m.

February 26, 2024 - 09:14

Hello,

thank you Ingrid, I've fixed the problem.

Have a good day everyone.

Regards.
Locked