[Gambas-user] Automatic Startup

Martin mbelmonte at belmotek.net
Mon Nov 7 01:46:44 CET 2022


El 6/11/22 a las 23:29, gian via User escribió:
> Unfortunately, yours can't be the solution because that way it doesn't 
> work if you have the IDE installed.
> And it is not possible to know beforehand for sure whether you start 
> from the IDE or from the packages ...

As my wife says, relax Max. Don't worry.

The "solution" works, it doesn't matter if you have the ide installed or 
not, what matters is that you install the package.
And while we're at it, I think the best way to distribute an application 
is through the package, but if you still don't want to use the package 
it is possible that the application "knows" how it is working if from 
the ide or from the installed executable, like follow:

'' Indicates if the program is running from the IDE or from an 
executable only using prawn code.

Static Public Function WhereRun() As Integer

   Dim strProcess As String
   Dim intRun As Integer

   strProcess = File.Load("/proc" &/ CStr(Application.Id) &/ "comm")

   If Left(strProcess, 4) = "gbx3" Then

     intRun = 1
   Else
     intRun = 0
   Endif

   Return intRun

End

Regards.
Martin.


More information about the User mailing list