Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
62
rated 0 times [  62] [ 0]  / answers: 1 / hits: 24361  / 3 Years ago, thu, october 7, 2021, 10:55:29

Wine automatically adds certain mimetypes and file associations (e.g. notepad.exe for .ini files). There already is an answer that explains how to remove these associations.



But how can one prevent Wine from adding them again and again?


More From » wine

 Answers
5

Disabling winemenubuilder.exe altogether will prevent wine from hijacking your file associations, but it will also prevent it from creating menu entries for newly installed software, which may be an undesired behavior. The better solution is this:




  1. Remove existing wine hijacks (from wine FAQ):



    rm -f ~/.local/share/mime/packages/x-wine*
    rm -f ~/.local/share/applications/wine-extension*
    rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*
    rm -f ~/.local/share/mime/application/x-wine-extension*

  2. Edit /usr/share/wine/wine.inf (as root), find the [Services] section:



    [Services]
    HKLM,%CurrentVersion%RunServices,"winemenubuilder",2,"%11%winemenubuilder.exe -a -r"
    ...


    and edit it so it says:



    [Services]
    HKLM,%CurrentVersion%RunServices,"winemenubuilder",2,"%11%winemenubuilder.exe -r"
    ...


    (namely, to start winemenubuilder.exe without the -a switch).
    This will prevent updating file associations on new user accounts (or with new WINEPREFIXes).


  3. Edit your $WINEPREFIX/system.reg file (if it exists) in similar fashion. Where it says



    [SoftwareMicrosoftWindowsCurrentVersionRunServices]
    "winemenubuilder"="C:windowssystem32winemenubuilder.exe -a -r"


    remove the -a switch. (By default, WINEPREFIX=$HOME/.wine.)




This will prevent wine from stealing your preferred mimeapps, but the winemenubuilder will still run and create convenient desktop entries for your Windoze software.


[#30233] Thursday, October 7, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mouedi

Total Points: 420
Total Questions: 109
Total Answers: 116

Location: Philippines
Member since Wed, Aug 19, 2020
4 Years ago
;