曲径通幽论坛

 找回密码
 立即注册
搜索
查看: 6010|回复: 4
打印 上一主题 下一主题

安装 wine 过程记录

[复制链接]

4918

主题

5880

帖子

3万

积分

GROAD

曲径通幽,安觅芳踪。

Rank: 6Rank: 6

积分
34395
跳转到指定楼层
楼主
发表于 2008-12-4 10:06:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
现看了说明文档,顺便对关键地方做了下翻译,由于E文较菜,所以错误难免。

README 说明文档:

1. INTRODUCTION

Wine is a program which allows running Microsoft Windows programs
(including DOS, Windows 3.x and Win32 executables) on Unix.  It
consists of a program loader which loads and executes a Microsoft
Windows binary, and a library (called Winelib) that implements Windows
API calls using their Unix or X11 equivalents.  The library may also
be used for porting Win32 code into native Unix executables.

Wine is free software, released under the GNU LGPL; see the file
LICENSE for the details.
( wine 是一个允许你在 Unix 上运行微软windows程序的一个软件( 包括 DOS,windows3.x win32 可执行文件)。)

2. QUICK START

( 不论何时从源码编译都建议使用 wine 的安装器 进行 build 和安装 wine。从 wine 的根目录run:)
Whenever you compile from source, it is recommended to use the Wine
Installer to build and install Wine.  From the top-level directory
of the Wine source (which contains this file), run:

./tools/wineinstall

Run programs as "wine program".  For more information and problem
resolution, read the rest of this file, the Wine man page, and
especially the wealth of information found at http://www.winehq.org.


3. REQUIREMENTS

To compile and run Wine, you must have one of the following:

  Linux version 2.0.36 or above
  FreeBSD 7.0 or later
  Solaris x86 9 or later
  NetBSD-current
  Mac OS X 10.4 or later

As Wine requires kernel-level thread support to run, only the operating
systems mentioned above are supported.  Other operating systems which
support kernel threads may be supported in the future.

Linux info:
  While Linux 2.2.x should still work and Linux 2.0.x may still work
  (older 2.0.x versions had thread-related crashes),
  it's best to have a current kernel such as 2.4.x or 2.6.x.

FreeBSD info:
  Wine will generally not work properly on versions before FreeBSD
  7.0. FreeBSD 6.3 has patches available to allow Wine to run. See
  <http://wiki.freebsd.org/Wine> for more information.

Solaris info:
  You will most likely need to build Wine with the GNU toolchain
  (gcc, gas, etc.). Warning : installing gas does *not* ensure that it
  will be used by gcc. Recompiling gcc after installing gas or
  symlinking cc, as and ld to the gnu tools is said to be necessary.

NetBSD info:
  Make sure you have the USER_LDT, SYSVSHM, SYSVSEM, and SYSVMSG options
  turned on in your kernel.

Mac OS X info:
  You need Xcode 2.4 or later to build properly on x86.


Supported file systems:
  Wine should run on most file systems. A few compatibility problems
  have also been reported using files accessed through Samba. Also,
  NTFS does not provide all the file system features needed by some
  applications.  Using a native Linux file system such as ext3 is
  recommended.

Basic requirements:
  You need to have the X11 development include files installed
  (called xlib6g-dev in Debian and XFree86-devel in Red Hat).

  Of course you also need "make" (most likely GNU make).

  You also need flex version 2.5 or later and bison.

Optional support libraries:
  Configure will display notices when optional libraries are not found
  on your system. See http://wiki.winehq.org/Recommended_Packages for
  hints about the packages you should install.

  On 64-bit platforms you have to make sure to install the 32-bit
  versions of these libraries; see http://wiki.winehq.org/WineOn64bit
  for details.

4. COMPILATION

In case you chose to not use wineinstall, run the following commands
to build Wine:( 如果你没有选择 wineinstall 这种安装方式,那么执行一下的命令 build Wine )
./configure
make depend
make

