Hard Light Productions Forums

General FreeSpace => FreeSpace & FreeSpace Open Support => Topic started by: jr2 on October 08, 2018, 08:27:56 pm

Title: Is there a way for FSO to probe whether a dll is 32 or 64-bit & message that?
Post by: jr2 on October 08, 2018, 08:27:56 pm
What it says on the tin.  FSO probes the dlls before first load to see what architecture they are and throws an error message if it's a mismatch.


Title: Re: Is there a way for FSO to probe whether a dll is 32 or 64-bit & message that?
Post by: ngld on October 08, 2018, 08:42:27 pm
Not possible since the DLLs are loaded before FSO itself is run... unless you're going to change how the libraries are linked which seems like a waste of effort.
Title: Re: Is there a way for FSO to probe whether a dll is 32 or 64-bit & message that?
Post by: m!m on October 09, 2018, 10:42:38 am
Why are you having issues with this?

Knossos handles different platforms automatically and the nightly builds (but not 3.8 unfortunately) include every required DLL so extracting that will also not cause issues if you use wxLauncher.
Title: Re: Is there a way for FSO to probe whether a dll is 32 or 64-bit & message that?
Post by: ngld on October 09, 2018, 02:33:56 pm
This can become an issue if you're using wxLauncher and try to use both 32 and 64bit builds. Since wxLauncher expects all builds to be in the same directory, the DLLs conflict.
Maybe we can make wxLauncher check if the DLLs match the bitness of the selected executable? That would solve that problem at least.

Another problem that some people have run into is that copying the SDL2.dll from FSO to wxLauncher (to fix the joystick UUID issue) can cause the same error if it's the 64bit SDL2.dll since wxL itself is 32bit. Though once again that's much harder to solve and seems to be much rarer.
Title: Re: Is there a way for FSO to probe whether a dll is 32 or 64-bit & message that?
Post by: The E on October 09, 2018, 03:32:38 pm
That seems like a lot of work for a use-case that we definitely do not want to encourage.
Title: Re: Is there a way for FSO to probe whether a dll is 32 or 64-bit & message that?
Post by: m!m on October 10, 2018, 11:38:38 am
It's not really an issue for wxLauncher if users extract all files within the download package which apparently is not a reasonable expectation...
Title: Re: Is there a way for FSO to probe whether a dll is 32 or 64-bit & message that?
Post by: jr2 on October 12, 2018, 11:51:17 am
I don't have issues with this, but I keep reading cases where this happens (I'm guessing dozens over the last 6 months or so).  For every case we hear about, how many more go unreported?  There has to be a way to prevent this.  I mean, Knossos is great, but not everyone is going to use it (yet).

There isn't a way to combine 32 and 64 bit dlls so that the appropriate part loads, is there? (I'm assuming not).
Title: Re: Is there a way for FSO to probe whether a dll is 32 or 64-bit & message that?
Post by: m!m on October 12, 2018, 12:02:10 pm
It would be a huge amount of work to add the ability to have 32- and 64-bit builds in the same directory. It is not worth the effort to implement this feature.
Title: Re: Is there a way for FSO to probe whether a dll is 32 or 64-bit & message that?
Post by: Trivial Psychic on October 12, 2018, 05:51:06 pm
How about a useful error message?
Title: Re: Is there a way for FSO to probe whether a dll is 32 or 64-bit & message that?
Post by: ngld on October 12, 2018, 08:00:43 pm
The error message is produced by Windows before FSO is run. The only way to produce a proper error message would be having wxLauncher check the DLLs and the exe to detect this case before it launches FSO.