Qalculate / qalculate-gtk

Qalculate! GTK+ UI
https://qalculate.github.io/
GNU General Public License v2.0
945 stars 68 forks source link

Windows portable package not runnable under certain path #171

Open airium opened 4 years ago

airium commented 4 years ago

Platform: Windows 10 1909 Version: 3.11.0-i386, portable zip package If the path to qalculate executable contains a directory named as "bin", the application will fail to start. For example, uncompress the zip package to E:/bin/, the path to the executable is E:\bin\qalculate\qalculate.exe, the application will fail to start. In windows Event Viewer, an application error can be found:

Faulting application name: qalculate.exe, version: 0.0.0.0, time stamp: 0x5eeee7a6
Faulting module name: KERNELBASE.dll, version: 10.0.18362.959, time stamp: 0x51671cfe
Exception code: 0x80000003
Fault offset: 0x0015e292
Faulting process id: 0x4278
Faulting application start time: 0x01d663729088da51
Faulting application path: E:\bin\qalculate\qalculate.exe
Faulting module path: C:\windows\System32\KERNELBASE.dll
Report Id: 4bfb2c4b-665c-4505-86f7-42e4096fb862
Faulting package full name: 
Faulting package-relative application ID: 
hanna-kn commented 4 years ago

That is strange. I can confirm the behaviour, but not explain it.

Qalculate actually checks if the binary is in a directory named "bin" (to see if it runs in a MinGW environment), but this is not affected by the directories above the immediate directory (e.g. in this case it finds the directory name "qalculate" and does not care that the directory above is named "bin"). I removed the the code and the issue remained.

The command line program (qalc.exe) is not affected.

JohnTHaller commented 1 year ago

I've confirmed this to be an issue if Qalculate is run with a directory called specifically bin anywhere as a parent directory of the current directory on Windows. With the 32-bit portable zip packages both the GTK and Qt builds fail to run. With the 64-bit portable zip package, the GTK build fails to run but the Qt build will run successfully. We encountered this with the PortableApps.com package of Qalculate Portable.