Fails to run up on Windows when invoked from a different directory

Bug #1410529 reported by Rob Norris
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Stellarium
Fix Released
Low
Alexander Wolf
0.14
Fix Released
Low
Alexander Wolf

Bug Description

Using Stellarium 0.13.1 on Windows 7 64bit (using either Stellarium 32 or 64 bit versions) fails to run when invoked from a different directory.

Install in the default directory.
Then use the command line:

c:
cd \
"Program Files\Stellarium\stellarium.exe"

Gives a error dialog:

"This application failed to start because it could not find or load the Qt platform plugin "windows".

Reinstalling the application may fix this problem."

And then the program aborts.

Whereas on the command line:

cd "Program Files\Stellarium\"
stellarium.exe

Works as expected.

Other FOSS Qt5 programs (e.g. Subsurface) (and Gtk+ programs e.g. Inkscape) work fine when invoked from another directory.

I can work around this problem by creating a shortcut to the main Stellarium binary and calling that (or calling the shortcut on the Desktop or Menu system if available) since the shortcut sets the working directory to the target directory.

Unfortunately that is not ideal for my use case of calling it remotely without 'special system configuration'.

Tags: windows qt5

Related branches

Revision history for this message
gzotti (georg-zotti) wrote :

So what?
Stellarium on Windows is started by double-clicking its icon.
If you want to do something else, you must know: Stellarium.exe must be started from its directory so it can find its data.
Also the link is configured so that its working directory is the Stellarium folder.
You created a problem for yourself and already mentioned the (trivial) solution. You can also write a .bat file, equally simple.

Changed in stellarium:
status: New → Opinion
importance: Undecided → Low
Revision history for this message
Rob Norris (rw-norris) wrote :

"Stellarium on Windows is started by double-clicking its icon."

This is difficult to do when invoking Stellarium from another application!

In this instance it can't find it's own DLLs (agreed Stellarium needs to know where it's data is - which might be an ancillary problem - although the executable must know where itself is?).

Agreed it is a low priority.

Revision history for this message
Alexander Wolf (alexwolf) wrote :

> although the executable must know where itself is?

We don't use Windows registry (like Subsurface for storage itself location)

Revision history for this message
Nick Fedoseev (nick-ut2uz) wrote :

There's no need to use registry to determine the full path of the program.

Try to play with

 qDebug() << QCoreApplication::applicationDirPath();
 qDebug() << QCoreApplication::applicationFilePath();
 qDebug() << QCoreApplication::libraryPaths();
 qDebug() << QDir::currentPath();

Revision history for this message
Alexander Wolf (alexwolf) wrote :

A fix has been committed as revision 8029 of the trunk branch of Stellarium's Bazaar repository at Launchpad: http://bazaar.launchpad.net/~stellarium/stellarium/trunk/revision/8029

P.S. Using Windows registry for saving/retrieving installation path

Changed in stellarium:
assignee: nobody → Alexander Wolf (alexwolf)
milestone: none → 0.15.0
status: Opinion → Fix Committed
Changed in stellarium:
status: Fix Committed → In Progress
Changed in stellarium:
status: In Progress → Fix Committed
Changed in stellarium:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.