tags:

views:

100

answers:

1

I got a little c# dll that implements a message queue service and on windows it runs perfectly. To locate all the queues i use an enviroment variable stored in Machine during the installation.

System.Environment.SetEnvironmentVariable("PHMQ", install_dir , EnvironmentVariableTarget.Machine);

Now i just tryed to run it on Mono, and when the programs run it throw an exception. The PHMQ service is not installed.

After 2 hours of search, i discovered that Mono doesn't really store this kind of variables it just send them to null. (a simple text file was too simple ?)

So, the question is: How can i solve this problem ? The first idea was : if is running on linux put it in a specific folder like /opt, but it's a dll, if do it in this way any program that want to use it must be executed like root

Any ideas ?

A: 

You could have your program append a line to /etc/environment to set the env var for the machine. Obviously to modify that file you'll need root, so it should be done during the installation process.

However, a known location would be better IMO. I can't see why you wouldn't be able to execute from /opt.

mhutch
Infact i solved it in this way, during the installation it trequire your root pass and set chmod 777 over a new folder under /var/.I fixed it last week but i forgot to vcse the question :)
TheQult
@TheQuit - If you solved it in this manner, I recommend marking mhutch's answer as "the answer" (the tick on the left). If your accept rate gets much lower, people will be reluctant to answer your questions.
Richard Szalay