Page 1 of 1

[SOLVED] Installing the FlameShot package

Published: February 21, 2024 - 4:33 PM
by rcharpeil
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

Re: Installing the FlameShot package

Published: February 21, 2024 - 5:43 PM
by sfonteneau
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

Re: Installing the FlameShot package

Published: February 21, 2024 - 5:52 PM
by dcardon
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

Re: Installing the FlameShot package

Published: February 22, 2024 - 8:54 AM
by rcharpeil
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

Re: Installing the FlameShot package

Published: February 22, 2024 - 11:33 AM
by italbot
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

Re: Installing the FlameShot package

Published: February 22, 2024 - 12:10 PM
by rcharpeil
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

Re: Installing the FlameShot package

Published: February 23, 2024 - 10:13 AM
by italbot
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

Re: Installing the FlameShot package

Published: February 26, 2024 - 09:14
by rcharpeil
Hello,

thank you Ingrid, I've fixed the problem.

Have a good day everyone.

Regards.