D4koon / WhatsappTray

Minimize Whatsapp Desktop-Client to Tray
GNU General Public License v3.0
387 stars 32 forks source link

Error at startup with v1.7.1 #93

Closed mikobeng closed 2 years ago

mikobeng commented 3 years ago

Every time I first log in, this popup appears:

image

I'm not sure what's wrong so I'm leaving the log and what I changed in appData.ini

Log:

 1 21:36:05.356 - WhatsappTray::WinMain: Starting WhatsappTray 1.7.1.0 in Release CompileConfiguration.
 2 21:36:05.356 - WhatsappTray::WinMain: CloseToTray=1.
 3 21:36:05.357 - WhatsAppApi::Init() - Using leveldb-directory:C:\Users\micha\AppData\Roaming\WhatsApp\IndexedDB\file__0.indexeddb.leveldb\
 4 21:36:05.361 - WhatsappTray::InitWhatsappTray: Prepare for starting minimized.
 5 21:36:05.361 - TrayManager::ctor() - Creating TrayManger.
 6 21:36:05.361 - WhatsappTray::StartWhatsapp: Starting WhatsApp from canonical-path:'C:\Users\micha\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\WhatsApp.lnk'
 7 21:36:10.548 - WhatsappTray::StartWhatsapp: Resolved .lnk (Shortcut) to:'C:\Users\micha\AppData\Local\WhatsApp\WhatsApp.exe'
 8 21:36:21.372 - WhatsappTray::StartWhatsapp: WaitForInputIdle failed.
 9 21:37:38.116 - WhatsAppApi::IndexedDbChanged() - The logfile has changed
10 21:37:38.183 - WhatsAppApi::IndexedDbChanged() - file.fail()
11 21:37:45.542 - WhatsAppApi::IndexedDbChanged() - Found match for fullInit.
12 21:37:45.542 - WhatsappTray::operator (): NotifyOnFullInit
13 21:37:47.542 - TrayManager::MinimizeWindowToTray(0x00000000)
14 21:37:50.237 - WhatsAppApi::IndexedDbChanged() - The logfile has changed
15 21:37:50.237 - WhatsAppApi::IndexedDbChanged() - file.fail()
16 21:37:50.242 - WhatsAppApi::IndexedDbChanged() - The logfile has changed
17 21:37:50.325 - WhatsAppApi::IndexedDbChanged() - file.fail()
18 21:37:50.325 - WhatsAppApi::IndexedDbChanged() - The logfile has changed
19 21:37:50.326 - WhatsAppApi::IndexedDbChanged() - file.fail()
20 21:37:50.702 - WhatsAppApi::IndexedDbChanged() - The logfile has changed
21 21:37:50.702 - WhatsAppApi::IndexedDbChanged() - file.is_open() == false
22 21:38:08.502 - WhatsAppApi::IndexedDbChanged() - The logfile has changed
23 21:38:08.503 - WhatsAppApi::IndexedDbChanged() - file.fail()
24 21:39:56.445 - WhatsappTray::WndProc: WM_DESTROY
25 21:39:56.465 - WhatsappTray::WndProc: QuitMessage posted.

appData.ini

[config]
CLOSE_TO_TRAY=1
LAUNCH_ON_WINDOWS_STARTUP=1
START_MINIMIZED=1
SHOW_UNREAD_MESSAGES=0
CLOSE_TO_TRAY_WITH_ESCAPE=0
WHATSAPP_STARTPATH=%userStartmenuePrograms%\WhatsApp.lnk
WHATSAPP_ROAMING_DIRECTORY=C:\Users\micha\AppData\Roaming

WhatsApp still opens despite the error, just that it's default WhatsApp.

taupter commented 2 years ago

The problem manifests itself in older computers, probably because of slow rotational media and other data that makes WhatsApp's startup time be bigger than the timeout defined in

WhatsAppTray.cpp

383: auto result = WaitForInputIdle(pi.hProcess, 10000);

In my system WhatsApp takes 40s to launch, 100+s to react. 10s is not enough to let WhatsApp load properly. I changed the value to 60000 to test it but the solution doesn't compile using VS2019, even after

20: #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING 1
21: #include <filesystem>
22: #include <experimental/filesystem>

so the code must be changed in a greater measure to be able to be compiled on MSVS 2019, and as I'm not aware about the reason the author chose to use 2017 and not update it to 2019, I cannot install MSVS 2017, and the author is in a better position about issuing a new version with the problem fixed, maybe it can be better to wait for an answer from @D4koon before taking a bigger step.

As a suggestion I would say to be able to define the timeout to be configured from command line as a parameter. So we could have some flexibility to adapt it to older system's limitations and even make the program handle even extreme conditions.

Hirishiolo commented 2 years ago

same problem here, a parameter to configure would be a nice option

D4koon commented 2 years ago

I changed the wait-time to 60 seconds

Please uninstall your current version of WhatsappTray and install with the 'WhatsappTray 1.7.2 DEBUG installer' from this pullrequest: https://github.com/D4koon/WhatsappTray/actions/runs/1431282311

D4koon commented 2 years ago

This should be much better with 1.8.0 https://github.com/D4koon/WhatsappTray/releases/tag/v1.8.0 Feedback would be nice. Thank you

D4koon commented 2 years ago

If there is still an problem, open a new issue