winapps icon indicating copy to clipboard operation
winapps copied to clipboard

Office temporary lock files not cleaned up & wrong modification date

Open eylenburg opened this issue 1 year ago • 5 comments

I'm not sure if this is a Winapps bug or where else to ask.

When I edit a file in Office, it creates a file starting with "~$" at beginning which is a lock file ("this file is being edited") that's normally deleted after you close the file.

Screenshot_20240712_171536 (also note that the modification date is in the future)

However, when I run Office in Winapps this is NOT deleted afterwards. It is deleted just fine when using Office running in Wine/Crossover and also when running Office in a "normal" Windows VM (e.g. in Virt-Manager or Boxes) with access to the /home folder. Hence I'm opening the bug here because it seems to be Winapps-specific, at least for me.

My suspicion would be that there's something wrong with the way the Linux drive is mounted in the Windows VM. I'm using the Docker image for the Windows VM.

eylenburg avatar Jul 12 '24 16:07 eylenburg

The date issue can be fixed by going to the Time & Date settings in the Windows VM and setting the time manually. It was set to the incorrect time zone, but even fixing that didn't fix the time, so I had to do it manually.

The owner files/lock files issue still remains though.

eylenburg avatar Jul 25 '24 21:07 eylenburg

As for the wrong time:

  1. Set correct time zone in Windows
  2. Add this key in the Windows registry: reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 1

As for the temporary lock files, I haven't found a real solution but I decent work-around to hide them and delete when you log out: https://gist.github.com/eylenburg/38e5da371b7fedc0662198efc66be57b#to-clean-up-the-left-over-owner-files-when-you-log-out

eylenburg avatar Jul 28 '24 14:07 eylenburg

@eylenburg Since for the lock files you didn't file a real solution, can we re-open this bug?

raffaem avatar Feb 16 '25 11:02 raffaem

I came up with the following script to automatically delete lock files.

But notice that apparently winapps take a long time to return after you close the window:

#!/usr/bin/env bash

DIRNAME=$(dirname "${1}")
"${HOME}"/.local/bin/winapps excel-o365 "$(realpath "$1")"


rm "${DIRNAME}"/~\$*

raffaem avatar Feb 16 '25 11:02 raffaem

@eylenburg Since for the lock files you didn't file a real solution, can we re-open this bug?

Sure

eylenburg avatar Feb 17 '25 09:02 eylenburg