Difference between revisions of "Wine (Italiano)"

From ArchWiki
Jump to: navigation, search
Line 31: Line 31:
  
 
== Configurazione ==
 
== Configurazione ==
Per  configurare wine esegui
+
Configuring Wine is typically accomplished using:
  winecfg
+
* [http://wiki.winehq.org/winecfg winecfg] is a GUI configuration tool for Wine. You can run it from a console window with: {{ic|$ winecfg}}, or {{ic|1=$ WINEPREFIX=~/.some_prefix winecfg}}.
Modifica le impostazioni e clicca ok per salvare. Alcune opzioni non sono presenti in '''winecfg''', ma sono accessibili nel Registro di Wine. Per modificare il Registro  tramite GUI:
+
* [http://wiki.winehq.org/control control.exe] is Wine's implementation of Windows' Control Panel which can be accessed with: {{ic|$ wine control}}
  regedit
+
* [http://wiki.winehq.org/regedit regedit] is Wine's registry editing tool. If winecfg and the Control Panel were not enough, see [http://wiki.winehq.org/UsefulRegistryKeys WineHQ's article on Useful Registry Keys]
Inoltre è possibile importare/esportare dati  in/dal Registro di Wine. Da GUI clicca su: "Registro/Importa ..." e "Registro/Esporta ...". Da shell sono disponibili numerosi comandi, per l'help:
 
  regedit /?
 
  
La directory con i config files di wine è:
+
=== WINEPREFIX ===
  ~/.wine
+
By default, Wine stores its configuration files and installed Windows programs in {{ic|~/.wine}}. This directory is commonly called a "Wine prefix" or "Wine bottle" It is created/updated automatically whenever you run a Windows program or one of Wine's bundled programs such as {{ic|winecfg}}. The prefix directory also contains a tree which your Windows programs will see as {{ic|C:}} (the C-drive).
e la default C:\> sarà in:
 
  ~/.wine/drive_c
 
  
Ok! Queste sono le config di base. Puoi provare ad avviare qualcosa:
+
You can override the location Wine uses for a prefix with the {{ic|WINEPREFIX}} environment variable. This is useful if you want to use separate configurations for different Windows programs. The first time a program is run with a new Wine prefix, Wine will automatically create a directory with a bare C-drive and registry.
  wine /path/to/something.exe
 
  
Se hai difficolta a far girare applicazioni con le DirectX, prova ad aggiungere'''-opengl''' alla fine:
+
For example, if you run one program with {{ic|1= $ env WINEPREFIX=~/.win-a wine program-a.exe}}, and another with {{ic|1= $ env WINEPREFIX=~/.win-b wine program-b.exe}}, the two programs will each have a separate C-drive and separate registries.
  wine /path/to/3d_game.exe '''-opengl'''
+
 
 +
{{Note|Wine prefixes are not sandboxes! Programs running under Wine can still access the rest of the system! (for example, {{ic|Z:}} is mapped to {{ic|/}}, regardless of the Wine prefix.)}}
 +
 
 +
To create a default prefix without running a Windows program or other GUI tool you can use:
 +
$ env WINEPREFIX=~/.customprefix wineboot -u
 +
 
 +
=== WINEARCH ===
 +
If you have a 64-bit system, Wine will start an 64-bit environment by default. You can change this behavior using the {{ic|WINEARCH}} environment variable. Rename your {{ic|~/.wine}} directory and create a new wine environment by running {{ic|1=$ WINEARCH=win32 winecfg}}. This will get you a 32-bit wine environment. Not setting {{ic|WINEARCH}} will get you a 64-bit one.
 +
 
 +
You can combine this with {{ic|WINEPREFIX}} to make a separate win32 and win64 environment:
 +
$ WINEARCH=win32 WINEPREFIX=~/win32 winecfg
 +
$ WINEPREFIX=~/win64 winecfg
 +
 
 +
{{Note|During prefix creation, the 64-bit version of wine treats all folders as 64-bit prefixes and will not create a 32-bit in any existing folder. To create a 32-bit prefix you have to let wine create the folder specified in {{ic|WINEPREFIX}}.}}
 +
 
 +
You can also use {{ic|WINEARCH}} in combination with other Wine programs, such as winetricks (using Steam as an example):
 +
env WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/steam winetricks steam
 +
{{Tip|You can make variables like {{ic|WINEPREFIX}} or {{ic|WINEARCH}} persistent by using [[Bash#Shell and environment variables|~/.bashrc]].}}
  
 
===Reset Config===
 
===Reset Config===
Line 54: Line 66:
 
  $ mv ~/.wine ~/.wine_backup
 
  $ mv ~/.wine ~/.wine_backup
 
{{Note| '''Attenzione'''  Spostando o cancellando la cartella di config di wine si eliminano anche tutti i programmi installati con wine e le loro relative configurazioni }}
 
{{Note| '''Attenzione'''  Spostando o cancellando la cartella di config di wine si eliminano anche tutti i programmi installati con wine e le loro relative configurazioni }}
 +
 +
=== Graphics drivers ===
 +
 +
For most games, Wine requires high performance accelerated graphics drivers. This likely means using proprietary [[NVIDIA]] or [[AMD Catalyst]] drivers, although the open source  [[ATI]] driver is increasingly become proficient for use with Wine. [[Intel]] drivers should mostly work as well as they are going to out of the box.
 +
 +
See [http://www.phoronix.com/scan.php?page=news_item&px=MTI5NjU Gaming On Wine: The Good & Bad Graphics Drivers] for more details.
 +
 +
A good sign that your drivers are inadequate or not properly configured is when Wine reports the following in your terminal window:
 +
Direct rendering is disabled, most likely your OpenGL drivers have not been installed correctly
 +
 +
For x86-64 systems, additional [[multilib]] packages are required. Please install the one that is listed in the ''Multilib Package'' column in the table in [[Xorg#Driver installation]].
 +
 +
{{Note|You might need to restart X after having installed the correct library.}}
  
 
===Sound===
 
===Sound===
{{Note|This section may be outdated.}}
 
  
By default sound issues may arise when running Wine applications. Ensure only one sound device is selected in ''winecfg''. Alsa should work out of the box but is still glitchy & slow in some games, there exists a patch for this issue here:
+
By default sound issues may arise when running Wine applications. Ensure only one sound device is selected in {{ic|winecfg}}. Currently, the [[Alsa]] driver is the most supported.
 +
 
 +
If you want to use [[Alsa]] driver in Wine, and are using x86_64, you'll need to install the {{Pkg|lib32-alsa-lib}}. If you are also using PulseAudio, you will need to install {{Pkg|lib32-libpulse}}.
 +
 
 +
If you want to use [[OSS]] driver in Wine, you will need to install the {{Pkg|lib32-alsa-oss}} package. The OSS driver in the kernel will not suffice.
 +
 
 +
If {{ic|winecfg}} '''still''' fails to detect the audio driver (Selected driver: (none)), [http://wiki.jswindle.com/index.php/Wine_Registry#Configuring_Sound configure it via the registry].
 +
 
 +
Games that use advanced sound systems may require installations of {{Pkg|lib32-openal}}.
 +
 
 +
==== MIDI support ====
  
http://kcat.strangesoft.net/wine_thread_prio.diff
+
[[MIDI]] was a quite popular system for video games music in the 90. If you are trying out old games, it is not uncommon that the music will not play out of the box.
 +
Wine has excellent MIDI support. However you first need to make it work on your host system. See the wiki page for more details. Last but not least you need to make sure Wine will use the correct MIDI output. See the [http://wiki.winehq.org/MIDI Wine Wiki] for a detailed setup.
  
but using oss and selecting winecfg -> Sound -> Hw acceleration -> Emulation will also fix the audio issues for you provided you are using the alsa oss emulation kernel modules. (<b>Note:</b> using the aoss utility does <i>not</i> solve the issue; you must load the snd-pcm-oss module.)
+
=== Other libraries ===
  
===Fonts===
+
*Some applications (e.g. Office 2003/2007) require the MSXML library to parse HTML or XML, in such cases you need to install {{Pkg|lib32-libxml2}}.
 +
 
 +
*Some applications that play music may require {{Pkg|lib32-mpg123}}.
  
*Se nelle applicazioni su wine non vengono visualizzati dei caratteri chiari, Forse non hai installati i caratteri tipici dei sistemi Microsoft, prova ad installarli con pacman:
+
*Some applications that use native image manipulation libraries may require {{Pkg|lib32-giflib}} and {{Pkg|lib32-libpng}}.
  
# pacman -S ttf-ms-fonts
+
*Some applications that require encryption support may require {{Pkg|lib32-gnutls}}.
  
Dopo l'esecuzione del comando, killa tutti i wine servers e avvia winecfg; I caratteri ora dovrebbero essere leggibili.
+
===Fonts===
  
Gli altri TTF fonts he si desidera installare dovrebbe andare in $C_DRIVE/windows/fonts/ (dove $C_DRIVE solitamente è  ~/.wine/drive_c)
+
If Wine applications are not showing easily readable fonts, you may not have Microsoft's Truetype fonts installed. See [[MS Fonts]]. If this does not help, try running {{ic|winetricks allfonts}}.
  
 +
After running such programs, kill all wine servers and run {{ic|winecfg}}. Fonts should be legible now.
  
Se i caratteri sembrano in qualche modo sporchi, importare il seguente file di testo nel Registro di Wine:
+
If the fonts look somehow smeared, import the following text file into the Wine registry with [http://wiki.winehq.org/regedit regedit]:
 
  [HKEY_CURRENT_USER\Software\Wine\X11 Driver]
 
  [HKEY_CURRENT_USER\Software\Wine\X11 Driver]
 
  "ClientSideWithRender"="N"
 
  "ClientSideWithRender"="N"
  
====Abilitare font anti-aliasing====
+
=== Desktop launcher menus ===
 +
 
 +
When installing Windows programs with Wine, should result in the appropriate menu/desktop icons being created. For example, if the installation program (e.g. {{ic|setup.exe}}) would normally add an icon to your Desktop or "Start Menu" on Windows, then Wine should create corresponding freedesktop.org style {{ic|.desktop}} files for launching your programs with Wine.
  
importare il seguente testo nel Registro di Wine:
+
{{Tip|If menu items were ''not'' created while installing software or have been lost, [http://wiki.winehq.org/winemenubuilder winemenubuilder] may be of some use.}}
  
REGEDIT4
+
==== Creating menu entries for Wine utilities ====
 
[HKEY_CURRENT_USER\Control Panel\Desktop]
 
"FontSmoothing"="2"
 
"FontSmoothingType"=dword:00000002
 
"FontSmoothingGamma"=dword:00000578
 
"FontSmoothingOrientation"=dword:00000001
 
  
Possibili Valori:
+
By default, installation of Wine does not create desktop menus/icons for the software which comes with Wine (e.g. for {{ic|winecfg}}, {{ic|winebrowser}}, etc). These instructions will add entries for these applications.
* FontSmoothing:
 
** 0 — anti-aliasing Disabilitato;
 
** 2 — anti-aliasing Abilitato;
 
* quando anti-aliasing è abilitato, FontSmoothingType:
 
    *  00000001 — scala di grigi;
 
    * 00000002 —  subpixel (vedi :[http://en.wikipedia.org/wiki/Subpixel_rendering subpixel rendering]);
 
* quando subpixel, FontSmoothingOrientation:
 
** 00000000 — BGR;
 
** 00000001 — RGB.
 
  
L'Anti-aliasing fonts sarà applicato dopo la chiusura del regedit, e riavvio della applicazioni di Wine.
+
First, install a Windows program using Wine to create the base menu. After the base menu is created, you can create the following files in {{ic|~/.local/share/applications/wine/}}:
  
 +
{{hc|wine-browsedrive.desktop|2=
 +
[Desktop Entry]
 +
Name=Browse C: Drive
 +
Comment=Browse your virtual C: drive
 +
Exec=wine winebrowser c:
 +
Terminal=false
 +
Type=Application
 +
Icon=folder-wine
 +
Categories=Wine;
 +
}}
  
 +
{{hc|wine-uninstaller.desktop|2=
 +
[Desktop Entry]
 +
Name=Uninstall Wine Software
 +
Comment=Uninstall Windows applications for Wine
 +
Exec=wine uninstaller
 +
Terminal=false
 +
Type=Application
 +
Icon=wine-uninstaller
 +
Categories=Wine;
 +
}}
  
===Utility di configurazione per Wine ===
+
{{hc|wine-winecfg.desktop|2=
Questi strumenti aiuteranno nell'installazione dei tipici componenti di Windows. Nella maggior parte dei casi dovrebbe essere utilizzato come ultima risorsa , in quanto potrebbero alterare la configurazione di Wine.
+
[Desktop Entry]
==== Sidenet Wine Configuration Utility ====
+
Name=Configure Wine
 +
Comment=Change application-specific and general Wine options
 +
Exec=winecfg
 +
Terminal=false
 +
Icon=wine-winecfg
 +
Type=Application
 +
Categories=Wine;
 +
}}
  
[http://sidenet.ddo.jp/winetips/config.html wine-config]
+
And create the following file in {{ic|~/.config/menus/applications-merged/}}:
E' un semplice script che configura wine in modo ottimale integrandolo meglio nel sistema.
 
  
Oltre a configurare wine crea le le associazioni con le applicazioni e installa dei pratici menu con i link alle varie utility di wine (veramente molto pratico).
+
{{hc|wine.menu|2=
Esempio dei menu:
+
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
 +
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
 +
<Menu>
 +
  <Name>Applications</Name>
 +
  <Menu>
 +
    <Name>wine-wine</Name>
 +
    <Directory>wine-wine.directory</Directory>
 +
    <Include>
 +
      <Category>Wine</Category>
 +
    </Include>
 +
  </Menu>
 +
</Menu>
 +
}}
  
[http://a.imageshack.us/img831/4121/winemenu.png Foto Modifiche Al menu]
+
If these settings produce a ugly/non-existent icon, it means that there are no icons for these launchers in the icon set that you have enabled. You should replace the icon settings with the explicit location of the icon that you want. Clicking the icon in the launcher's properties menu will have the same effect. A great icon set that supports these shortcuts is [http://www.gnome-look.org/content/show.php/GNOME-colors?content=82562 GNOME-colors].
  
  
----
+
==== Removing menu entries ====
  
 +
Menu entries created by Wine are located in {{ic|~/.local/share/applications/wine/Programs/}}. Remove the program's {{ic|.desktop}} entry to remove the application from the menu.
  
 +
==== KDE 4 menu fix ====
  
Istruzioni per utilizzare questa utilità per la configurazione automatica di wine:
+
The Wine menu items [https://bugs.launchpad.net/ubuntu/+source/wine/+bug/263041 may appear] in {{ic|"Lost & Found"}} instead of the Wine menu in KDE 4. This is because {{ic|kde-applications.menu}} is missing the {{ic|MergeDir}} option.
  
* Scaricare L'ultima versione
+
Edit {{ic|/etc/xdg/menus/kde-applications.menu}}
* Scompattarla
 
* Leggere il README
 
* E eseguire
 
./setup
 
* Seguire le istruzioni(in inglese)
 
  
'''Da ricordare''': Come indicato nel [http://sidenet.ddo.jp/winetips/config.html site], puoi installare DCOM98 solo se sei in possesso di una licenza valida di Windows98.
+
At the end of the file add {{ic|<MergeDir>applications-merged</MergeDir>}} after {{ic|<DefaultMergeDirs/>}}, it should look like this:
 +
<Menu>
 +
        <Include>
 +
                <And>
 +
                        <Category>KDE</Category>
 +
                        <Category>Core</Category>
 +
                </And>
 +
        </Include>
 +
        <DefaultMergeDirs/>
 +
        '''<MergeDir>applications-merged</MergeDir>'''
 +
        <MergeFile>applications-kmenuedit.menu</MergeFile>
 +
</Menu>
  
----
+
Alternatively you can create a symlink to a folder that KDE does see:
 +
$ ln -s ~/.config/menus/applications-merged ~/.config/menus/kde-applications-merged
  
==== WineTricks ====
+
This has the added bonus that an update to KDE won't change it, but is per user instead of system wide.
[http://wiki.winehq.org/winetricks Winetricks] E un veloce (slightly dirty) scriptche permette di installare i componenti necessari per le varie applicazioni windows.  I componenti installabili comprendono DirectX 9.x, MSXML (Office 2007 / IE richiesto), runtime di Visual e molti altri.
 
  
Puoi installarlo tramite pacman:
+
== Running Windows applications ==
  
# pacman -S winetricks
+
{{Warning|Do not run or install Wine applications as root! See [http://wiki.winehq.org/FAQ#run_as_root Running Wine as root] for the official statement.}}
Per avviarlo (come normal user!) si usa il comando:
+
To run a windows application:
 +
$ wine <path to exe>
  
  $ winetricks
+
To install using an MSI installer, use the included msiexec utility:
 +
  $ msiexec installername.msi
  
==== WineTools assistant ====
+
== Tips and tricks ==
(Attualmente un po 'antiquato, ma funziona)
 
  
Winetools è un programma (più di uno script, in effetti) che facilita nella installazione di alcune componenti fondamentali per il Wine, al fine di installare altri programmi. Nota: ciò non è necessario per il Wine, ma è di aiuto se si vuole utilizzare Internet Explorer.
+
{{Tip|In addition to the links provided in the beginning of the article the following may be of interest:
 +
* [http://appdb.winehq.org/ The Wine Application Database (AppDB)] - Information about running specific Windows applications (Known issues, ratings, guides, etc tailored to specific applications)
 +
* [http://forum.winehq.org/ The WineHQ Forums] - A great place to ask questions ''after'' you have looked through the FAQ and AppDB
 +
}}
  
[http://www.von-thadden.de/Joachim/WineTools/ WineTools]
+
=== Changing the language ===
  
Secondo la politica di Microsoft si deve avere una licenza per IE6, al fine di installare DCOM98 o Internet Explorer 6. Essere possessori di una copia originale di Windows, dovrebbe essere sufficente.
+
Some programs may not offer a language selection, they will guess the desired language upon the sytem locales. Wine will transfer the current environment (including the locales) to the application, so it should work out of the box. If you want to force a program to run in a specific locale (which is fully [[Locale|generated]] on your system), you can call Wine with the following setting:
  
*Download the [https://aur.archlinux.org/packages.php?ID=8913 PKGBUILD]
+
LC_ALL=xx_XX.encoding wine /my/program
  
*Build the package using the [[Arch Build System]]
+
For instance
  
 +
LC_ALL=it_IT.UTF-8 wine /my/program
  
==== Wine-doors ====
+
=== Installing Microsoft Office 2010 ===
 +
{{Note|Microsoft Office 2013 does not run at all.}}
  
[http://www.wine-doors.org/ Wine-doors]
+
Microsoft Office 2010 works without any problems (tested with Microsoft Office Home and Student 2010, Wine 1.5.27 and 1.7.5). Activation over Internet also works.
  
Wine-doors è un sostituto di WineTools.
+
Start by installing {{pkg|wine-mono}}, {{pkg|wine_gecko}}, {{pkg|samba}}, and {{pkg|lib32-libxml2}}.
Funziona utilizzando una GUI di GNOME e funziona come un packet manager.
 
  
Funziona bene anche a 64bit.  
+
Proceed with launching the installer:
 +
$ export WINEPREFIX=.wine # any path to a writable folder on your home directory will do
 +
$ export WINEARCH="win32"
 +
$ wine /path/to/office_cd/setup.exe
 +
You could also put the above exports into your {{ic|.bashrc}}.
  
Puoi [https://aur.archlinux.org/packages.php?ID=11823 installarlo dai pacchetti AUR].
+
Once installation completes, open Word or Excel to activate over the Internet. Once activated, close the application. Then run {{ic|winecfg}}, and set '''riched20''' (under libraries) to '''(native,builtin)'''. This will enable Powerpoint to work.
  
==== PlayOnLinux ====
+
For additional info, see the [http://appdb.winehq.org/appview.php?iVersionId=4992 WineHQ] article.
  
[http://www.playonlinux.com/ PlayOnLinux]
+
{{note|If the activation over internet doesn't work and you want to activate by phone, be sure '''riched20''' is set to ''(native,builtin)'' in order to see the drop-down list of countries.}}
  
PlayOnlinux (Pol per gli amici) è un software, scritto in Python e Bash e distribuito sotto licenza GPL v3, realizzato all'interno di una community di giocatori francesi appassionati a Linux
+
{{note|{{Pkg|playonlinux}} provides custom installer scripts that make the installation of Office 2003, 2007 and 2010 an ease. You just have to provide the setup.exe or ISO and the installer will guide you seamlessly through the installation procedure. You do not have to deal with the underlying Wine at all.}}
Il progeddo è nato per consentire l'installazione e uso dei giochi tramite Wine in modo semplice.
 
  
Ecco alcune delle principali caratteristiche di Playonlinux:
+
=== Proper mounting of optical media images ===
  
    * Non è necessario avere una licenza Microsoft Windows® per utilizzare PlayOnLinux.
+
Some applications will check for the optical media to be in drive. They may check for data only, in which case it might be enough to configure the corresponding path as being a CD-ROM drive in {{ic|winecfg}}.
    * PlayOnLinux è basato su Wine, e ne sfrutta pienamente tutte le caratteristiche, anche le funzioni più complesse.
+
However, other applications will look for a media name and/or a serial number, in which case the image has to be mounted with these special properties.
    * Per utilizzare PlayOnlinux è consigliata una connessione a internet e una scheda che supporti l'accellerazione hardware.
 
   
 
    Nota: Per prevenire problemi di instabilità con alcuni giochi è consigliato disabilitare effetti grafici (Compiz, Kwin, “Cube desktop”, ecc…)
 
  
Tuttavia PlayOnLinux ha anche dei difetti, come ogni software:
+
Some virtual drive tools do not handle these metadata, like fuse-based virtual drives (Acetoneiso for instance). CDEmu will handle it correctly.
  
Installazione:
+
=== Burning optical media ===
  
 +
To burn CDs or DVDs, you will need to load the {{ic|sg}} [[kernel modules|kernel module]].
  
Pol è pacchettizzato per Archlinux, Debian, Fedora, Frugalware, Gentoo, Mandriva, OpenSuse, Pardus, PClinuxOS e Ubuntu.
+
=== OpenGL modes ===
è disponibile in  [https://aur.archlinux.org/packages.php?ID=14986 questo aur ]
 
{{Note| Dipendenze: bin32-wine cabextract imagemagick lib32-mesa wxpython xterm}}
 
  
 +
Many games have an OpenGL mode which ''may'' perform better than their default DirectX mode. While the steps to enable OpenGL rendering is ''application specific'', many games accept the {{Ic|-opengl}} parameter.
 +
$ wine /path/to/3d_game.exe -opengl
  
 +
You should of course refer to your application's documentation and Wine's [http://appdb.winehq.org AppDB] for such application specific information.
  
LINK: [http://www.playonlinux.com/ Home page]
+
=== Using Wine as an interpreter for Win16/Win32 binaries ===
  
----
+
It is also possible to tell the kernel to use wine as an interpreter for all Win16/Win32 binaries:
 +
echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register
  
 +
To make the setting permanent, create a {{ic|/etc/binfmt.d/wine.conf}} file with the following content:
 +
# Start WINE on Windows executables
 +
:DOSWin:M::MZ::/usr/bin/wine:
  
== Usare Wine per eseguire Win16 / Win32 binaries ==
+
systemd automatically mounts the {{ic|/proc/sys/fs/binfmt_misc}} filesystem using {{ic|proc-sys-fs-binfmt_misc.mount}} (and automount) and runs the {{ic|systemd-binfmt.service}} to load your settings.
  
Puoi eseguire files binari chiamando '''wine''' manualmente
+
Try it out by running a Windows program:
 +
chmod +x exefile.exe
 +
./exefile.exe
  
wine programsname.exe
+
If all went well, exefile.exe should run.
  
Se installi qualcosa con '''MSI installer''', usa il comando '''msiexec'''
+
=== Wineconsole ===
  
msiexec installername.msi
+
Often you may need to run {{ic|.exe}}s to patch game files, for example a widescreen mod for an old game, and running the {{ic|.exe}} normally through wine might yield nothing happening. In this case, you can open a terminal and run the following command:
  
E' anche possibile dire al kernel di usare '''wine''' per interpretare tutti i Win16/Win32 binaries. Per prima cosa montare il binfmt_misc filesystem:
+
$ wineconsole cmd
  
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
+
Then navigate to the directory and run the {{ic|.exe}} file from there.
  
Oppure aggiungi questa linea al tuo '''/etc/fstab'''
+
=== Winetricks ===
  
none  /proc/sys/fs/binfmt_misc binfmt_misc defaults 0 0
+
[http://wiki.winehq.org/winetricks Winetricks] is a script to allow one to install base requirements needed to run Windows programs. Installable components include DirectX 9.x, MSXML (required by Microsoft Office 2007 and Internet Explorer), Visual Runtime libraries and many more.
  
Quindi bisogna dire al kernel come interpretare i Win16 e Win32 binaries:
+
You can install {{pkg|winetricks}} via [[pacman]] or use the {{AUR|winetricks-svn}} package available in the [[AUR]]. Then run it with:
 +
  $ winetricks
  
echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register
+
== Third-party interfaces ==
 +
 
 +
These have their own sites, and are not supported in the Wine forums.
  
You can add this line to '''/etc/rc.local''' to make this setting permanent. In this case you may want to ignore stderr to avoid error messages when changing runlevels:
+
=== CrossOver ===
  
{ echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register; } 2>/dev/null
+
[http://www.codeweavers.com/about/ CrossOver] Has its own [[CrossOver|wiki page]].
  
Ora prova così:
+
=== PlayOnLinux/PlayOnMac ===
  
chmod 755 exefile.exe
+
[http://www.playonlinux.com/ PlayOnLinux] is a graphical Windows and DOS program manager. It contains scripts to assist the configuration and running of programs, it can manage multiple Wine versions and even use a specific version for each executable (eg. because of regressions). If you need to know which Wine version works best for a certain game, try the [http://appdb.winehq.org/ Wine Application Database]. You can find the {{Pkg|playonlinux}} package in [[community]].
./exefile.exe
 
  
È anche possibile rimuovere l'estensione. Exe, perché il kernel non identifica il file dalla sua estensione.
+
=== PyWinery ===
  
== Rimuovere le voci di programmi rimossi dall'Applications view di gnome ==
+
[http://code.google.com/p/pywinery/ PyWinery] is a graphical and simple wine-prefix manager which allows you to launch apps and manage configuration of separate prefixes, also have a button to open winetricks in the same prefix, to open prefix dir, {{ic|winecfg}}, application uninstaller and wineDOS. You can install [https://aur.archlinux.org/packages.php?ID=48382 PyWinery from AUR]. It is especially useful for having differents settings like DirectX games, office, programming, etc, and choose which prefix to use before you open an application or file.
  
Puo capitare che dopo aver rimosso un programma persista la sua voce nell'Application view si gnome , per rimuoverle  basterà semplicemente cancellare  la directory  di riferimento creata da wine in ~/.local/share/applications/wine e riavviare la shell
+
It's recommended using winetricks by default to open '''.exe''' files, so you can choose between any wine configuration you have.
  
----
+
=== Q4wine ===
  
== Alternative ai Win16 / Win32 binaries ==
+
[http://q4wine.brezblock.org.ua/ Q4Wine] is a graphical wine-prefix manager which allows you to manage configuration of prefixes. Notably it allows exporting QT themes into the wine configuration so that they can integrate nicely.  You can find the {{Pkg|q4wine}} package in [[multilib]].
  
* [[Cedega]] - Per i videogamers
+
== See also ==
* [[CVSCedega]] - CVS source version of cedega
 
* [[Codeweavers]] - Codeweavers' Crossover Office; Rivolto agli utenti dell'ufficio
 
  
== External Resources ==
+
* [http://www.winehq.com/ Official Wine website]
* [http://www.winehq.com/ Official Wine Website]
+
* [http://appdb.winehq.org/ Wine application database]
* Installare Internet Explorer 5, 5.5 e 6 con wine: [[Ies4linux]]
+
* [http://linuxgamingtoday.wordpress.com/2008/02/16/quick-tips-to-speed-up-your-gaming-in-wine/ Advanced configuring your gfx card and OpenGL settings on wine; Speed up wine]
* [http://linuxgamingtoday.wordpress.com/2008/02/16/quick-tips-to-speed-up-your-gaming-in-wine/ Advanced configuring your gfx card and opengl settings on wine; Speed up wine]
+
* [http://wiki.gotux.net/code:perl:fileinfo FileInfo] - Find Win32 PE/COFF headers in EXE/DLL/OCX files under linux/unix environment.
 +
* [https://wiki.gentoo.org/wiki/Wine Gentoo's Wine Wiki Page]

Revision as of 15:49, 8 January 2014

zh-CN:Wine zh-TW:Wine Wine

Tango-preferences-desktop-locale.pngThis article or section needs to be translated.Tango-preferences-desktop-locale.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Wine (Italiano)#)

(Wine Is Not an Emulator) è un software scritto con lo scopo di permettere il funzionamento dei programmi sviluppati per il sistema operativo Microsoft Windows Sui sistemi GNU/Linux e altri sistemi compatibili. Wine consente infatti di utilizzare applicazioni per Windows come se fossero applicazioni scritte appositamente per sistemi GNU/Linux senza dover emulare la struttura, ma implementando di un layer di compatibilità fornendo così il collegamento alle API necessarie per il funzionamento delle applicazioni. (ecco perché Wine non è da intendersi un emulatore)

Installazione

Attenzione: Se attraverso l'account utente è possibile accedere ai file di sistema anche i programmi installati attraverso Wine possono accedere agli stessi file. Se si ritiene che la sicurezza del sistema sia la priorità considerare la Virtualizzazione come una possibile alternativa.

Per installare Wine è necessario scaricare il pacchetto wine, disponibile nei repository ufficiali. Nel caso in cui si desideri effettuare l'installazione su un sistema a 64-bit è necessario abilitare il repository Multilib.

Probabilmente si vorrà installare wine_gecko e wine-mono per le applicazioni che richiedono il supporto rispettivamente per Internet Explorer e .NET. Questi pacchetti non sono strettamente richiesti da Wine These packages are not strictly required as Wine will download the relevant files as needed. However, having the files downloaded in advance allows you to work off-line and makes it so Wine does not download the files for each WINEPREFIX needing them.

Architectural differences

Wine per default è un'applicazione a 32-bit, as is the i686 Arch package. As such, it is unable to execute any 64-bit Windows applications.

The x86_64 Arch package, however, is built with --enable-win64. This activates the Wine version of WoW64.

  • In Windows, this complicated subsystem allows the user to use 32-bit and 64-bit Windows programs concurrently and even in the same directory.
  • In Wine, the user will have to make separate directories/prefixes. See Wine64 for specific information on this.

If you run into problems with winetricks or programs with a 64-bit environment, try creating a new 32-bit WINEPREFIX. See below: #Using WINEARCH. Using the x86_64 Wine package with WINEARCH=win32 should have the same behaviour as using the i686 Wine package.

Configurazione

Configuring Wine is typically accomplished using:

  • winecfg is a GUI configuration tool for Wine. You can run it from a console window with: $ winecfg, or $ WINEPREFIX=~/.some_prefix winecfg.
  • control.exe is Wine's implementation of Windows' Control Panel which can be accessed with: $ wine control
  • regedit is Wine's registry editing tool. If winecfg and the Control Panel were not enough, see WineHQ's article on Useful Registry Keys

WINEPREFIX

By default, Wine stores its configuration files and installed Windows programs in ~/.wine. This directory is commonly called a "Wine prefix" or "Wine bottle" It is created/updated automatically whenever you run a Windows program or one of Wine's bundled programs such as winecfg. The prefix directory also contains a tree which your Windows programs will see as C: (the C-drive).

You can override the location Wine uses for a prefix with the WINEPREFIX environment variable. This is useful if you want to use separate configurations for different Windows programs. The first time a program is run with a new Wine prefix, Wine will automatically create a directory with a bare C-drive and registry.

For example, if you run one program with $ env WINEPREFIX=~/.win-a wine program-a.exe, and another with $ env WINEPREFIX=~/.win-b wine program-b.exe, the two programs will each have a separate C-drive and separate registries.

Note: Wine prefixes are not sandboxes! Programs running under Wine can still access the rest of the system! (for example, Z: is mapped to /, regardless of the Wine prefix.)

To create a default prefix without running a Windows program or other GUI tool you can use:

$ env WINEPREFIX=~/.customprefix wineboot -u

WINEARCH

If you have a 64-bit system, Wine will start an 64-bit environment by default. You can change this behavior using the WINEARCH environment variable. Rename your ~/.wine directory and create a new wine environment by running $ WINEARCH=win32 winecfg. This will get you a 32-bit wine environment. Not setting WINEARCH will get you a 64-bit one.

You can combine this with WINEPREFIX to make a separate win32 and win64 environment:

$ WINEARCH=win32 WINEPREFIX=~/win32 winecfg 
$ WINEPREFIX=~/win64 winecfg
Note: During prefix creation, the 64-bit version of wine treats all folders as 64-bit prefixes and will not create a 32-bit in any existing folder. To create a 32-bit prefix you have to let wine create the folder specified in WINEPREFIX.

You can also use WINEARCH in combination with other Wine programs, such as winetricks (using Steam as an example):

env WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/steam winetricks steam
Tip: You can make variables like WINEPREFIX or WINEARCH persistent by using ~/.bashrc.

Reset Config

per resettare completamente (come se fosse appena installato) wine basta eliminare o spostare la cartella ~/.wine è preferibile fare un backup spostando semplicemente la cartella di configurazione con il comando:

$ mv ~/.wine ~/.wine_backup
Note: Attenzione Spostando o cancellando la cartella di config di wine si eliminano anche tutti i programmi installati con wine e le loro relative configurazioni

Graphics drivers

For most games, Wine requires high performance accelerated graphics drivers. This likely means using proprietary NVIDIA or AMD Catalyst drivers, although the open source ATI driver is increasingly become proficient for use with Wine. Intel drivers should mostly work as well as they are going to out of the box.

See Gaming On Wine: The Good & Bad Graphics Drivers for more details.

A good sign that your drivers are inadequate or not properly configured is when Wine reports the following in your terminal window:

Direct rendering is disabled, most likely your OpenGL drivers have not been installed correctly

For x86-64 systems, additional multilib packages are required. Please install the one that is listed in the Multilib Package column in the table in Xorg#Driver installation.

Note: You might need to restart X after having installed the correct library.

Sound

By default sound issues may arise when running Wine applications. Ensure only one sound device is selected in winecfg. Currently, the Alsa driver is the most supported.

If you want to use Alsa driver in Wine, and are using x86_64, you'll need to install the lib32-alsa-lib. If you are also using PulseAudio, you will need to install lib32-libpulse.

If you want to use OSS driver in Wine, you will need to install the lib32-alsa-oss package. The OSS driver in the kernel will not suffice.

If winecfg still fails to detect the audio driver (Selected driver: (none)), configure it via the registry.

Games that use advanced sound systems may require installations of lib32-openal.

MIDI support

MIDI was a quite popular system for video games music in the 90. If you are trying out old games, it is not uncommon that the music will not play out of the box. Wine has excellent MIDI support. However you first need to make it work on your host system. See the wiki page for more details. Last but not least you need to make sure Wine will use the correct MIDI output. See the Wine Wiki for a detailed setup.

Other libraries

  • Some applications (e.g. Office 2003/2007) require the MSXML library to parse HTML or XML, in such cases you need to install lib32-libxml2.
  • Some applications that require encryption support may require lib32-gnutls.

Fonts

If Wine applications are not showing easily readable fonts, you may not have Microsoft's Truetype fonts installed. See MS Fonts. If this does not help, try running winetricks allfonts.

After running such programs, kill all wine servers and run winecfg. Fonts should be legible now.

If the fonts look somehow smeared, import the following text file into the Wine registry with regedit:

[HKEY_CURRENT_USER\Software\Wine\X11 Driver]
"ClientSideWithRender"="N"

Desktop launcher menus

When installing Windows programs with Wine, should result in the appropriate menu/desktop icons being created. For example, if the installation program (e.g. setup.exe) would normally add an icon to your Desktop or "Start Menu" on Windows, then Wine should create corresponding freedesktop.org style .desktop files for launching your programs with Wine.

Tip: If menu items were not created while installing software or have been lost, winemenubuilder may be of some use.

Creating menu entries for Wine utilities

By default, installation of Wine does not create desktop menus/icons for the software which comes with Wine (e.g. for winecfg, winebrowser, etc). These instructions will add entries for these applications.

First, install a Windows program using Wine to create the base menu. After the base menu is created, you can create the following files in ~/.local/share/applications/wine/:

wine-browsedrive.desktop
[Desktop Entry]
Name=Browse C: Drive
Comment=Browse your virtual C: drive
Exec=wine winebrowser c:
Terminal=false
Type=Application
Icon=folder-wine
Categories=Wine;
wine-uninstaller.desktop
[Desktop Entry]
Name=Uninstall Wine Software
Comment=Uninstall Windows applications for Wine
Exec=wine uninstaller
Terminal=false
Type=Application
Icon=wine-uninstaller
Categories=Wine;
wine-winecfg.desktop
[Desktop Entry]
Name=Configure Wine
Comment=Change application-specific and general Wine options
Exec=winecfg
Terminal=false
Icon=wine-winecfg
Type=Application
Categories=Wine;

And create the following file in ~/.config/menus/applications-merged/:

wine.menu
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
<Menu>
  <Name>Applications</Name>
  <Menu>
    <Name>wine-wine</Name>
    <Directory>wine-wine.directory</Directory>
    <Include>
      <Category>Wine</Category>
    </Include>
  </Menu>
</Menu>

If these settings produce a ugly/non-existent icon, it means that there are no icons for these launchers in the icon set that you have enabled. You should replace the icon settings with the explicit location of the icon that you want. Clicking the icon in the launcher's properties menu will have the same effect. A great icon set that supports these shortcuts is GNOME-colors.


Removing menu entries

Menu entries created by Wine are located in ~/.local/share/applications/wine/Programs/. Remove the program's .desktop entry to remove the application from the menu.

KDE 4 menu fix

The Wine menu items may appear in "Lost & Found" instead of the Wine menu in KDE 4. This is because kde-applications.menu is missing the MergeDir option.

Edit /etc/xdg/menus/kde-applications.menu

At the end of the file add <MergeDir>applications-merged</MergeDir> after <DefaultMergeDirs/>, it should look like this:

<Menu>
        <Include>
                <And>
                        <Category>KDE</Category>
                        <Category>Core</Category>
                </And>
        </Include>
        <DefaultMergeDirs/>
        <MergeDir>applications-merged</MergeDir>
        <MergeFile>applications-kmenuedit.menu</MergeFile>
</Menu>

Alternatively you can create a symlink to a folder that KDE does see:

$ ln -s ~/.config/menus/applications-merged ~/.config/menus/kde-applications-merged

This has the added bonus that an update to KDE won't change it, but is per user instead of system wide.

Running Windows applications

Warning: Do not run or install Wine applications as root! See Running Wine as root for the official statement.

To run a windows application:

$ wine <path to exe>

To install using an MSI installer, use the included msiexec utility:

$ msiexec installername.msi

Tips and tricks

Tip: In addition to the links provided in the beginning of the article the following may be of interest:

Changing the language

Some programs may not offer a language selection, they will guess the desired language upon the sytem locales. Wine will transfer the current environment (including the locales) to the application, so it should work out of the box. If you want to force a program to run in a specific locale (which is fully generated on your system), you can call Wine with the following setting:

LC_ALL=xx_XX.encoding wine /my/program

For instance

LC_ALL=it_IT.UTF-8 wine /my/program

Installing Microsoft Office 2010

Note: Microsoft Office 2013 does not run at all.

Microsoft Office 2010 works without any problems (tested with Microsoft Office Home and Student 2010, Wine 1.5.27 and 1.7.5). Activation over Internet also works.

Start by installing wine-mono, wine_gecko, samba, and lib32-libxml2.

Proceed with launching the installer:

$ export WINEPREFIX=.wine # any path to a writable folder on your home directory will do
$ export WINEARCH="win32"
$ wine /path/to/office_cd/setup.exe

You could also put the above exports into your .bashrc.

Once installation completes, open Word or Excel to activate over the Internet. Once activated, close the application. Then run winecfg, and set riched20 (under libraries) to (native,builtin). This will enable Powerpoint to work.

For additional info, see the WineHQ article.

Note: If the activation over internet doesn't work and you want to activate by phone, be sure riched20 is set to (native,builtin) in order to see the drop-down list of countries.
Note: playonlinux provides custom installer scripts that make the installation of Office 2003, 2007 and 2010 an ease. You just have to provide the setup.exe or ISO and the installer will guide you seamlessly through the installation procedure. You do not have to deal with the underlying Wine at all.

Proper mounting of optical media images

Some applications will check for the optical media to be in drive. They may check for data only, in which case it might be enough to configure the corresponding path as being a CD-ROM drive in winecfg. However, other applications will look for a media name and/or a serial number, in which case the image has to be mounted with these special properties.

Some virtual drive tools do not handle these metadata, like fuse-based virtual drives (Acetoneiso for instance). CDEmu will handle it correctly.

Burning optical media

To burn CDs or DVDs, you will need to load the sg kernel module.

OpenGL modes

Many games have an OpenGL mode which may perform better than their default DirectX mode. While the steps to enable OpenGL rendering is application specific, many games accept the -opengl parameter.

$ wine /path/to/3d_game.exe -opengl

You should of course refer to your application's documentation and Wine's AppDB for such application specific information.

Using Wine as an interpreter for Win16/Win32 binaries

It is also possible to tell the kernel to use wine as an interpreter for all Win16/Win32 binaries:

echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register

To make the setting permanent, create a /etc/binfmt.d/wine.conf file with the following content:

# Start WINE on Windows executables
:DOSWin:M::MZ::/usr/bin/wine:

systemd automatically mounts the /proc/sys/fs/binfmt_misc filesystem using proc-sys-fs-binfmt_misc.mount (and automount) and runs the systemd-binfmt.service to load your settings.

Try it out by running a Windows program:

chmod +x exefile.exe
./exefile.exe

If all went well, exefile.exe should run.

Wineconsole

Often you may need to run .exes to patch game files, for example a widescreen mod for an old game, and running the .exe normally through wine might yield nothing happening. In this case, you can open a terminal and run the following command:

$ wineconsole cmd

Then navigate to the directory and run the .exe file from there.

Winetricks

Winetricks is a script to allow one to install base requirements needed to run Windows programs. Installable components include DirectX 9.x, MSXML (required by Microsoft Office 2007 and Internet Explorer), Visual Runtime libraries and many more.

You can install winetricks via pacman or use the winetricks-svnAUR package available in the AUR. Then run it with:

$ winetricks

Third-party interfaces

These have their own sites, and are not supported in the Wine forums.

CrossOver

CrossOver Has its own wiki page.

PlayOnLinux/PlayOnMac

PlayOnLinux is a graphical Windows and DOS program manager. It contains scripts to assist the configuration and running of programs, it can manage multiple Wine versions and even use a specific version for each executable (eg. because of regressions). If you need to know which Wine version works best for a certain game, try the Wine Application Database. You can find the playonlinux package in community.

PyWinery

PyWinery is a graphical and simple wine-prefix manager which allows you to launch apps and manage configuration of separate prefixes, also have a button to open winetricks in the same prefix, to open prefix dir, winecfg, application uninstaller and wineDOS. You can install PyWinery from AUR. It is especially useful for having differents settings like DirectX games, office, programming, etc, and choose which prefix to use before you open an application or file.

It's recommended using winetricks by default to open .exe files, so you can choose between any wine configuration you have.

Q4wine

Q4Wine is a graphical wine-prefix manager which allows you to manage configuration of prefixes. Notably it allows exporting QT themes into the wine configuration so that they can integrate nicely. You can find the q4wine package in multilib.

See also