CIPLEO Posted November 29, 2022 Report Posted November 29, 2022 Hello, I'm trying to open an HTML file in google chrome via the VI System Exec.vi under NI Linux, for this I had to install the "xdg-utils" package. With the Linux terminal the command "xdg-open [file path] works fine. However, when I execute the code with LabVIEW the VI returns the following error (standard error indicator): /usr/bin/xdg-open: line 779: www-browser: command not found /usr/bin/xdg-open: line 779: links2: command not found /usr/bin/xdg-open: line 779: elinks: command not found /usr/bin/xdg-open: line 779: links: command not found /usr/bin/xdg-open: line 779: lynx: command not found /usr/bin/xdg-open: line 779: w3m: command not found xdg-open: no method available for opening '/home/lvuser/Desktop/Reports/20221128/FileHTML.html' After some research I understood that this was due to the fact that the default opening of the file is not goole chrome. So I executed the following commands in the terminal: - xdg-mime query default x-scheme-handle/http - xdg-mime query default x-scheme-handle/https - xdg-mime query default text/html But nothing does with LabVIEW it does not work but works with the Linux terminal. I join you the code (using LabVIEW 2020). Thanks for your feedback. code.vi Quote
Phillip Brooks Posted December 8, 2022 Report Posted December 8, 2022 (edited) Just a guess, but it could be the shell that LabVIEW starts does not have the BROWSER environment variable set. https://superuser.com/questions/1524059/how-to-set-default-variable-for-a-single-command-with-env-variables Add BROWSER='chromium' to your system exec command line string: BROWSER='chromium' xdg-open 'https://startpage.com' Edited December 8, 2022 by Phillip Brooks Quote
CIPLEO Posted December 9, 2022 Author Report Posted December 9, 2022 Thank you for your answer I will try and get back to you. Quote
CIPLEO Posted December 13, 2022 Author Report Posted December 13, 2022 Hello, So I tried the command line: BROWSER='chromium' xdg-open 'https://startpage.com' It still doesn't work but the error is different I get: /usr/bin/xdg-open: line 779: chromium: command not found /usr/bin/xdg-open: line 779: chromium: command not found xdg-open: no method available for opening 'https://www.google.fr' PS : here I try to open only a google page I had seen on some forums that modifying the "xdg-open" file would be a solution but I didn't dare to touch it. I did add "chromium" to the second line of a part of the file. if [x"$BROWSER" = x""]; then BROWSER=www-browser:links2:elinks:links:lynx:w3m:chromium Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.