IsOfficeRunning() (was: [tdf-core] I'm sure this is an accident...)

Andras Timar timar74 at gmail.com
Tue Jun 12 07:42:49 PDT 2012


2012.06.11. 12:13 keltezéssel, Jesús Corrius írta:
>> That's right, first we shutdown our own Quickstarter, then we look for a
>> running soffice.bin process, which can belong to AOO as well. So rather the
>> IsOfficeRunning() should be amended, so we only check for running
>> LibreOffice and ignore others (I hope it is OK but I'm not sure).
>
> Exactly we can keep the AOO process running anyway as we don't overwrite it.
>
> So:
>
> 1. Enumerate windows with current class ID
> 2. Get the path of the image. If it's our installation path, we kill it.
> 3. If is not our installation path, the installation can continue.
>
> Which in fact this is what the shutdown_quickstart MSI plugin does.
>
> If IsOfficeRunning() doesn't check for the class ID  (not nice) we
> just make sure that the image path of the running process is the one
> we are going to overwrite.
>

After some research I found that IsOfficeRunning() is completely 
useless. At least in main installer. It checks if (Libre)Office is 
running, and if it is, installer aborts. Originally it tried to rename a 
file in the installation folder with user privileges - instant fail on 
Vista and Windows 7. Now it checks if soffice.bin is running. However, 
soffice.bin can belong to AOO, Symphony etc. that we have no business 
with. We could fix IsOfficeRunning() so it detects LibreOffice only. But 
why bother? Installer will not let overwrite files in use anyway. It 
will display a dialog that user installer needs to update files in use, 
and it will list the affected processes. It is more reliable, than 
IsOfficeRunning(). If user ignores the files in use warning, no problem, 
things will get sorted out after a restart.

My proposal is to remove IsOfficeRunning custom action from installer, 
and delete it from source code. Does anybody know why it was developed 
in the first place?

Andras




More information about the LibreOffice mailing list