Jump to content


Photo

Bat file weirdness


  • Please log in to reply
7 replies to this topic

#1 Lord_Jeremy

Lord_Jeremy
  • Member
  • 22 posts

Posted 25 March 2011 - 03:33 AM

I typed a long descriptive post of my problem, but then the forum software decided to fark up and lose it, so I'm going to be concise now. I'm running the BWP setup in wine-based crossover on a Mac system. I know BG and BG2 work, I've played them on it. Everything is relatively smooth until the bat file is run. The install procedure makes use of referencing text files with @ symbols in their names for language localizations. For some reason, the cmd in wineconsole is not parsing those symbols as part of a filename and are thus erroring out. POSIX systems should allow an @ in the filename and presumably windows does too, so this is probably a bug. Even so I need a workaround to get the script to run. I could potentially use a RegEx to replace the relevant @s in the bat with another safer character as well as write a bash script to rename the files, though I'd rather just escape the characters in the bat, if possible. Anyone have any suggestions?

Edit:
Right so I used a script to rename all the localization files and properly altered the scripts with a regex
\@[0-9]|\@[A,B,C]
It still doesn't work. I replaced the @s with x's and now it says
Path not found
Failed to open 'BiG World Installpack\English\'

File not found
Failed to open 'x0'
(or some other number)

Perhaps it's not the symbol in the paths. Any suggestions? I might try expanding the variable defines to represent full paths from the C drive.

Edited by Lord_Jeremy, 25 March 2011 - 10:51 AM.


#2 Miloch

Miloch

    Barbarian

  • Modder
  • 6579 posts

Posted 25 March 2011 - 11:24 AM

You'll probably have to post the batch code that isn't working, but it might help to put filenames with characters like @ in quotes. That is a valid ASCII character, so there shouldn't be any problem with it in filenames. It works even without quotes on both my Windows and Linux machines.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#3 Lord_Jeremy

Lord_Jeremy
  • Member
  • 22 posts

Posted 27 March 2011 - 10:39 PM

Right. I meant to post the BATs but forgot... Here's what the setup tool spit out, unmodified: pastebin link
This is the file after I replaced the '@' character with just 'x' in the paths and the filenames: pastebin link

I did try putting quotes in the paths in the script, but that didn't seem to help. I'm quite familiar with bash scripting, but I have to say looking at these BATs has reminded me why I avoid DOS like the plague.

#4 dabus

dabus
  • Member
  • 1982 posts

Posted 28 March 2011 - 01:05 AM

Uhm, isn't the problem the "mac + wine running CMD-stuff"?

You could try to replace those entries with the translation from the files and see if the errors still come up.
Replace just the first to see if it has an effect.

And isn't Baldur's Gate ported to Mac and able to run natively?

Edited by dabus, 28 March 2011 - 01:05 AM.

THINK! - It's not illegal.

#5 Miloch

Miloch

    Barbarian

  • Modder
  • 6579 posts

Posted 28 March 2011 - 09:46 AM

Also, it might help to post the code in [ spoiler ] [ /spoiler ] tags here instead of linking it on an external site.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#6 Lord_Jeremy

Lord_Jeremy
  • Member
  • 22 posts

Posted 28 March 2011 - 11:45 AM

Uhm, isn't the problem the "mac + wine running CMD-stuff"?

You could try to replace those entries with the translation from the files and see if the errors still come up.
Replace just the first to see if it has an effect.

And isn't Baldur's Gate ported to Mac and able to run natively?

I'll see if I can write a script to do that. There are hundreds of references so doing it manually isn't really an option.

Also Baldur's Gate was ported to Mac about 12 or 13 years ago. Baldur's Gate 2 for Mac is slightly newer than that. In those days, Macs had PowerPC processors, a completely different architecture than modern Macs with x86 processors. Also Baldur's Gate was ported to a completely different generation of Mac OS that can't be run on a Mac newer than 2005. In short, the games were ported but they are no longer able to run natively. Actually since I do have an x86 processor, I technically am running the PC versions natively. All wine is doing is emulating the Windows software layer under the programs. It's fully capable of properly running DOS/CMD scripts.

#7 dabus

dabus
  • Member
  • 1982 posts

Posted 28 March 2011 - 12:45 PM

I'd still suggest to see if errors still appear for one occasion if you edit the script manually.
It's faster than wasting your time creating scripts that are good for nothing.

I also started writing the BWS using wine a few years ago, then using vmware running w2k and then a native xp pro. And wine did produce some funny effects / errors back then and has to handle something differently if the batch runs using a native OS and fails when being using on a different OS.

Don't get me wrong: It's a good approach, it's fast, guys put a lot of work into it. Maybe you can track down the error or blame the serving OS for some sort of restriction, but I wouldn't bet that wine can handle all the calls/behavior the native OS provides - including running batches.

By the way: If you can't make it, you could try to run the beta which does not run the BiG World Install.bat. I makes use of the other batches though.

Edited by dabus, 28 March 2011 - 12:48 PM.

THINK! - It's not illegal.

#8 Miloch

Miloch

    Barbarian

  • Modder
  • 6579 posts

Posted 28 March 2011 - 05:40 PM

You might want to put the link to the BWS beta in your signature or something, dabus. It is very hard to dig up in the forum unless you've got it bookmarked or something.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle