keyman icon indicating copy to clipboard operation
keyman copied to clipboard

bug(windows): Exception EZipException in module kmcomapi.dll at 00539B6D. File not available to elevated admin

Open sentry-io[bot] opened this issue 2 years ago • 2 comments

Sentry Issue: KEYMAN-WINDOWS-10N

Exception EZipException in module kmcomapi.dll at 00539B6D.
File must be open.

  kmcomapi            0x2f939b6d   System.Zip.TZipFile.GetFileCount (System.Zip.pas:1)
  kmcomapi            0x2f66b30a   utilhandleexception.CaptureStackTrace (utilhandleexception.pas:59)
  kmcomapi            0x2f66b434   utilhandleexception.LogException (utilhandleexception.pas:81)
  kmcomapi            0x2f958781   keymanautoobject.TKeymanAutoObject.SafeCallException (keymanautoobject.pas:173)
  kmcomapi            0x2f4095ef   System.@HandleAutoException (System.pas:1)
  ntdll               0x779cfc23   ExecuteHandler
  ntdll               0x779c9e45   KiUserExceptionDispatcher
  kmcomapi            0x2f939b6c   System.Zip.TZipFile.GetFileCount (System.Zip.pas:1)
  kmcomapi            0x2f94ef56   keymanpackagesinstalled.TKeymanPackagesInstalled.Install2 (keymanpackagesinstalled.pas:139)
  kmshell             0x2c8cff01   Keyman.Configuration.UI.InstallFile.TInstallFile.Execute (Keyman.Configuration.UI.InstallFile.pas:168)
  kmshell             0x2c8cf7ee   Keyman.Configuration.UI.InstallFile.TInstallFile.Execute (Keyman.Configuration.UI.InstallFile.pas:50)
  kmshell             0x2c97e539   initprog.RunKMCOM (initprog.pas:533)
  kmshell             0x2c97de50   initprog.Run (initprog.pas:340)
  kmshell             0x2c992cee   kmshell.kmshell
  KERNEL32.DLL        0x766988b7   $push_thunk$cdecl$u$u
  KERNEL32.DLL        0x765fed7b   BaseThreadInitThunk
  ntdll               0x778c595f   #__RtlUserThreadStart
  ntdll               0x778c5917   #_RtlUserThreadStart
  ntdll               0x779857cb   _RtlUserThreadStart$pop_thunk

sentry-io[bot] avatar Mar 23 '22 00:03 sentry-io[bot]

Ref: https://community.software.sil.org/t/kmp-does-not-install-directly-into-keyman-for-windows-but-works-everywhere-else/6027/2

This crash happens when the current user selects a file that is not available to the elevated Administrator. Two possible mitigations:

  1. Address the crash by testing for file existence before continuing, in the admin account run, probably in TKeymanPackagesInstalled.Install2, and wrap it with a error dialog, maybe in TInstallFile.Execute
  2. Consider improving the install process by copying the file to a known-accessible location (though what this location is may be hard to determine in advance)

I'd probably be comfortable with item 1 above and making sure the message makes it clear what to do to get the file installed.

mcdurdin avatar Mar 23 '22 00:03 mcdurdin

Just noting that my initial attempts to try and reproduce the crash; in order, to have testable steps to test a fix against; have been unsuccessful. This may just be a case for implementing option 1 above and then doing suitable regression tests for installing keyboard packages.

rc-swag avatar Jul 25 '22 02:07 rc-swag

Sentry issue: KEYMAN-WINDOWS-1N0

sentry-io[bot] avatar Oct 25 '22 21:10 sentry-io[bot]

Sentry issue: KEYMAN-WINDOWS-1MZ

sentry-io[bot] avatar Oct 25 '22 21:10 sentry-io[bot]

I noticed that some of the failing command line calls recorded in sentry have a trailing = on the keyboard name not sure if this is normal or not. OK digger deeper I can see this is = is deliberate and is meant have the BCP47Code so these cases I am seeing have the don't have the BCP47Code "C:\Program Files (x86)\Keyman\Keyman Desktop\kmshell.exe" -log "C:\Users\MyUser\AppData\Local\Temp\kmnD5AE.log" -s -i "W:\MyKeyboard\mykeyboard_ver17.kmp=" -nowelcome -default-lang en-US 0409

rc-swag avatar Nov 07 '22 01:11 rc-swag

Windows settings that results in map network drives beening unavailable in elevated command prompts. https://learn.microsoft.com/en-us/troubleshoot/windows-client/networking/mapped-drives-not-available-from-elevated-command

rc-swag avatar Nov 07 '22 07:11 rc-swag

PR #7207

rc-swag avatar Nov 14 '22 04:11 rc-swag