It's not executing fully if called through a different program

Asked by Karol See

Hello,

I'm trying to build a small C# System that calls on a couple of pre-installed educational system. It's working perfectly for all the programs, except for Stellarium. It just loads up the welcome screen, actually just the version number, but the whole program doesn't boot up and I'm currently stumped. Hoping for your help, thank you.

Karol See

Question information

Language:
English Edit question
Status:
Solved
For:
Stellarium Edit question
Assignee:
No assignee Edit question
Solved by:
Bogdan Marinov
Solved:
Last query:
Last reply:
Revision history for this message
Bogdan Marinov (daggerstab) said :
#1

What does the log say?

The log file is called "log.txt" and it is in Stellarium's user data directory.

Where the user data directory is depends on your operating system:
http://www.stellarium.org/doc/head/fileStructure.html

Revision history for this message
Karol See (karol-see) said :
#2

Thank you for your fast reply.

Apparently, the problem lies in the QPainter?

from log:

QPainter::begin: A paint device can only be painted by one painter at a time.
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::worldTransform: Painter not active
QPainter::save: Painter not active
QPainter::restore: Unbalanced save/restore
QPainter::save: Painter not active
QPainter::setWorldTransform: Painter not active
QPainter::setOpacity: Painter not active
QPainter::opacity: Painter not active
QPainter::restore: Unbalanced save/restore
QPainter::save: Painter not active
QPainter::setWorldTransform: Painter not active
QPainter::setOpacity: Painter not active
QPainter::opacity: Painter not active

Revision history for this message
Karol See (karol-see) said :
#3

Or, it also couldn't find this file:

WARNING : Can't find texture file "textures/logo24bits.png" : file not found: textures/logo24bits.png

Revision history for this message
Best Bogdan Marinov (daggerstab) said :
#4

Are you sure you are starting Stellarium in the correct working directory and that it has read-access to its data files?

I'm not sure how exactly do you start an external executable in C#, but typically one can set the path to the executable itself and the working directory where it should be started.
http://en.wikipedia.org/wiki/Working_directory

Revision history for this message
Karol See (karol-see) said :
#5

Yeah, I just call the stellarium.exe file, which is in the same folder as textures, data, landscape, stars, locale, and all the rest, All these files are in the Stellarium folder, in my Program Files. If I run Stellarium directly, like from my program files it runs smoothly. I can't figure out what I'm missing, it doesn't seem to be having any parameters in startup anyway?

Revision history for this message
Bogdan Marinov (daggerstab) said :
#6

Do you know what the term "working directory" means, yes or no?

What C# function call do you use to start Stellarium?

It would be much better if I can see a greater portion of the log file. You can edit out your user name from the paths.

Revision history for this message
Karol See (karol-see) said :
#7

Yes, I know what a working directory is.

I'm able to call on stellarium, it's just.. incomplete I think?

I use the function Process.Start(@"C:\Program Files\Stellarium\stellarium.exe") to execute.

2011-03-31T23:42:50
Windows Vista
Compiled with GCC 4.4.0
Qt runtime version: 4.7.1
Qt compilation version: 4.7.1
Addressing mode: 32-bit
Total memory: 2047 MB (unreliable)
Total virtual memory: 2047 MB (unreliable)
Physical memory in use: 64%
Processor speed: 1828 MHz
Processor name: Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz
Processor speed: 1828 MHz
Processor name: Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz
C:\Program Files\Stellarium\stellarium.exe
 ---------------------------------------------------------
[ This is Stellarium 0.10.6.1 - http://www.stellarium.org ]
[ Copyright (C) 2000-2010 Fabien Chereau et al ]
 ---------------------------------------------------------
Writing log file to: "C:/Users/Karol See/AppData/Roaming/Stellarium/log.txt"
File search paths:
  0 . "C:\Users\Karol See\AppData\Roaming\Stellarium"
Config file is: "C:\Users\Karol See\AppData\Roaming\Stellarium/config.ini"
ERROR while loading translations: file not found: data/iso639-1.utf8

OpenGL supported version: "2.1.0"
Qt GL paint engine is: "OpenGL2"
WARNING : Can't find texture file "textures/logo24bits.png" : file not found: textures/logo24bits.png

Cache directory is: "C:\Users\Karol See\AppData\Local\stellarium\stellarium\cache"
WARNING StelFileMgr::StelFileMgr: could not find install location: "." (we checked for "./data/ssystem.ini" ).
QPainter::begin: A paint device can only be painted by one painter at a time.
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::worldTransform: Painter not active
QPainter::save: Painter not active
QPainter::restore: Unbalanced save/restore
QPainter::save: Painter not active
QPainter::setWorldTransform: Painter not active
QPainter::setOpacity: Painter not active
QPainter::opacity: Painter not active
QPainter::restore: Unbalanced save/restore
QPainter::save: Painter not active
QPainter::setWorldTransform: Painter not active
QPainter::setOpacity: Painter not active
QPainter::opacity: Painter not active

Revision history for this message
Bogdan Marinov (daggerstab) said :
#8

Well, yes, for some reason it can't find its installation directory. In a normal log, there are two paths under "File search paths:" - one to the user data directory, one to the installation directory.

Try using Process.Start() with a ProcessStartInfo class:
http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.aspx
and set the "working directory" property with Stellarium's directory in the Program Files:
http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.workingdirectory.aspx

Revision history for this message
Karol See (karol-see) said :
#9

There you go, I was assuming it would automatically get the executable file's directory. Thank you! :)

Revision history for this message
Karol See (karol-see) said :
#10

Thanks Bogdan Marinov, that solved my question.