( 这样将建立 wine 程序 和 大量的支持库。wine 将加载并运行 windows 的可执行文件,libwine 可以用来在 unix 下编译并连接 windows的源代码 )
This will build the program "wine" and numerous support libraries/binaries.
The program "wine" will load and run Windows executables.
The library "libwine" ("Winelib") can be used to compile and link
Windows source code under Unix.

(查看编译配置选项可以:  ./configure --help )
To see compile configuration options, do ./configure --help.

( 通过使用补丁文件来升级到最新的发行版。首先,cd 到 wine 包的最上层目录下,然后执行 make clean ,接着执行一下命令:)
To upgrade to a new release by using a patch file, first cd to the
top-level directory of the release (the one containing this README
file). Then do a "make clean", and patch the release with:

    bunzip2 -c patch-file | patch -p1

where "patch-file" is the name of the patch file (something like
wine-1.0.x.diff.bz2). You can then re-run "./configure", and then
run "make depend && make".


5. SETUP

Once Wine has been built correctly, you can do "make install"; this
will install the wine executable, the Wine man page, and a few other
needed files.( 一旦 Wine 被正确 built ,你可以执行 make install ,这会安装 wine 的可执行档,以及 man page,和少量其他的需要的文件)

Don't forget to uninstall any conflicting previous Wine installation
first.  Try either "dpkg -r wine" or "rpm -e wine" or "make uninstall"
before installing.( 不要忘记先卸载掉任何可能冲突的前面的 wine 版本--在安装之前,可以执行 make uninstall )

Once installed, you can run the "winecfg" configuration tool. See the
Support area at http://www.winehq.org/ for configuration hints.
( 一旦安装完成,你可以运行  winecfg  配置工具进行相关配置 )

6. RUNNING PROGRAMS

When invoking Wine, you may specify the entire path to the executable,
or a filename only.( 当调用 Wine时,你可以指定完整的可执行文件路径或仅仅是文件名 )

For example: to run Notepad:(假如要运行“记事本“ )

  wine notepad           (using the search Path as specified in
    wine notepad.exe        the config file to locate the file)

    wine c:\\windows\\notepad.exe  (using DOS filename syntax)

    wine ~/.wine/drive_c/windows/notepad.exe  (using Unix filename syntax)

        wine notepad.exe /parameter1 -parameter2 parameter3
                   (calling program with parameters)

Wine is not yet complete, so several programs may crash. In that crash
you will be dropped into the debugger so that you can investigate and
fix the problem.  For more information on how to do this, please check
the debugging section of the Wine Developer's Guide.


7. GETTING MORE INFORMATION

WWW:    A great deal of information about Wine is available from WineHQ at
    http://www.winehq.org/ : various Wine Guides, application database,
    bug tracking. This is probably the best starting point.

FAQ:    The Wine FAQ is located at http://www.winehq.org/FAQ

Usenet:    You can discuss Wine-related issues and get help
    on comp.emulators.ms-windows.wine.

Bugs:    Report bugs to Wine Bugzilla at http://bugs.winehq.org
    Please search the bugzilla database to check whether your
    problem is already found before posting a bug report.  You can
    also post bug reports to comp.emulators.ms-windows.wine.

IRC:    Online help is available at channel #WineHQ on irc.freenode.net.

GIT:    The current Wine development tree is available through GIT.
    Go to http://www.winehq.org/site/git for more information.

Mailing lists:
    There are several mailing lists for Wine users and developers;
    see http://www.winehq.org/forums for more information.

Wiki:    The Wine Wiki is located at http://wiki.winehq.org

If you add something, or fix a bug, please send a patch (in 'diff -u'
format) to wine-patches@winehq.org list for inclusion in the next
release.

--
Alexandre Julliard
julliard@winehq.org

4918

主题

5880

帖子

3万

积分

GROAD

曲径通幽,安觅芳踪。

Rank: 6Rank: 6

