matatk / agrip

AGRIP AudioQuake and Level Description Language (LDL)
http://agrip.org.uk
Other
16 stars 6 forks source link

unexpected error in qmodlib #70

Closed hidwood closed 3 years ago

hidwood commented 3 years ago

I recently received this error when trying to install a mod. "Please report this error, with the following details, at https://github.com/matatk/agrip/issues/new - thanks! qmodlib.BadQMODFileException: Missing 'qmod.ini'

File "launcherlib\ui\tabs\mod.py", line 40, in install_qmod_handler File "qmodlib.py", line 27, in init" I'm not sure if this is being updated anymore but if it is I thought you should know. I'm running windows 10 home 64 bit 20h2. The mod I'm trying to use

can be found below. jediquake41.zip

matatk commented 3 years ago

Hi @hidwood and thanks for your bug report. I noticed a couple of things with the QMOD/ZIP file that seem to be causing the problem, though the fact you've raised this has made me wonder if, when there is a problem with the QMOD file, the error message could be a bit more user-friendly.

Anyway, here is what I noticed:

  1. Everything in the QMOD/ZIP file is contained within a directory, but the expectation is that you have a "qmod.ini" file and a directory containing everything else at the root of the ZIP file—so in this case there's an extra directory layer that isn't expected to be there.

  2. There is a second "qmod.ini" file inside the directory that contains all of the mod data (which is inside of the outer extra directory). This extra file isn't so much of a problem, but it would be ignored by the launcher, so there's no need for it to be there.

I could work around the first problem in the Launcher's code. I was thinking of writing a tool for developers to use to make a QMOD file (or check one they've made), but time is a bit of a constraint and I'm not sure how many people are actually using this (but recent bug reports have shown me some people are, which is nice to know) :-).

One last thing: please try to avoid uploading attachments in future (the file is only needed temporarily, but there's no way to delete it)—but thanks again for your report and I will see what I can do about it on this end.

hidwood commented 3 years ago

Thanks for getting back to me on this, apparently it seems to be a problem with this particular version because someone got it to run with an older version somehow. sorry about using attachments, I didn't know that you couldn't delete them. I followed all of the steps so that there is one directory instead of two, and repackaged it but I ran into the same error. Again, thanks for getting back so soon.

matatk commented 3 years ago

I recently remembered that, depending on the tool or OS you're using to create the ZIP file, sometimes they will automatically wrap the whole thing in an extra directory if you select more than one file to compress at once. Perhaps that could be causing the error.

I've updated the code to cope with everything being contained in a wrapping directory and I've just released an updated beta version, so you shouldn't encounter this problem any more.

I've closed this issue for now, as my testing indicated this is working now, but if you have any problems, feel free to re-open it. Thanks for reporting the problem @hidwood!