Running the Via Online class platform on Linux
The power of Linux!
With the COVID pandemic, my university decided to use the VIA Online platform for our classes. It’s a pretty small Quebec based software company so I wasn’t too surprised that there wasn’t any Linux support.
It’s designed to run on Windows through an application installed locally. You don’t login directly but through an URL that calls the app and the credentials seem to be passed as part of URL. There is a Flash version available but all recent browsers have completely dropped support for Flash.
Now, this isn’t a super critical issue, but having to switch between my Linux install and Windows just to follow along with the class was a bit annoying.
Wine is (according to the doc) NOT a Windows emulator. Rather, it seems it translates Windows API calls into their POSIX equivalent. Some kind of magical NAT between Windows and POSIX.
I figured I could leverage Wine to install the VIA client locally and find some way to make the URL call the app wrapped by Wine.
What was done
After getting the VIA application installer, I simply installed the .exe through wine.
After a little bit of magic, VIA was installed and actually working (at least giving me the login page…)
Wine even added a custom desktop icon!
[Desktop Entry] Name=Via Exec=env WINEPREFIX="/home/coldadmin/.wine" wine C:\\\\users\\\\coldadmin\\\\Local\\ Settings\\\\Application\\ Data\\\\Programs\\\\Via\\\\Via.exe Type=Application StartupNotify=true Path=/home/coldadmin/.wine/dosdevices/c:/users/coldadmin/Local Settings/Application Data/Programs/Via Icon=86CD_Via.0 StartupWMClass=via.exe
One step closer!
Getting the URL –> start the app
So, it looks like the mechanism to associate a URL with an application is the “x-scheme-handler” pattern.
The URL we access to load the class looks like the following :
This means that when I click the link,
xdg-open will attempt to find and run the correct executable for the URL. In this case, it would be the one associated with the
viaapp pattern. This seems to be Distribution/X Env independant so it should work for most Linux distributions (I think).
First, I created a custom .desktop file in
/home/coldadmin/.local/share/applications/via-custom.desktop with the following content
[Desktop Entry] Type=Application Name=VIA Exec=env WINEPREFIX="/home/coldadmin/.wine" wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/coldadmin/.wine/dosdevices/c:/users/coldadmin/Start\\ Menu/Programs/Via/Via.lnk %u StartupNotify=false MimeType=x-scheme-handler/viaapp;
I now realize that the path are different between the wine generated file and my custom file. In my case, I’m calling the
.lnk that then calls the
.exe with the content of the URL as the
%u parameter. This doesn’t seem to make a difference, but I assume that the two could be merged into a single link.
We then need to create the association in
xdg-mime default /home/coldadmin/.local/share/applications/via-custom.desktop x-scheme-handler/viaapp
When I click the link for the class, xdg will start up the Via application through Wine.
I’ve been testing it over the past few weeks and it’s been working great. I can now be a little bit more lazy and stay in Ubuntu.