积分
34395
沙发
 楼主| 发表于 2008-12-4 10:07:32 | 只看该作者

没能成功使用 wine

装完就用,启动一些简单的程序倒是可以了,但是迅雷不能用,金山词霸不能用...

  而且还有一点,在 opensuse 的应用程序管理器里面凭空多了许多没用的图标,一开始怎么找都找不到删除的方法。放狗去搜了一下,发现有两个老外在官方论坛里也反映了这个问题,最后也不了了之。

  我也摸索良久,但是最后方法之简单但又有些隐蔽令人哭笑不得---直接把不用的图标拖到回收站即可,汗~

为什么一开始没想到这呢?看来受到 windows 的影响太深,老是记得右键,然后...

把这些垃圾图标删除掉,然后再重装 wine 下面将研究一下官网的说明文档,再来安装软件吧,这东西搞得也挺累人,当作看E文练习英语了。

4918

主题

5880

帖子

3万

积分

GROAD

曲径通幽,安觅芳踪。

Rank: 6Rank: 6

积分
34395
板凳
 楼主| 发表于 2008-12-4 10:26:27 | 只看该作者

终于可以初步使用 wine 了

比如把一个可以产生 vmware key  的注册机放在家的桌面目录下:   /home/beyes/Desktop/key.exe

那么如果单纯的执行: 
wine /home/beyes/Desktop/key.exe

