Wine transplantation research documents

Source: Internet
Author: User
Tags builtin windows x86
1. Wine
Introduction 1.1. Historical Background

The wine project was started in December 1993 by Bob amstadt
And Eric youngdale
The root cause of this vulnerability can be traced back to the DOS and Windows simulators used for UNIX in the early 1990s S. It was initially a lab project of MIT and later changed to GPL authorization.

The wine project was originally designed to port a 16-bit application to Linux. After a few years, Microsoft Word and Excel can be run on Linux. Now it has more than 1 million lines of code.

People have always believed that the main obstacle to using Linux on the desktop is insufficient applications. Commercial desktop application vendors are not sure whether they should invest time and effort to port their Windows applications to Linux, and they are basically waiting for Linux to be used on a large scale for desktops. On the other hand, Linux requires applications to be applied to desktops on a large scale. This is a classic first chicken or an egg problem, and wine solves this problem by running the existing windows application on Linux.

1.2. Wine
What is

The wine project is actually a two-in-one project. They provide a development kit named winelib for porting applications from windows to Linux (and UNIX); they also provide a program loader, enables Windows binary files to run in UNIX and Unix-like systems. This article focuses on the latter.

The wine loader allows Linux and other UNIX-like operating systems running on x86 to load and run Windows x86 executable files. However, it is only part of the solution. Because Windows executable files are always linked to other libraries which are part of the Windows operating system, wine also maximizes the implementation of those windows internal components, this is generally referred to as the Win32 API in Linux.

Although Windows and Linux are quite different, there are many similarities at the basic level, just like any modern operating system, support for files and directories, support for running multiple programs at the same time, similar user interfaces, and support for multimedia.

1.3. Supported Functions

Windows
Executable file:

