AdvancedHMI Software

General Category => Open Discussion => Topic started by: bachphi on September 02, 2019, 04:46:14 PM

Title: Path for IniFileName under mono environment
Post by: bachphi on September 02, 2019, 04:46:14 PM
Does anyone know what path to use for IniFileName under mono?

I have tried "." , "./" , ".\" and just the filename only.
Currently , to get it working, I use its absolute path which is sort of lame.
Title: Re: Path for IniFileName under mono environment
Post by: Godra on September 02, 2019, 05:15:26 PM
Maybe take a look at this:

https://www.mono-project.com/docs/faq/known-issues/urikind-relativeorabsolute/
Title: Re: Path for IniFileName under mono environment
Post by: Godra on September 02, 2019, 05:36:02 PM
Maybe this might be better choice:

https://stackoverflow.com/questions/39601742/mono-executes-program-with-wrong-current-directory

What you see as "lame" seems to be the best approach.
Title: Re: Path for IniFileName under mono environment
Post by: bachphi on September 02, 2019, 06:29:35 PM
lol, I guess so. Just trying out your & Archie mono serial driver today. Nice work, btw.

This is what I have:

(https://i.postimg.cc/sgsdkmbM/Micrologix-and-Raspberry-Pi.png)
Title: Re: Path for IniFileName under mono environment
Post by: bachphi on September 02, 2019, 08:06:43 PM
I am now able to set its path "./IniFilename.ini"

and creating a AAHMI.desktop icon w/ entry
Code: [Select]
[Desktop Entry]
Type=Application
Name=AAHMI Prog
Path=/home/pi/AAHMI/Debug/
Icon=/home/pi/AAHMI/AHMI00.ico
Exec=mono AdvancedHMI.exe
Terminal=false
Comment[en_US]=Launch AAHMI
GenericName=App. Description

The lame thing now is the new Raspian Buster. When double click the desktop shortcut, it brings up a dialog "This text file seemed to be an executable script. What do you want to do with it?"
Title: Re: Path for IniFileName under mono environment
Post by: bachphi on September 02, 2019, 08:25:43 PM
it's cool now :) by following the steps from here:
https://www.raspberrypi.org/forums/viewtopic.php?t=245152

P.S.  That link does get me thinking of which companies are using Pi as thin clients.
Years ago, we have thin clients login to server using VT100, Vt200 terminals and such, then went away with personal PCs.  ... and now we are back to thin client - server.
Title: Re: Path for IniFileName under mono environment
Post by: Godra on September 02, 2019, 09:14:14 PM
Can you elaborate on everything you stated in Reply #4?

Was it just sufficient to use "./IniFilename.ini" or did you have to make any changes?
What are the steps for creating that AAHMI.desktop icon?
Title: Re: Path for IniFileName under mono environment
Post by: bachphi on September 02, 2019, 09:41:34 PM
Instead of using absolute path for IniFileName entry, I simply used ./Myfilename.ini 

and created a file name  /home/pi/Desktop/AAHMI.desktop with entry content as above.

Next, set it to executable

sudo chmod +x /home/pi/Desktop/AAHMI.desktop

Now you can double click the shortcut on the desktop to run
Title: Re: Path for IniFileName under mono environment
Post by: Godra on September 02, 2019, 09:45:48 PM
Cool.