则会提示错误:
err:module:import_dll Library MFC42.DLL (which is needed by L"Z:\\\\home\\\\beyes\\\\Desktop\\\\key.exe") not found
err:module:import_dll Library MSVCP60.dll (which is needed by L"Z:\\\\home\\\\beyes\\\\Desktop\\\\key.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"Z:\\\\home\\\\beyes\\\\Desktop\\\\key.exe" failed, status c0000135

上面的意思是,运行 key.exe 所需要的 mfc42.dll 和 msvcp60.dll 无法找到。

那么此时可以从装有 windows 的分区中的 system32 下拷贝这两个文件到  /home/beyes/Desktop/ 下。当再次运行这个文件时,发现可以成功加载并运行起来。

4918

主题

5880

帖子

3万

积分

GROAD

曲径通幽,安觅芳踪。

Rank: 6Rank: 6

积分
34395
地板
 楼主| 发表于 2008-12-4 11:04:01 | 只看该作者

官方的说明文档

Chapter 3. Configuring Wine

Most of the most common configuration changes can be done with the Winecfg tool. We'll go through an easy, step-by-step introduction to Winecfg and outline the options available. In the next section we'll go over more advanced changes you can make using regedit as well as provide a complete reference to all Wine configuration settings. Finally, some things you might want to configure fall out of the scope of Winecfg and regedit, and we'll go over those.



( 大多最常用配置的改变可以通过 Winecfg 工具来完成。我们将通过一个简单的,按部就班的介绍来说明 Winecfg 以及 描述它的可用的选项。接下来,我们将回顾更多可使用注册编辑器完成的高级设置以及提供一份完整的WINE配置设置参考。最后,对于有些你希望的配置超出了 Winecfg 和 regedit 的范围,我们再来检查之。)


3.1. Using Winecfg

In the past, Wine used a special configuration file that could be found in ~/.wine/config. If you are still using a version of Wine that references this file (older than June, 2005) you should upgrade before doing anything else. All settings are now stored directly in the registry and accessed by Wine when it starts.  

( 在过去, 配置 Wine 我们是使用一个特定的配置文件(在 ~/.wine/config 总可以找到) 。如果你现在仍然在使用这样的 Wine 版本,你应该先进行版本的升级。现在所有的设置都在 Wine 启动时生效)

Winecfg should have been installed on your computer along with the rest of the Wine programs. If you can't figure out how to start it, try running the command: $ /usr/local/bin/winecfg


( Winecfg 会和其他 Wine 组件一起安装在你的计算机上。如果你弄不明白如何启动它,可以尝试运行一下命令:
$ /usr/local/bin/winecfg

  或者只是:

 $ winecfg


When the program starts you'll notice there are tabs along the top of the window for:  

                      Applications              
                      Libraries              
                      Graphics              
                      Desktop Integration              
                      Drives              
                      Audio              
                      About             


   在程序启动时,你应该注意到在窗口上方的选项卡。如下所示:
      应用程序
      函数库
      显示
      桌面整合
      驱动
      音效
      关于


Changing settings in the Applications and Libraries  tab will have the most impact on getting an application to run. The other settings focus on getting Wine itself to behave the way you want it to.  

(改变 “应用程序” 和 “库函数” 的设置,对程序的运行有着重大影响。其他的设置则更多关注你所希望 Wine 具备的一些其他特性)

Note: The Applications, Libraries, and Graphics tabs are linked together! If you have Default Settings selected under Applications, all of the changes made within the Libraries and Graphics tabs will be changed for all applications. If you've configured a specfic application under the Applications tab and have it selected, then any changes made in Libraries or Graphics will affect only that application. This allows for custom settings for specific applications.


(注意:“应用程序”,“函数库”,“显示” 这三个选项卡是整合在一块的。如果你在“应用程序”里选择了默认的设置,那么所有在“函数库”和“显示”里做出的改变都将影响到所有的应用程序。如果在“应用程序”中单独对程序进行设置,那么在“函数库”和“显示”中的任何改变都只会影响到那个程序.)

3.1.1. Application Settings

Wine has the ability to mimic the behavior of different versions of Windows. In general, the biggest difference is whether Wine behaves as a Win9x version or an NT version. Some applications require a specific behavior in order to function and changing this setting may cause a buggy app to work. Recently Wine's default Windows version has changed to Windows 2000. It's known that many applications will perform better if you choose Windows 98.
(Wine 拥有模仿不同版本 windows 的能力。一般说来, Wine 是作为 Win9x 还是 NT 来看是最大的不同。一些应用程序需要特定的环境<Win9x环境或NT环境>才能正常工作,如果改变这些设置可能会引起程序运行的bug。目前,Wine 默认设定的系统环境为 Windows 2000. 然而,许多程序若选择 windows 98 则性能可能会表现得更好些。)


Within the tab you'll notice there is a Default Settings entry. If you select that you'll see the current default Windows Version for all applications. A troublesome application is best configured separately from the Default Settings. To do that:
(在这些选项卡里,你会注意到 “默认设置”这个入口,如果你选择它,那么默认的 windows 版本环境将会应用到所有的程序上。一个复杂的应用程序最好从“默认设置”里进行分开的配置)


1、Click on the Add application button. (单击增加应用程序按钮)
2、Browse until you locate the .exe ( 选择需要指定的 .exe 文件)
3、After it's been added you can choose the specific Windows version Wine will emulate for that application.
      ( 在增加后,你可以指定一个 Wine 可以模拟的并适合应用程序运行的操作系统版本)


3.1.2. Libraries Settings

Likewise, some applications require specific libraries in order to run. Wine reproduces the Windows system libraries (so-called native DLL's) with completely custom versions designed to function exactly the same way but without requiring licenses from Microsoft. Wine has many known deficiencies in it's built-in versions, but in many instances the functionality is sufficient. Using only builtin DLL's ensures that your system is Microsoft-free. However, Wine has the ability to load native Windows DLL's.

(同时,一些应用程序需要特定的库函数才可以运行。 Wine 重新制作了完整的针对性版本的 Windows 系统库,以能够同样准确的运行应用程序,但这并不需要 Microsoft 的授权。Wine 的内置函数库也许显得并不足够,但在很多情况下还是非常有效的。仅仅使用内置的DLL可以让你像在用免费的Microsoft。然而,Wine 也有加载 Windows 原装的 DLL 的能力 )


3.1.2.1. DLL Overrides

It's not always possible to run an application on builtin DLL's. Sometimes native DLL's simply work better. After you've located a native DLL on a Windows system, you'll need to put it in suitable place for Wine to find it and then configure it to be used. Generally the place you need to put it is in the directory you've configured to be c:\\windows\\system32 (more on that in the drives section). There are four DLL's you should never try to use the native versions of: kernel32.dll, gdi32.dll, user32.dll, and ntdll.dll. These libraries require low-level Windows kernel access that simply doesn't exist within Wine.
(使用内置的 DLL 并不总能满足要求。有时候,原装的 DLL 可以简单地让工作变得更好。在你找到原装的DLL后,你就把它们放在一个合适的地方<比如我就放在和应用程序同一个文件夹下抑或需要指定的某个文件夹里>并对 Wine 进行配置,使它们能够被 Wine 找到并使用。这里有4 个DLL 你永远都不能尝试去使用本地的版本,她们是:kernle32.dll, gid32.dll, ntdll.user32.dll 和 ntdll.dll。这些库需要处于 low-level 的 windows 内核访问的,而不是简单的包含在 Wine 之中)

With that in mind, once you've copied the DLL you just need to tell Wine to try to use it. You can configure Wine to choose between native and builtin DLL's at two different levels. If you have Default Settings selected in the Applications tab, the changes you make will affect all applications. Or, you can override the global settings on a per-application level by adding and selecting an application in the Applications tab.
(考虑于此,一旦你拷贝了 DLL ,你需要告诉 Wine 去使用它。你可以配置 Wine 在 本地的和内置的 DLL 之间进行选择。如果你在“应用程序”选项卡里进行了默认选择,你所做的改变将应想到所有的应用程序。不然,你可以不使用全局的设定,取而代之的是对所选的每个程序进行分别对应的设置)

To add an override for FOO.DLL, enter "FOO" into the box labeled New override for library: and click on the Add button. To change how the DLL behaves, select it within the Existing overrides: box and choose Edit. By default the new load order will be native Windows libraries before Wine's own builtin ones (Native then Builtin). You can also choose native only, builtin only, or disable it altogether.
( 如增加一个 FOO.DLL 的替代物,在标题框里输入 "FOO" ,然后单击 “增加“ 按钮。要改变 DLL 的属性,就选中已经添加的 DLL 并编辑它。默认的,新增的 DLL 的顺序是 Windows 的库优先于 Wine 自己的内置版本。你也可以仅仅选择内置版本,或者仅仅是内置版本,也可以一起都禁用掉。)

4918

主题

5880

帖子

3万

积分

GROAD

曲径通幽,安觅芳踪。

Rank: 6Rank: 6

积分
34395
5#
 楼主| 发表于 2008-12-4 22:49:47 | 只看该作者

修正 Wine 里的乱码问题

首先在 system.reg 里手动添加

[Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\FontLink\\\\SystemLink] 1150441842
"Tahoma"=str(7):"simsun.ttf,\\x5b8b\\x4f53\\0msgothic.ttc,MS UI Gothic\\0mingliu.ttc,PMingLiU\\0"


其中simsun.ttf 换成你喜欢的字体, \\x5b8b\\x4f53 换成这个字体中文名字的 UNICODE 编码(老版本 WINE 用英文, 比如 SimSun)


然后运行 regedit, 在 HKEY_LOCAL_MACHINE\\software\\microsfot\\windows nt\\currentversion\\fontsubstitutes 里加上

MS Shell Dlg(类型是 REG_SZ, 值是SimSun)
MS Shell Dlg 2(类型是 REG_SZ, 值是SimSun)


其实只需要用 wine 启动 regedit ,然后把第二步中的名字修改成
HKEY_LOCAL_MACHINE\\software\\microsfot\\windows nt\\currentversion\\fonts里面的字体名即可。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|曲径通幽 ( 琼ICP备11001422号-1|公安备案:46900502000207 )

GMT+8, 2025-5-4 18:42 , Processed in 0.087343 second(s), 21 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表