Wine fully supports binary loading of Windows executable files (. EXE and DLL.

DLL
:

Wine has hundreds of internal implementations of Windows DLL-but not many of them are completely implemented. For example, userd32.dll that contains user interface-related functions implements 92% in open source wine.

Com
:

This is a Windows technology used by almost all large Windows applications. It supports medium functions such as embedding an Excel spreadsheet into a Word document. This technology is well supported by wine.

Registry:

This is another key technology used by almost any windows application. Wine implements approximately 90% of Windows Registry Management APIs.

Core functions:

The core system functions are also well supported. As mentioned above, although there are differences between Linux and Windows, there are many similarities at the basic level, therefore, the core system APIs related to processes, threads, files, and message queues are almost perfectly supported.

Audio and Video:

Wine supports running Windows Audio and video files (you can also use Windows Media Player ).

Print:

It is also supported and can be printed from a Windows application running in wine.

ODBC
:

Wine supports Windows applications that need to access the database through ODBC.

Debugging:

Wine has a very robust and powerful built-in debugger. In addition to supporting standard debugging functions, wine also provides customized debugging for Windows binary programs running on Linux.

Wine is one of the most important tools for its developers.

Wine also has a well-designed log tracing module to help with debugging.

The reason we emphasize this is that although the framework is robust, there are many uncertainties when installing and running Windows applications in wine, when using open-source wine, it will stop for debugging sooner or later.

2. Wine
Install 2.1. Select version

Currently, the stable version of wine is 1.0.1 and the latest development version is 1.1.22.

I personally recommend that you use the first two versions of the latest development version, on the grounds that there are many features and are relatively stable than the latest development version.

Of course, if you are concerned about stability and the stable version can meet the requirements, we recommend that you use the stable version.

2.2. Installation Method

Wine supports rpm, binary, and source code installation.

I personally suggest using the source code for installation. Although the installation speed is slow, it is relatively stable in the future.

To run wine properly, you need to install the Linux desktop, because Win32 applications all have windows.

Source code installation steps:

1. Download the source code from the wine website.

Http://sourceforge.net/project/showfiles.php? Group_id = 6241 & package_id = 77449
.

2. decompress the source code.

3. Compile the source code:./configure, make depend, make, and make install.

There is also a simple method, CD to the source code directory, execute:./tools/wineinstall.

4. If you have installed wine before, you can execute make Uninstall.

3. Wine
Configuration

You can use winecfg to implement most of the wine configurations.

Configurations are divided into default configurations and application configurations,This is important
.

If you want the global configuration to take effect, you only need to change the default configuration.

If you want to configure an application independently, you need to add the application to winecfg, select the application, and then configure it.

3.1. virtual desktop

This option can make the software installation smoother. I found that when this option is not used, using some programs will lead to the activated dialog box, the cdkey input window, or the confirmation window for changing the disc cannot appear at the front end. Let me think that the program is stuck and kill the process. This option can also prevent the program from locking your desktop or changing your screen resolution to an ugly mode.

With this option, wine starts another virtual desktop on the current Linux Desktop.

If you do not enable the virtual desktop, it is recommended that you do not enable it to make the Linux Desktop more concise.

3.2. Use
Application settings

You can customize individual programs in the application Settings dialog box in the application label of winecfg. Only Windows compatible Running Mode settings, some display settings, and DLL settings are allowed.

When you only need to set a program to use some specific windows built-in DLL, do not want other programs (including wine) when using these native DLL (and other programs using these dll will cause problems ). The built-in DLL of wine is called builtin, and the Native DLL in Windows is called Native. This option will become very useful. This method is used when DLL settings are performed to prevent some nativedll that has potential threats to wine running from being called by wine (in general, wine only calls built-in builtindll, instead of using native DLL, copyright issues, unless set, as described above ). In this way, I only modified the executable configuration files. When I don't need them, I can change them back without damaging the entire wine.

3.3. Windows
Version

Try different Windows versions for different programs. This means that a game designed for XP may run better with the support of the 98 mode of wine. Before doing this, make sure that you have added the program to the application white box, and select it. The reversed color is displayed.

3.4. Sound Card drive

Some games require the OSS to run, but the OSS will no longer continue to develop.

I personally recommend that you use ALSA for an independent sound card. It is best to use OSS for integration.

3.5. Proceed with caution
DLL

Winecfg allows you to replace builtin DLL with native DLL. The following DLL cannot be replaced. Kernel32.dll, gdi32.dll, user32.dll, and NTDLL. dll. Some nativedll may also make some programs unavailable. Remember to never overwrite the built-in DLL of wine. If native cannot be used, use builtin to replace it. Some ms dll files can be used only when they are licensed. If you do not have permission, do not use them.

3.6. Registry Key Value

Some settings cannot be set through winecfg, but can be set in the registry. There is an article in Wine's wiki that keeps updating: http://wiki.winehq.org/UsefulRegistryKeys
.

Two key values are very useful. One is the usedirecthw of the Alsa driver, which can solve the sound heap problem and the videomemorysize of direct3d, you should set it to the accurate Display memory of your video card. By default, wine is set to 64 MB.

3.7. Installation
Wine gecko ie Engine

Some programs depend on IE. However, installing ie seriously breaks the wine environment. Therefore, you can install wine gecko ie engine as a substitute.

A. Run the following command on the terminal:

Wine iw.e http://www.winehq.org

B. When the installation prompt is displayed, answer yes.

C. Open http://wiki.winehq.org/usefulregistrykeys and find the hkey_local_machinesection.

D. add all the key values related to Internet Explorer to the Registry.

After installation is complete, run the: wine iexplore http://www.winehq.org
.

If it succeeds, the winehq homepage will appear.

3.8. Support for Chinese Characters

1. Copy simsun. TTC from the fonts in the Windows directory to/home/user/. Wine/drive_c/Windows/fonts.

2. Create a symbolic connection.

CD/home/user/. Wine/drive_c/Windows/Fonts

Ln-s simsun. TTC simfang. TTC

Creating a simfang. TTC is the default simfang. TTC font for many Windows applications.

3. For Linux, the Chinese Language Pack is required; otherwise, the GBK and other Chinese character encoding are not supported.

4. Set the character set of the current user terminal to Lang = zh_cn.gbk.

3.9. Install software

1. Do not install programs in the CD directory, or run the installation programs in the CD Mount directory.

In this case, the CD cannot be released when changing the CD. Run the following command to install the CD:

Wine/Media/cdrom0/setup.exe

2. "Wine eject" is required"

If the installation program requires you to change the CD, but the system says you cannot launch the CD, open a new terminal and enter:

Wine eject D:

3. Install the. MSI file.

Some Windows Installation programs are installed Using MSI, so use the following command to install them:

Wine msiexec/I install. MSI

Or

Wine start install. MSI

4. Do not install DirectX.

Wine has its own DirectX library. installing Microsoft DirectX will damage wine's DirectX library and wine.

However, d3dx9 _ #. dll and d3dx10_33.dll can be copied and used from windows, which may be helpful when starting some games. To use these DLL files, you need Microsoft's authorization certificate.

4. Use wine
4.1. Run Win32
Program

1. If you use wine application.exe or wine application, the executable program suffix ends with .exe.

2. For console programs, you must use wine console application.exe or wine console application.

3. If you do not know whether it is a window program or a console program, you can try: wine start application.exe.

4. Before running the wine32 program, you must CD it to the program directory. Remember this.

4.2. Other wine
Command

Windows reboot Simulation

Wine control operation control panel

Wineserver will be automatically started with the wine command, but it can also be started through the terminal for different purposes.

Wineserver Parameters

A.-D # Set the display level of DEBUG in the terminal.

B.-H displays the wineserver Help File

C.-K kill the current wineserver. It is used when the program loses response and you want to end it.

D.-P keeps wineserver running. That is to say, even if the program exits, wineserver continues to run. This can be used when you need to run a continuous program to shorten the startup time of the program.

E. Run wineserver until the activated wineserver exits.

4.3. Set wine
Smooth Operation

When the program runs slowly or the performance is fluctuating, you can increase the priority of the process. After starting the game, you can use the "renice" command to change the priority of the process. The "renice" command can change the priority of the current process. The "nice" value indicates the priority level (high priority = low nice value, low priority = high nice value ). This command sets the program priority value to any integer from-20 (highest priority) to 19 (lowest priority), and the default value is 0. After starting the game, you need to open another terminal and enter the following command to change the program priority:

Sudo renice-10-N game.exe

When running a game using wine, I do not recommend that you set the priority of the program to-20, preferably starting from-10. If the effect is not obvious, you can step by step try to increase (-11,-12 ,......). You will find that the vast majority of games can achieve the best performance without having to have a higher priority than-10. Needless to say (I think), in the game, you can use the alt-tab combination to return to the desktop and use the "renice" command.

5. Third-party data
5.1. winetools

Winetools is a menu-based software that can install more than 90 common Windows programs. It can also help you set the basic directory of wine. No longer maintains winetools. It has not been upgraded for two years, but many users have found it still useful. Winetools can do everything by itself through winecfg or terminal.

5.2. Wine-doors

Wine-doors is a software that helps you install many Windows programs, including a graphical interface of the game. It is still in the development stage, but an initial version that can be downloaded has been released. This software seems very promising.

5.3. cedega

Cedega is a technical branch of wine, which specifically targets games. Cedega includes a graphical interface for installing and running games, and added support for anti-copy protection software (no need to use cracking to avoid CD)

Wine's support for anti-copy is not very good.

Cedega is not free of charge. The minimum purchase price is 3 months and $3 per month. If you prepay for a year, you can enjoy a discount.

Cedega used to be called winex. When wine is still the MIT software, rather than the current GPL, winex is separated from a branch of wine, because cedega does not belong to GPL, cedega no longer contributes to the development of wine code.

With the lack of support for cedega, many people no longer use cedega to play games in Linux.

5.4. Crossover

Technically, crossover is not a third-party product of wine, but a major financial supporter of wine.

Crossover initially aimed to run microsoft office software in Linux, but recently it began to add support for games.

Crossover is based on an older and more stable wine version (TRANSLATOR: It seems to be 0.9.17), but crossover is also upgraded along with wine. Crossover Standard Edition is priced at $39.95.

Reactos

Like crossover, reactos is also a supporter of wine. Based on the achievements of many wine, it is committed to building an operating system that is fully compatible with windows.

After that, reactos is fully compatible with Windows drivers and software. This program is still under development, but it can be used to download CD, livecd, qemu, and VMware images.

6. Summary of Common Problems

1. If wine configure: Error: X development files not found appears.

Solution: --- install devel support. For example, if you use GNOME desktop, install gnome-devel on the server. You 'd better choose it when you start the installation.

2. To enable wine to support Chinese characters, install the Chinese Language Pack for Linux, and set the character set of the current user to Lang = zh_cn.gbk.

At the same time, copy simsun. TTC from the fonts in the Windows directory to/home/user/. Wine/drive_c/Windows/fonts.

Start the Chinese desktop.

3. Wine supports Unicode.

4. Versions earlier than version 1.1.15 do not support MFC. You need to manually copy mfc42d. DLL and mfc042d. DLL and other MFC related DLL to/home/your user name /. wine/drive_c/Windows/system32, and add the program to run in the winecfg application, select the application, then, enter the name of the added DLL in the input box of the function library and edit it as original or original.

Using wineserver-P can keep wineserver running, which can shorten the response time of wine commands.

5. winecfg can set different Windows versions, desktops, and DLL settings for different applications.

6. When the DLL is missing, the warning message will prompt the missing DLL name, and copy the missing DLL from the Windows system and configure it.

7. Wine is recommended for Win32 api dll, which is relatively stable and has no copyright issues.

8. If the program inevitably uses a non-documented Win32 API, you can only replace the DLL of this API with the original windows DLL.

9. The extension name of the executable program is .exe; otherwise, the program cannot be run in wine.

10. Run as few installer programs as possible in wine, because some work done by the installer may not be supported by wine.

11. Place the DLL to be replaced in the current directory of the program, and configure native DLL first.

12. garbled characters cannot be solved if Chinese characters are written in the console.

13. If the console program cannot be started, you can use export lang = en_us.utf8 to change the language character set.

14. Open the control panel wine control in wine.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.