Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: commands/open with will not open programs correctly #3639

Closed
rockrevenchy opened this issue Dec 28, 2024 · 4 comments
Closed

[Bug]: commands/open with will not open programs correctly #3639

rockrevenchy opened this issue Dec 28, 2024 · 4 comments

Comments

@rockrevenchy
Copy link

rockrevenchy commented Dec 28, 2024

Describe the bug

if you try and open an executable via commands or by the option in some DE to "open with" bottles throws an error about the local variable "program" not being associated with a value (and will not open the executable)

if I open bottles and start an executable from within the GUI of the app it works flawlessly, I just cannot for the life of me do this via a command

rockrevenchy@Yggdrasil-Deb:/media/rockrevenchy/HDD/Personal-Files/Downloads/!~exe$ flatpak run com.usebottles.bottles -b Main /home/rockrevenchy/Desktop/CheckDiskPortable_1.4_Development_Release_1_English.paf.exe 

19:40:07 (INFO) Launching with executable: /home/rockrevenchy/Desktop/CheckDiskPortable_1.4_Development_Release_1_English.paf.exe 
19:40:07 (INFO) Launching with URI: ['/home/rockrevenchy/Desktop/CheckDiskPortable_1.4_Development_Release_1_English.paf.exe'] 
19:40:07 (INFO) Forcing offline mode 
Traceback (most recent call last):
  File "/app/bin/bottles-cli", line 758, in <module>
    cli = CLI()
          ^^^^^
  File "/app/bin/bottles-cli", line 236, in __init__
    self.__process_args()
  File "/app/bin/bottles-cli", line 285, in __process_args
    self.run_program()
  File "/app/bin/bottles-cli", line 699, in run_program
    WineExecutor.run_program(bottle, program)
                                     ^^^^^^^
UnboundLocalError: cannot access local variable 'program' where it is not associated with a value

To Reproduce

use the option to open with bottles from the desktop environment or run
flatpak run com.usebottles.bottles
or
flatpak run com.usebottles.bottles -b

Package

Flatpak from Flathub

Distribution

Debian 12 + KDE

Debugging Information

Official Package: true
Version: '51.17'
DE/WM: plasmawayland
Display:
    X.org: true
    X.org (port): :1
    Wayland: true
Graphics:
    vendors:
        nvidia:
            vendor: nvidia
            envs:
                __NV_PRIME_RENDER_OFFLOAD: '1'
                __GLX_VENDOR_LIBRARY_NAME: nvidia
                __VK_LAYER_NV_optimus: NVIDIA_only
            icd: ''
            nvngx_path: null
    prime:
        integrated: null
        discrete: null
Kernel:
    Type: Linux
    Version: 6.1.0-28-amd64
Disk:
    Total: 16784588800
    Free: 16784416768
RAM:
    MemTotal: 31.3GiB
    MemAvailable: 24.9GiB
Bottles_envs: null

Troubleshooting Logs

No response

Additional context

Neofetch of my computer

OS: Debian GNU/Linux 12 (bookworm) x86_64 
Kernel: 6.1.0-28-amd64 
Packages: 2819 (dpkg), 15 (flatpak) 
Shell: bash 5.2.15 
Resolution: 1280x1024 
DE: Plasma 5.27.5 
WM: kwin 
Theme: [Plasma], Breeze [GTK2/3] 
Icons: [Plasma], breeze-dark [GTK2/3] 
Terminal: konsole 
CPU: AMD Ryzen 7 3800X (16) @ 3.900GHz 
GPU: NVIDIA GeForce GTX 1660 Ti 
Memory: 6072MiB / 32014MiB 
"""
@jntesteves
Copy link
Contributor

Duplicate of #3599, #3601
This was fixed in #3605, but a new release hasn't been made yet.

@martinotecco
Copy link

martinotecco commented Jan 10, 2025

@jntesteves Please, provide some info about the next release and if it will have the fix for that 'cli.py' file.
I think this is a useful feature since it's basically the way to call executables from the terminal, without having to use the GUI ...you can do scripts and automations. As of now this isn't possible due to a bad approach in that 'cli.py' file you've already fixed. I hope this issue can be fixed very soon, in the next release.

I'm trying building Bottles by myself by following the instructions on the readme (I think you need to revisit them also, 'cause it's a mess *)
I thought: "It should let me clone the repo, I replace the 'cli.py' file with the updated one and then I build it"
Apparently I've built it by following the steps of the second method, still I don't know if that was done correctly.
I've opened 'Bottles (Development)', set up a bottle called 'Apps' and then installed an executable in there.
But if I try to run in the terminal,
flatpak run --command=bottles-cli com.usebottles.bottles.Devel run --bottle Apps --executable "/home/<myUsername>/.var/app/com.usebottles.bottles.Devel/data/bottles/bottles/Apps/drive_c/<pathToExe>/<executable.exe>"
I got this error:
(process:2): GLib-GIO-ERROR **: <currentDate>: Settings schema 'com.usebottles.bottles.Devel' is not installed.
What do I have to do to make things work? I can't find any solution online.
Thanks.

*...no instructions on how to download and install 'org.flatpak.Builder' from Flathub (first method), by using Discover with flatpak - I'm on Arch Linux, KDE Plasma (Wayland) - is impossible to find the package 'org.flatpak.Builder', the closest is "Builder" which is a completely different package, to build GNOME apps. Neither online I've found some info.
I've had to ask ChatGPT about it and it told me that you can't install that way, at least on Arch Linux, you have to install it via pacman like you do with basically any package - and you haven't stated it right, you don't mention it in the readme -.
...then if you run the command you suggested there, it gives:
error: app/org.flatpak.Builder/x86_64/master not installed.
Then I don't remember exactly all the commands I've run because they're quite a lot and it was such a terrible mess, lots of errors, but I've given up trying the first method and managed to "successfully" build it by using the second method ...also there you've missed something:
Where is the "repo"? Should I clone it? I've had to clone it and that's not stated, you stated it only in the first method.
Where should I 'cd' in terminal after doing 'flatpak install bottles.flatpak'? because then you say: "from the root of the repository", but I don't know exactly what repository.)

@jntesteves
Copy link
Contributor

@martinotecco The fix is already merged in the main branch of the code, it will be on the next version. Unfortunately, I can't give an estimate of when the next release will happen.

Building the Devel version is just for development, it's not good for users because it will save data to a different place, it doesn't share data with the stable version. As a user, when I want to build pre-release versions of an app I use from Flathub, I usually build the version from the store using flatpak-builder. I just replace the git repository line in the manifest file to point to my personal repository, where I have applied whatever patches I want. It's a fairly simple process for a developer familiar with Flathub, but it can be a bit too technical for most users.

@jntesteves
Copy link
Contributor

Update 51.18 is already available, and this issue is fixed. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants