Pocket Plane Group

Friends and Neighbors => Weimer Republic (WeiDU.org) => WeiDU => Topic started by: drake127 on March 14, 2006, 04:01:01 AM

Title: [request] Wine(linux) support
Post by: drake127 on March 14, 2006, 04:01:01 AM
Since IE games (BG, PST tested) works well in Wine (0.9.9) I'd like to add WeiDU support for Wine or linux. I think it would work but there is a big problem called "case-sensitive". Setup-xxx does not recognize tp2 neither key file.
I'd recommend solution - because game is not programmed to care about case, someone (I can handle it but I have not time) can make patch that all resrefs change to their lowercase or uppercase equivalents (lowercase is nicer), and all modders have to work with lowercase files --> it is impossible but you can do the same modyfiing  COPY(_...) functions.
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 14, 2006, 05:00:58 AM
You mean a patch to have all files called as lowercase? Fine, I can handle this.

You also need a shell script to turn all files to lowercase (tentatively, I'm not sure of the correctness):

Quote
#!/bin/sh
for a in *; do mv $a `echo $a | tr "A-Z" "a-z"`; done
for a in */*; do mv $a `echo $a | tr "A-Z" "a-z"`; done
for a in */*/*; do mv $a `echo $a | tr "A-Z" "a-z"`; done
for a in */*/*/*; do mv $a `echo $a | tr "A-Z" "a-z"`; done
for a in */*/*/*/*; do mv $a `echo $a | tr "A-Z" "a-z"`; done

(multiple */* lines to avoid troubles when you moved ADirName to adirname and you're trying to
mv ADirName/SoMeFiLe adirname/somefile)

BTW, doesn't Wine handle the case-sensitiveness on his own?
Title: Re: [request] Wine(linux) support
Post by: drake127 on March 14, 2006, 05:14:04 AM
Unfortunatelly it seems Wine cannot handle it on its own. Maybe it is only problem with console applications (because game itselft seems to work and I would wonder if every single file is referenced by their proper case name). First step is to make WeiDU (BiggDU?) recognize tp2 and chitin.key (not found, make sure you are running Setup-xxx from IE game directory). Then I will find more troubles :-)

Second problem is with override (and similar) folders where you can mismatch x-case files (so after I had installed DudleyFix I had two copies of Arrow05.ITM and arrow05.itm in my override). So WeiDU needs to create rule for this.

I am not sure if game find override content as it is lowercase and in chitin.key they are referenced chaotically (mostly uppercase). I will look at it more closely.
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 14, 2006, 05:17:08 AM
Well, I have posted code to turn all file names to lowercase, so, if I map all weidu filesystem calls to work on the lowercased filename (including the creation of all files), then we're covered, no?
(non weidu mods won't work, but who cares?)

BTW, you can run simple tests to see if the game works with mixed case or not (IE, look chitin.key for sw1h01, write it as
SW1H01, try to clua in sw1h01, then write it as sw1h01 and clua in SW1H01, then run similar tests with the override).
Title: Re: [request] Wine(linux) support
Post by: drake127 on March 14, 2006, 05:33:53 AM
I tried to rename chitin.key to CHITIN.KEY (and back) and game works and some DudleyFixes as well so I think we can say that game is able to accept mixed-case references.

If it helps I can add my error.
Code: [Select]
[Setup-EasyCoreRules.exe] WeiDU version 188


** ERROR ** [SETUP-EASYCORERULES.TP2] not found.
Make sure that you have unpacked the archive correctly and
that you are not trying to run this file from inside an archive.
ERROR: Unable to find CHITIN.KEY in:
        .
        .
        c:\Program Files\Black Isle\Baldur's Gate
        .
        .
        c:\Program Files\Black Isle\Planescape - Torment
        C:\Program Files\Black Isle\BGII - SoA

FATAL ERROR: Failure("Unable to find CHITIN.KEY: run me in an Infinity Engine game directory")

Press ENTER to exit.
Maybe there is problem with working directory. I tried wine C:\Pro...\Setup-xxx.exe and ./Setup-xxx.exe but it seems it cannot find game folder itself.
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 14, 2006, 09:45:08 AM
Does it work if you rename it to CHITIN.KEY?

BTW, 191 has already the 'all system calls are lowercased' feature built in  ;)
Title: Re: [request] Wine(linux) support
Post by: drake127 on March 14, 2006, 10:22:19 AM
Does it work if you rename it to CHITIN.KEY?
No, I tried it. I guess it does not recognize working directory.
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 14, 2006, 10:36:29 AM
Hm, what directory are your games installed in (both for the windows and Linux FS)?
Title: Re: [request] Wine(linux) support
Post by: drake127 on March 14, 2006, 11:57:52 AM
Hm, what directory are your games installed in (both for the windows and Linux FS)?
/home/drake127/.wine/drive_c/Program Files/Black Isle/Baldur's Gate/

But sometimes (!) it creates debug file in my home directory, so I tried to move mod to there (/home/drake127) but it still complains it cannot find tp2 and key file.
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 14, 2006, 12:17:06 PM
Can you try to compile weidu for Linux? (edit the makefile by commenting out the Windows section and uncommenting the Linux section, then make sure you have either ocaml, sed, perl, and run make). To install a mod using the CLI, run
weidu --tlkout dialog.tlk --ftlkout dialogf.tlk --log somemod.debug somemod.tp2 setup-somemod.tp2 somemod/somemod.tp2 somemod/setup-somemod.tp2
(or use this nifty program (http://dev.gibberlings3.net/index.php/Tool_Setup_Mymod) and simply call winstall somemod)
Title: Re: [request] Wine(linux) support
Post by: drake127 on March 14, 2006, 12:59:43 PM
Can you try to compile weidu for Linux? (edit the makefile by commenting out the Windows section and uncommenting the Linux section, then make sure you have either ocaml, sed, perl, and run make). To install a mod using the CLI, run
weidu --tlkout dialog.tlk --ftlkout dialogf.tlk --log somemod.debug somemod.tp2 setup-somemod.tp2 somemod/somemod.tp2 somemod/setup-somemod.tp2
(or use this nifty program (http://dev.gibberlings3.net/index.php/Tool_Setup_Mymod) and simply call winstall somemod)
WeiDU has linux makefile? Good. .... Yes, it worked except that case part. I was forced to rename biffs etc. to correspond with chitin.key values. If you will patch it, everything will be O.K. (hopefully).
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 14, 2006, 02:16:37 PM
...Uh? could you post diffs for that?
Title: Re: [request] Wine(linux) support
Post by: drake127 on March 14, 2006, 02:24:36 PM
...Uh? could you post diffs for that?
Nay, we already discussed it. In chitin.key there is data/Default.bif, so weidu.exe requires exact match (not Data/Default.bif neither data/default.bif) so all you have to do is before every fopen (or similar) call tolower. That's all it is needed to do with weidu.

Exact match would be betterbut it is not realistic. Make everything lowercase is better and more compatible with linux unaware modders (= almost all of them ;-))
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 14, 2006, 02:28:11 PM
Oh, OK. v191 maps all calls to lowercase, so you just have to use a script to lowercase all filenames in your BGII directory  ;)
Title: Re: [request] Wine(linux) support
Post by: drake127 on March 15, 2006, 06:23:55 AM
When will be 1.91 ready?

One more question (maybe little off topic) - is (compiled) linux version of WeiDU compatible with other linuxes etc or this binary can be used only on my system? Is it possible to pack linux binary to my mod zip file? Will it work?
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 15, 2006, 06:41:25 AM
I'm sorry, I don't know about such details, since I'm a Windows user  :(

I have access to a Linux machine in my ex-college, so I can try to compile it there and distribute, but I'm not sure.
How do you check for distro + kernel version from the CLI?
Title: Re: [request] Wine(linux) support
Post by: drake127 on March 15, 2006, 08:39:02 AM
I'm sorry, I don't know about such details, since I'm a Windows user  :(
So am I :-)

I have access to a Linux machine in my ex-college, so I can try to compile it there and distribute, but I'm not sure.
How do you check for distro + kernel version from the CLI?
Not sure what CLI is but kernel version can be obtained via uname -sr.

I little enhanced lower-casing script (but I am no shell programmer - it is my first script which is doing something useful).
Code: [Select]
#!/bin/sh
#
# drake127 (2006-03-15)
#
# Rename all files in current directory and all its subdirectories to lower-case.
# If lower-case filename already exists, more recent one is preserved.

for file in `find -depth`
do
replace=`dirname $file`/`basename $file | tr [:upper:] [:lower:]`
if test $file != $replace -a $file != .
then
mv -u $file `dirname $file`/`basename $file | tr [:upper:] [:lower:]`
rm -f $file
fi
done

I also compiled linux weidu, could some check if it is working. AFAIK it is ELF format which should be executable on all linux distributions.
http://files.sigil.cz/misc/WeiDU-1.90-Linux.tar.bz2
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 15, 2006, 11:29:42 AM
Not sure what CLI is but kernel version can be obtained via uname -sr.
Kernel version: Linux 2.6.8-2-386 (I believe it's debian)
CLI= Command Line Interface.

Quote
I little enhanced lower-casing script (but I am no shell programmer - it is my first script which is doing something useful).<snip>
I also compiled linux weidu, could some check if it is working. AFAIK it is ELF format which should be executable on all linux distributions.
http://files.sigil.cz/misc/WeiDU-1.90-Linux.tar.bz2
Thanks  :)
However, if you can confirm that Linux executables also run in other kernel/distros(*), I think I'll compile WeiDU (and other mod-ish programs like tisunpack) on linux and maintain it myself  :)
*: the Linux machine I have access to is located at 300 km from here, doesn't have BGII nor do I have the disk space required to install it, so  :(
Title: Re: [request] Wine(linux) support
Post by: ronin on March 15, 2006, 01:57:42 PM
@Drake127

your tarball works great on Ubuntu

Linux Stormbringer 2.6.15-18-686 #1 SMP PREEMPT Thu Mar 9 15:29:22 UTC 2006 i686 GNU/Linux

dont know if it makes a difference but I also have ocaml compiled and installed, so i dont know it it will run with out ocaml being installed.

ronin
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 15, 2006, 02:00:16 PM
Can you try with this one (http://linuz.sns.it/~v.bigiani/files/WeiDU-188.tar.gz)?
I happened to have a linux version floating around (although it's only 188 rather than 190, but if I can confirm that 'my' version works I'll put that up as well).
Title: Re: [request] Wine(linux) support
Post by: ronin on March 15, 2006, 02:10:53 PM
@the Bigg

works also.... I copied it to Setup-GUI.exe and tried to execute it, I didnt convert all my files to lowercase so it crapped out but it appears to work like the one from Drake127

[./Setup-GUI.exe] WeiDU version 188
[On this architecture, WeiDU does not auto-update.
  You must ensure that you have the most recent version.]


** ERROR ** [SETUP-GUI.TP2] not found.
Make sure that you have unpacked the archive correctly and
that you are not trying to run this file from inside an archive.[./Setup-GUI.exe] Using scripting style "BG"

Press ENTER to exit.


ronin
Title: Re: [request] Wine(linux) support
Post by: ronin on March 15, 2006, 02:12:41 PM
after renaming the .tp2 to all caps i get this:

[./Setup-GUI.exe] WeiDU version 188
[On this architecture, WeiDU does not auto-update.
  You must ensure that you have the most recent version.]
[./Setup-GUI.exe] Using scripting style "BG"

Install Component [Game Graphical User Interface (GUI)]?
[R]e-install, [N]o Change, ninstall, [Q]uit or choose one:
 1] "Original SoA/ToB"
 2] "Big Picture" (currently installed)

I picked 2 and it worked.

ronin
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 15, 2006, 02:13:40 PM
Well, yeah, if it's able of executing then I guess the executable format is the same (which was my main concern).

Once I hear back from the testers (casts summon devSin) I'll publish v191-linux with everything-to-lowecase and other goodies (tisunpack-linux, sox/oggdec-linux, and some utility scripts)  ;)
Title: Re: [request] Wine(linux) support
Post by: ronin on March 15, 2006, 02:19:04 PM
GREAT!!!!  then I can remove my WinXP partition on my laptop and go all linux, I am currently only using winxp for BG2

your BIGG

cheers dewd

ronin
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 15, 2006, 02:24:20 PM
Isn't it needed to run BG2 anyway?
Title: Re: [request] Wine(linux) support
Post by: ronin on March 15, 2006, 02:27:41 PM
I can run it with wine or cedega (transgaming), i have done it before but installing mods is a serious pain in the ass.  I used to do it this way:  http://forums.gentoo.org/viewtopic.php?t=243593    ......but the work required to get it working is not worth it.  If you can get weidu to do the biffing and tis stuff then I have no reason to run it on winxp anymore.  BG1, TotSC, BG2 and TOB work fine with cedega and wine.

@Drake127, sorry for interrupting your thread like this.

ronin
Title: Re: [request] Wine(linux) support
Post by: drake127 on March 15, 2006, 04:12:10 PM
Isn't it needed to run BG2 anyway?
No, there is no problem with IE games on linux partition ... let me think ... if you mount ~/.wine/drive_c/ to FAT32 partition maybe it would solve case problem as well. But I am not sure if case-sensitivness if feature of filesystem or Windows itself.
Title: Re: [request] Wine(linux) support
Post by: ronin on March 16, 2006, 12:38:56 AM
If you mount your FAT32 partition the right way then it keeps the case sensitivity and works correctly with upper and lowercase.

ronin
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 16, 2006, 09:11:10 AM
There are case-insensitive Ext2 and Ext3 drivers around the 'net. I suppose that the same could be true for FAT32.
Title: Re: [request] Wine(linux) support
Post by: drake127 on March 16, 2006, 05:14:22 PM
There are case-insensitive Ext2 and Ext3 drivers around the 'net. I suppose that the same could be true for FAT32.
So if you mount your installation of BG via this CI filesystem it will eliminate all these problems, won't it?
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 16, 2006, 06:06:12 PM
Installing a new driver, recompiling the kernel and editing your fstab is more difficult (and probably less stable!) than downloading (or compiling) WeiDU and turning everything to lowercase via a script.
Title: Re: [request] Wine(linux) support
Post by: ronin on March 17, 2006, 01:10:44 AM
Biggs idea is the easiest and quickest, let me see if I understand this, weidu will do the conversion from caps to little letters or will we have to run a script ourselves in the BG directory?

ronin
Title: Re: [request] Wine(linux) support
Post by: drake127 on March 17, 2006, 03:57:02 AM
Biggs idea is the easiest and quickest, let me see if I understand this, weidu will do the conversion from caps to little letters or will we have to run a script ourselves in the BG directory?

ronin
You have to run the script in BG directory (and all files will became lower-case). WeiDU's job is to install all mods' files in lowercase (=>right overwriting and no case duplicities). So you will have to do both things.

Bigg: In this concrete example where solutin is on the way and it is working yes but generally for all windows applications which may face same troubles (and its author is not talkative) is good to know how to do it generally. BTW can you implement this lowercasing for linux only compilations? I think not every modder would be content if he likes to play with his files' case and you convert it all on Windows platform.
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 17, 2006, 04:36:35 AM
Yes, it's linux only. BTW, the drivers I was talking about are here (http://bill.herrin.us/freebies/).
Title: Re: [request] Wine(linux) support
Post by: Avenger_teambg on March 22, 2006, 01:42:47 AM
Hey, nice to see that linux/wine isn't completely ignored :)
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 22, 2006, 06:22:26 AM
Does it work now for you, Ave?
Title: Re: [request] Wine(linux) support
Post by: Avenger_teambg on March 22, 2006, 11:47:47 AM
Weidu for linux returns nonzero though it decomplies the stuff OK. This misleads dltcep somehow.
I will try the new weidu for windows (on wine) too :)

weidu for windows on wine gives this (the usual wine problem):
Executing:"y:\bg2\dltcep\weidu.exe"  --script-style IWD2 --out "script compiler\decompiled" --tlkout dialog.tlk "00AATBF.bcs" --log dltcep.log
[DLTCEP_enhanced_WeiDU] WeiDU version 191
fixme:msvcrt:MSVCRT__sopen : pmode 0x01b6 ignored

FATAL ERROR: Sys_error("script compiler\\decompiled: Permission denied")
--------------------------------------------------------------------------------------
If you can fix the return value somehow, then i don't care with wine anymore :)
I can even add an option to dltcep to ignore the return value (i somehow am reluctant to do this).
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 22, 2006, 02:01:56 PM
Weidu for linux returns nonzero though it decomplies the stuff OK. This misleads dltcep somehow.
I will try the new weidu for windows (on wine) too :)

weidu for windows on wine gives this (the usual wine problem):
Executing:"y:\bg2\dltcep\weidu.exe"  --script-style IWD2 --out "script compiler\decompiled" --tlkout dialog.tlk "00AATBF.bcs" --log dltcep.log
[DLTCEP_enhanced_WeiDU] WeiDU version 191
fixme:msvcrt:MSVCRT__sopen : pmode 0x01b6 ignored

FATAL ERROR: Sys_error("script compiler\\decompiled: Permission denied")
--------------------------------------------------------------------------------------
If you can fix the return value somehow, then i don't care with wine anymore :)
I can even add an option to dltcep to ignore the return value (i somehow am reluctant to do this).

Well, the problem with Wine is that WeiDU tries to uppercase everything it opens, and this causes problems with your FS.
Can you figure out which value does WeiDU return to DLTCEP? That'd be of help  :)
Title: Re: [request] Wine(linux) support1
Post by: Avenger_teambg on March 23, 2006, 03:49:55 AM
I use it on a case insensitive filesystem (fat32 mounted rw), so there shouldn't be problems with the filenames.
The value returned is: 1106235736
It could be that i  (involuntarily) call weidu with a non-pausing spawn and the returned value is the PID :)
Title: Re: [request] Wine(linux) support1
Post by: the_bigg_at_school on March 23, 2006, 04:09:22 AM
I use it on a case insensitive filesystem (fat32 mounted rw), so there shouldn't be problems with the filenames.
The value returned is: 1106235736
It could be that i  (involuntarily) call weidu with a non-pausing spawn and the returned value is the PID :)

Uuh, WeiDU should return either 0,1,2,3,4. I believe that either something is wrong in the wine calling ELF executables part, or something else on this line  :)

I'll try to post a Win32 executable that maps everything to lowercase and see if it helps  :)

EDIT: special lowercase_all version of weidu for Ave. Let me know if this is of any help  :)
Title: Re: [request] Wine(linux) support
Post by: the bigg on March 24, 2006, 06:31:27 AM
*bump* in case Avenger missed the edit.
Title: Re: [request] Wine(linux) support
Post by: Avenger_teambg on March 25, 2006, 04:18:52 PM
didn't help
Title: Re: [request] Wine(linux) support1
Post by: Avenger_teambg on March 25, 2006, 04:20:27 PM
I use it on a case insensitive filesystem (fat32 mounted rw), so there shouldn't be problems with the filenames.
The value returned is: 1106235736
It could be that i  (involuntarily) call weidu with a non-pausing spawn and the returned value is the PID :)

Uuh, WeiDU should return either 0,1,2,3,4. I believe that either something is wrong in the wine calling ELF executables part, or something else on this line  :)
Yes, this is highly likely, they don't support the P_WAIT option for ELF. Curse them. :(
This is getting ridiculous.