inucat / win-LOKI_Keyboard_Indicator

Lightweight & Open source Keyboard Indicator for Windows★Windows用・軽量・オープンソースなキーボードインジケータです。
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[BUG] Preferences not loaded when autostart #2

Closed inucat closed 3 years ago

inucat commented 3 years ago

Describe the bug App preferences are not loaded when the app has been launched automatically at start up.

To Reproduce

  1. Check "Launch on Start up".
  2. Sign out and sign in, or reboot.
  3. App starts without preferences applied.

Expected behavior My preferences such as icon visibilities should be applied.

Desktop (please complete the following information):

Additional context The problem doesn't happen by manual launch, it happens only by autostart. There could be a problem with loading the ini file when launched by autostart. Further inspections will be performed.

inucat commented 3 years ago

v0.4.2 solved the issue.

In the code the config file is referred by its relative path to the app

If the app is launched at Windows start up, however, the working directory is C:\Windows\system32, not the app directory.

So it should've obtained the absolute path.

Now GetModuleFileName() and PathRemoveFileSpec() play the role and work well.