WPS office breaks mime (solved)

Moderator: Forum moderators

Post Reply
miltonx
Posts: 156
Joined: Sat Nov 28, 2020 12:04 am
Has thanked: 11 times
Been thanked: 6 times

WPS office breaks mime (solved)

Post 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.

User avatar
MochiMoppel
Posts: 1101
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 17 times
Been thanked: 352 times

Re: WPS office breaks mime (solved)

Post 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.

miltonx
Posts: 156
Joined: Sat Nov 28, 2020 12:04 am
Has thanked: 11 times
Been thanked: 6 times

Re: WPS office breaks mime (solved)

Post 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?

User avatar
MochiMoppel
Posts: 1101
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 17 times
Been thanked: 352 times

Re: WPS office breaks mime (solved)

Post 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.

Post Reply

Return to “Repair”