Author Topic: Path for IniFileName under mono environment  (Read 1730 times)

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Path for IniFileName under mono environment
« 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.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Path for IniFileName under mono environment
« Reply #2 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.

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Path for IniFileName under mono environment
« Reply #3 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:

===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Path for IniFileName under mono environment
« Reply #4 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?"
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Path for IniFileName under mono environment
« Reply #5 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.
« Last Edit: September 02, 2019, 08:36:53 PM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Path for IniFileName under mono environment
« Reply #6 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?

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Path for IniFileName under mono environment
« Reply #7 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
« Last Edit: September 02, 2019, 09:46:58 PM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Path for IniFileName under mono environment
« Reply #8 on: September 02, 2019, 09:45:48 PM »
Cool.