ActivityWatch / aw-qt

Tray icon that manages ActivityWatch processes, built with Qt.
Mozilla Public License 2.0
27 stars 28 forks source link

fix: detect .bat and .cmd executables on Windows #81

Open ErikBjare opened 2 years ago

ErikBjare commented 2 years ago

Without this fix, aw-qt wouldn't detect modules as they end in .cmd or .bat (not sure which).

Reported here: https://discord.com/channels/755040852727955476/755334568977891348/956531050627104832

The user got the following output:

[INFO ]: Started aw-qt...  (aw_qt.main:31)
[INFO ]: Searching for bundled modules in: ['PATH \\activitywatch\\aw-qt\\aw_qt', PATH \\activitywatch\\aw-qt']  (aw_qt.manager:71)
[WARNING]: Found matching file but was not executable: PATH \activitywatch\aw-qt\aw-qt.spec  (aw_qt.manager:55)
[INFO ]: Found bundled modules:  (aw_qt.manager:77)
[INFO ]: Found system modules:  (aw_qt.manager:104)
[INFO ]:  - aw-client at PATH \venv\Scripts\aw-client.exe  (aw_qt.manager:24)
[ERROR]: Module aw-server not found  (aw_qt.manager:270)
[ERROR]: Module aw-watcher-afk not found  (aw_qt.manager:270)
[ERROR]: Module aw-watcher-window not found  (aw_qt.manager:270)
[ERROR]: Manager tried to start nonexistent module aw-server  (aw_qt.manager:260)
[ERROR]: Manager tried to start nonexistent module aw-watcher-afk  (aw_qt.manager:260)
[ERROR]: Manager tried to start nonexistent module aw-watcher-window  (aw_qt.manager:260)
[INFO ]: Creating trayicon...  (aw_qt.trayicon:206)
[INFO ]: Initialized aw-qt and trayicon succesfully  (aw_qt.trayicon:245) 

Not sure why aw-client becomes an .exe but aw-server etc becomes a .bat or .cmd

ErikBjare commented 2 years ago

This PR didn't seem to work for the person who reported the issue. Needs manual testing.