Page 1 of 1

WPS office breaks mime (solved)

Posted: Sat Mar 13, 2021 6:16 am
by miltonx

On fossapup64-9.5, I use WPS 11.1.0 downloaded from fossapup64-9.5 package reservior. This package has a mime bug. Each time WPS office is opened, it writes a mime folder under /root/.local/share, resulting in mime type recognition being messed. Docx, xlsx etc will be recognized as zip files and when these files are clicked, pupzip is used as the default app.
After a lot of trial and error, I found that it is /root/.local/share/mime responsible. So I made an infinite loop bash script to remove this folder every second. The script is run after puppy boots. Then these files come back to be reconized as documents and spreadsheets. (If you need to default-open them with WPS instead of abiword/gnumeric, you can edit/add the defaultwordprocessor & defaultspreadsheet & defaultpresentation files under /usr/local/bin/)
Although theoretically docx, xlsx are indeed zip files, but this is a bug still, as the content should have been parsed to differentiate these office files from regular compression files.


Re: WPS office breaks mime (solved)

Posted: Tue Mar 16, 2021 2:33 pm
by MochiMoppel
miltonx wrote:

After a lot of trial and error, I found that it is /root/.local/share/mime responsible. So I made an infinite loop bash script to remove this folder every second.

There is an easier and somewhat official way. Don't know if documented. Add this line to the file /root/.config/Kingsoft/Office.conf:

Code: Select all

common\do_not_detect_file_association_while_startup=true

After you have removed the folder /root/.local/share/mime open WPS and create a new document.
At this point WPS would normally recreate this folder with a /packages subfolder and then run update-mime-database.
With above line all WPS will do is recreate an empty /root/.local/share/mime folder. This will keep MIME associations untouched.


Re: WPS office breaks mime (solved)

Posted: Wed Mar 17, 2021 1:36 am
by miltonx
MochiMoppel wrote: Tue Mar 16, 2021 2:33 pm
miltonx wrote:

After a lot of trial and error, I found that it is /root/.local/share/mime responsible. So I made an infinite loop bash script to remove this folder every second.

There is an easier and somewhat official way. Don't know if documented. Add this line to the file /root/.config/Kingsoft/Office.conf:

Code: Select all

common\do_not_detect_file_association_while_startup=true

After you have removed the folder /root/.local/share/mime open WPS and create a new document.
At this point WPS would normally recreate this folder with a /packages subfolder and then run update-mime-database.
With above line all WPS will do is recreate an empty /root/.local/share/mime folder. This will keep MIME associations untouched.

Wow, how did you find out that?


Re: WPS office breaks mime (solved)

Posted: Thu Mar 18, 2021 8:29 am
by MochiMoppel
miltonx wrote:

Wow, how did you find out that?

I politely declined WPS' offer in its pop-up message ("Allow automatic check whether the format has been tampered with"). Refusing this check adds the mentioned line into the config file.