2009年2月13日 星期五

wine切語系跑日文語系程式



安裝日文語系,透過「系統\管理\語言支援」來安裝是最簡單的作法

同樣透過終端機來執行遊戲的安裝程式,如同先前的例子,執行的命令為

LANG=ja_JP.UTF-8 wine Setup.exe


e滑鼠右鍵選屬性,然後選啟動圖示標籤,更改指令內容,加入LANG=ja_JP.UTF-8到其中,如

env LANG="ja_JP.UTF-8" WINEPREFIX="/home/你的登入名稱/.wine" wine "C:\Program Files\

wine自動安裝函式庫的好工具 -- winetricks

http://www.ubuntu-tw.org/modules/newbb/viewtopic.php?topic_id=12836&forum=2&post_id=66666

胡亂在網路上逛,看到有人用winetricks,似乎很好用,就下載來看看。果然是挺方便的,而且讓wine變得更完整許多。
http://wiki.winehq.org/winetricks
這是官方的說明文件與下載方式
我是直接
sh winetricks
的方式用gui來打勾,然後安裝。
原本media player 9 跑不起來,裝了一堆函式庫之後就能跑了。雖然tvants還是不能看,但是一些2D game已經順利跑沒有問題了。
這個工具包涵字型的添加,就不用那麼麻煩自己從windows裡面的字型複製到wine目錄,還要做些什麼設定。
簡單的說,這相當於wine的懶人包吧!推荐給各位使用。

安裝 winetricks

  1. 首先下載 winetricks

    wget http://www.kegel.com/wine/winetricks

  2. 改成可執行

    chmod +x winetricks

  3. 看客官希望把程式放哪, 例如 ~/bin

    mv winetricks ~/bin/

使用 winetricks

  • 列出 winetricks 使用方法及支援的套件

    winetricks –help

  • 安裝套件

    winetricks < 套件名稱>

    例如安裝 VB6 runtime

    winetricks vb6run

  • winetrick 有一個很*簡陋*的GUI (我寧可使用 cli 也不要用他的 gui )

    winetricks

  • 也可以指定安裝的 wine 目錄, 例如

    env WINEPREFIX=~/.winetest winetricks mfc40

add files/folders in foobar from the Nautilus context menu.

Hi all and thanks for this thread.
I made a little script to add files/folders in foobar from the Nautilus context menu. You should install the Nautilus-actions extension to add customized entries to the context menu.
I'm sure it's not perfect but it works on my linux (ubuntu) perhaps on yours too smile.gif 

CODE
#!/bin/bash
#foobar2000.sh

# your installation directory
cd ~/.foobar2000/

if [ "$1" != "" ]; then
i="$@" 
else 
echo "No files"
exit 0
fi

#files
#add extensions if you want
for ext in .aac .mp3 .mp4 .ogg .flac .m4a .wma .mpc .wav .rar .zip; do
files=`echo $i | sed "s/$ext /$ext\" \"z:/g"`
i=$files
done

#folder
files=`echo \"z:$i | sed "s/ \//\" \"z:\//g"`

eval wine foobar2000.exe /add "$files\""

echo "Action: adding Directory or Files \"z:${files}\" to foobar2000"

exit 0


Save this script in where you want with the name: foobar2000.sh. and make it executable.

After, create a context menu item using the Nautilus Actions Configuration tool. Click on Add in the Nautilus Action configuration window, and in the Add a New Action dialog box, fill in the field like this:

Label: Send to foobar2000 (or what you want)
Tooltip: Send to foobar2000 (or what you want)
Path: /your/directory/foobar2000.sh
Parameters: %M

