Unable to read ARGV[0]?

Started by Aika, Sun 25/04/2004 07:28:54

Previous topic - Next topic

Aika

Hello,

I have encountered a weird problem while trying to play the game "5 days a strange". And I couldn't find any help about this problem anywhere.

First, when I run winsetup.exe it displays the following error message.
---------------------------
Error
---------------------------
Unable to read ARGV[0]?
---------------------------
OK  
---------------------------

After that, if I try to run 5days.exe, it displays the following error message which probably happens due to the incomplete setup process.
---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x0046DD82 ; program pointer is +9902, ACI version 2.55.560, gtags (0,0)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.



Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.
---------------------------
OK  
---------------------------

I tried it on Windows 2000 and Windows XP and both show the same problem.  Does anyone know what's causing this problem?

Thank you for the help.


Aika

I just found out the solution.
I had to type winsetup.exe instead of winsetup, which somehow seems to be expecting winsetup.exe as argv[0] not winsetup.

Thanks,

Pumaman

Interesting, it should really handle that - I guess 99% of the time, people double-click the file rather than typing its name in.

Did fixing that also fix the in-game crash?

Aika

Yes, it fixed that problem also. Basically the setup program and also AGS client read the data from the executable. And they use the argv[0] as the name of this data file. This argv[0] was just the front part of exe file name when I typed it from the command line  because, naturally, I just typed winsetup (or 5days) from the command line. I guess most people never experienced this problem because when you double-click the file from the explorer, the argv[0] defaults to the whole file name.

Thanks,

Pumaman

Thanks for the info, I'll get it fixed.

I must admit I'm surprised - I assumed Windows would translate argv0 into the full filename being executed, but obviously not.

SMF spam blocked by CleanTalk