Next, click on the Conditions tab.: 
Filenames: *
Mimetypes: */*
Check "both"
and check "appears if selection has multiple files or folders"

After, click on the Advanced conditions:
Check "smb (windwos file)"

Finally, click OK and close the Nautilus Actions Configuration tool. Now, when you right-click on a file or folder, you'll see the "Send to foobar2000, and clicking on it will add file and/or folder to foobar2000.





Okay, this is how I do it... shouldn't need any additional scripts, it passes on as many options as you'd like. So "foobar2000 -add file1 file2 directory3 -hide" acts just like "foobar2000.exe /add file1 file2 directory3 /hide" would.

CODE
#!/bin/bash
# launches fb2k w/ options

# set path to foobar executable
FB2K="C:\Program Files\foobar2000\foobar2000.exe"
# set Internal Field Separator : character should not appear in filepaths uris or options
IFS='|'

# gives the absolute z: path usable by wine
winepath () {
case "$1" in
/*) # absolute path
file="$1"
;;
~*) # unexpanded home-relative (?)
file="$HOME${1:1}"
# HOME + ~/path, stripping ~
;;
*) # relative path
file="$(pwd)/$1"
;;
esac
file=`echo "z:$file" | sed -e '
s%/[^/]\+/\.\./%/%g # replaces /somedir/../ by /
s%\./%%g # removes ./
s%/%\\\\%g # replace / by \
'`
}

# list of arguments separated by IFS instead of space to prevent string splitting
args=""

# go through all parameters given to script and transform them for wine use if needed
until [ -z "$1" ] ; do
case "$1" in

-h|-help)
echo "Usage : `basename $0` [options] [file1 [file2 [...]]]"
echo "Available switches: -add, -play, -pause, -playpause, -prev, -next, -rand, -stop, -exit, -show, -hide, -config -command:, -playlist_command:, -playing_command:, -help."
exit
;;

# add custom options here. Example :
# -rescan)
# args="$args$IFS/command:\"Rescan Media Library\""
# ;;

-*) # options, replacing first character
args="$args$IFS/${1:1}"
;;
# /[^/]+) args="$args$IFS$1" # alternative version, windows syntax

*) # anything else ? could be file path. Or an url... or some other kind of ufo
if [ -e "$1" ] ; then # if it's a file or a directory, translate it for wine
winepath "$1"
args="$args$IFS$file"
else # otherwise keep it as is
args="$args$IFS$1"
fi
;;
esac
shift
done

# replace positional parameters with arguments (starts out with a separator)
set ${args:1}

/usr/bin/wine "$FB2K" "$@" &
exit


Inspired by plukin's script.
You can add as many custom options as you want, see comment inside second "case" block.

Edit : minor readability change. 

foobar2000-under-wine-in-ubuntu-


http://polishlinux.org/apps/multimedia/foobar2000-under-wine-in-ubuntu/


Foobar2000 under Wine in Ubuntu

[ Sunday, 25 November 2007, P2O2 ]

Wine full of foobars…

The newest version of Wine (Windows API Linux emulator) allows one to run foobar2000 with most of its plugins in Linux. At last ColumnsUI works correctly! There are a few inconveniences, of course, but more on that later. Let’s check them then!


Author: Wujek_Bogdan

This Howto is based on the Ubuntu system. Installation of Wine on other GNU/Linux systems shouldn’t differ much, though.

  1. Using Ubuntu we have no access to the root account. All commands with root rights are performed with the help of the sudocommand. In the case of other systems users should use the su command.

  2. Wine can be installed in Ubuntu with the help of apt-get. For other distros, one use should run the appropriate package managers (yum, yast, urpmi, etc.) belonging to the distro’s pool of tools.

Preparation

We will need:

  • foobar2000
  • Wine’s latest release

Programs should be downloaded from official sites. But first, the Wine hyperlink must be added to the repo list kept in the /etc/apt/sources.list file.

To do so, open the gedit editor:

sudo gedit /etc/apt/sources.list

The corresponding entries should look like this:

deb HTTP://wine.budgetdedicated.com/apt feisty main  deb-src HTTP://wine.budgetdedicated.com/apt feisty main

Update the package list:

sudo apt-get update

Then install Wine with the following command: sudo apt-get install wine

Hydrogenaudio site contains a guide which recommends manual installation with many nonstandard fonts. You’ll find the Howto here. I must admit I didn’t test it.

Installation

Alas, copying our beautifull foobar from Windows is out of question. We have to install a pristine, clean version of the program. Let’s assume we have downloaded the package to our home directory.

First we have to go to the directory:

cd ~

Now we are to start to install the foobar package:

Wine foobar2000_0.9.4.3.exe  Of course, with newer versions there'll come higher numbers.

Installation process is identical to Windows’ one, but:

- we do not install Audio CD (CDDA) management

- we do not install desktop Shortcut icons and Directory context menus

- we do not install specialized foobar settings (Enable per-user settings) — foobar must keep config files in install directory!

Foobar is to be installed in default directory c:\Program Files\foobar2000, so the “true” directory will look like this:

/home/user's_name/.wine/drive_c/Program Files/foobar2000 

To have everything professionally adjusted (although it’s not necessary) we have to move the foobar directory to default user’s directory where his config files are kept in *nix systems, namely to user’s home directory:

mv ~/.wine/drive_c/Program\ Files/foobar2000 ~/.foobar2000

As the guide’s author suggests, we can uninstall foobar now as it was moved into another place. I didn’t do this, as it is not necessary.

From a practical standpoint, the foobar is now ready to run.

Configuration

Time to start Wine configuration program: winecfg

Let’s click the Sound tab

Select OSS or ALSA driver

Choose Hardware acceleration - Full

Mark - driver's emulation - default frequency 44100, 16 bits per sample

Now we can improve our Ubuntu.

We must add a script to have the foobar start like other Linux applications. Issue the command:

sudo gedit /usr/bin/foobar2000

Type in the following text:

#!/bin/sh cd ~/.foobar2000/ if [ "$1" != "" ]; then wine foobar2000.exe "$1" else wine foobar2000.exe fi

If we installed Wine with CJK we will have to change wine to wineloc -l ja_JP. Now we should save the file and close the gedit.

The file has to have exec rights:

sudo chmod +x /usr/bin/foobar2000

Let’s add the foobar entry to the GNOME menu. Create a config file then:

sudo gedit /usr/share/applications/foobar2000.desktop

Type in the following text:

[Desktop Entry] Type=Application Name=foobar2000 GenericName=Plays Music Version=1.0 Encoding=UTF-8 Terminal=false Exec=/usr/bin/foobar2000 Comment=Plays Music Icon=/home/user's_name/.foobar2000/foobar2000.png Categories=GNOME;GTK;AudioVideo;Audio;Player;

As you can see the file contains links to the foobar2000.png icon.

We should modify the path as the icon is required. A few of them can be found here andthere. The chosen one should be named foobar2000.png in the ~/.foobar2000/ directory.

Foobar can be run from the GNOME menu or from a terminal:

$ foobar2000

It’s up to the user what he will change yet in foobar configuration. There are a lot of good howtos and handy advice on the forum so I’m not going to elaborate on that.

Summary

Now it’s time for the saddest part of the guide — namely, “what is not working under Linux”.

  • ColumnsUI works. It doesn’t crash during basic operations. Only the menu under the right click button, e.g. in Layout option, pops up after a double click.
  • Some plugins demanding .NET Framework do not work correctly or at all.
  • PanelsUI — it needs the gdiplus.dll file to run. It should be placed in the program’s installation directory or in ~/.wine/drive_c/windows/system32.
  • foo_uie_albumart — it works but you will need the gdiplus.dll, libpng13.dll, and zlib1.dll files. They should be placed in the program’s installation directory or in~/.wine/drive_c/windows/system32. The libraries can be grabbed from theHTTP://www.dll-files.com/ website.
  • Ego Spectrum Analyzer — it hangs the application.
  • ProjectM — it doesn’t load at all.
  • Queuemanager — it doesn’t load at all.
  • foo_run — it loads but doesn’t work.
  • Tray’s icon looks ugly, it has a white background and it needs transparency.
  • In most cases foobar works in Wine without a problem. I experienced some unwelcome behavior, however — sound frequently choked during basic operations like directory look up under Nautilus control, or foobar options look through. It seems to me (I’m not sure, this is only my supposition) that the devil lies in my sound card, or to be precise, in its driver, or is caused by its emulation under Wine. I have Audigy 2 Platinum. If anyone bumped into the same problem drop me a line, please.

Let’s see how the foobar looks. This screenshot presents simple example of foobar’s configuration: ColumnsUI plus several plugins. It works.

foobar2000-under-wine-in-ubuntu/

http://polishlinux.org/apps/multimedia/foobar2000-under-wine-in-ubuntu/
* Wujek_Bogdan has provided instructions in Polish, you can find them here.

Installation

I. Wine
- You will need a working linux box with wine. Under Ubuntu you can use the command:
QUOTE
sudo apt-get install wine
* If you intend to use multilingual support, I suggest reading this tutorial and install winelocale.
- This tutorial assumes you have a wine drive z: mapped to your filesystem root "/" directory. This is the default setup with most wine installs.
- Be sure to configure wine as a Windows XP machine, there are significant limitations when running as other OSs such as Vista or Win95. Also be sure to install windows fonts to make sure everything looks pretty. To do this withwinetricks:
QUOTE
sh winetricks winxp allfonts
- To correct audio stuttering problems during CPU spikes, set wine audio acceleration to "Emulation" instead of "Full". From the Wine Application DB entry for foobar2000:
QUOTE
The beta version of foobar2000 uses Directsound by default, which can cause some problems when playing music. In order to get the program to play music properly, you must set the Hardware Acceleration to emulate Directsound. Go to a terimal and type in "winecfg". A window will open with options for you to modify. Click on the Audio tab, and then look for "Hardware Acceleration". It is currently on "Full". Click on it, and you will have a list of options. Click on "Emulation", and then click on "Apply". foobar2000 should now be able to play music. Note that this will make foobar2000 version 0.8.3 give out an error when you try to play an audio file. Just change it back to "Full" in winecfg when you're done using foobar2000 version 0.9 beta.

II. Foobar2000
* If you have an existing copy of foobar, copy your old foobar2000 folder to ~/.foobar2000 and skip this section.

- Download the foobar installer from the main foobar homepage.
- Run the foobar installer with wine:
QUOTE
wine foobar2000_0.9.6.2.exe
- Use the "Portable installation" Type to avoid mucking about with user profiles.
- Install to the location z:\home\YOURNAME\.foobar2000\ which translates through wine as ~/.foobar2000
  • DO NOT install "Audio CD support", wine does not currently support direct access to optical drives.
III. Shell Script
- Let's build a shell script to execute foobar like a normal Linux program
QUOTE
gksudo gedit /usr/bin/foobar2000
CODE
#!/bin/sh
cd ~/.foobar2000/
if [ "$1" != "" ]; then
filename=`echo z:$1 | sed 's/\\//\\\\/g'`
wine foobar2000.exe "$filename" &
else
wine foobar2000.exe &
fi
* If you are using winelocale for CJK or other international support, replace "wine" with "wineloc -l ja_JP" or something similar for your region.

- Close gedit and save the file.
- Make the file executable with the following command:
QUOTE
sudo chmod +x /usr/bin/foobar2000



IV. Application Package
- Pick an icon for foobar, I rather like this one by Byan. Save it as /usr/share/icons/foobar2000.png
- Let's build a .desktop application package so we can launch foobar from the gnome main menu
QUOTE
gksudo gedit /usr/share/applications/foobar2000.desktop
CODE
[Desktop Entry]
Type=Application
Name=foobar2000
GenericName=Plays Music
Version=1.0
Encoding=UTF-8
Terminal=false
Exec=/usr/bin/foobar2000
Comment=Plays Music
Icon=foobar2000.png
Categories=GNOME;GTK;AudioVideo;Audio;Player;
- Close gedit and save the file.

Components
Not all components work well under wine. Components written in .NET are particularly problematic.Keyboard Shortcuts:
By default, wine should allow foobar to map multimedia keys if they are not already mapped by something else however these bindings will not be global (you cannot change songs when using a different program). To globally control foobar with your multimedia keys you may want to read through this post over on the ubuntu forums. To summarize:

- Press Alt+F2 to open a Run Configuration window.
- Enter "gconf-editor" in the box and either press or click [Run]
- This should open the Gnome Configuration Editor.
- In the left pane navigate to /apps/metacity/keybinding_commands and define the following keys:
CODE
command_1 - wine ~/.foobar2000/foobar2000.exe /playpause
command_2 - wine ~/.foobar2000/foobar2000.exe /stop
command_3 - wine ~/.foobar2000/foobar2000.exe /next
command_4 - wine ~/.foobar2000/foobar2000.exe /prev
- In the left pane navigate to /apps/metacity/global_keybindings and define the following keys:
CODE
run_command_1 - XF86AudioPause
run_command_2 - XF86AudioStop
run_command_3 - XF86AudioNext
run_command_4 - XF86AudioPrev

Announcing Now Playing Information:
Many people like to announce what they are currently playing in foobar to other programs such as IRC or an Instant Meesenger. Most of the popular solutions do not translate well outside of wine. However I discoveredfoo_np_simple which basically dumps titleformatted text into an external plain text file that can then be processed by your external program (cat ~/.foobar2000/now_playing.txt). I have considered trying to mirror a nowplaying info file from another player such as quodlibet and then create an xchat perl script to parse the information nicely but I think that goes beyond the scope of this topic.

Other Comments:
- Wine tray icons are a bit buggy with both gnome and kde, To Avoid problems you may want to prevent foobar from minimizing to it in your Columns/Panels config.
- These instructions are written for a gnome environment. For KDE users replace "gksudo" with "kdesu" and "gedit" with "kate". 

This post has been edited by Yotsuya: Feb 9 2009, 19:14


--------------------

BloggerAds