Reputation: 31
Suppose I have made a project on PHP-GTK. Now how can I run the PHP-GTK without opening the command prompt?
Like in other software, we have a icon on the desktop, by click on that we can run the program, I want to do the same with my program made in PHP-GTK.
Upvotes: 0
Views: 941
Reputation: 11
this solution workes for me on windows XP SP3
let the phpGtk binary be C:\monitor\bin\php\php
and the phpGtk main script file to be C:\monitor\system\monitor ui\monitor.php
use a bach script (monitor.bat
) file like this:
@echo off
rem Hideself
"C:\monitor\bin\php\php" "C:\monitor\system\monitor ui\monitor.php" %*
rem Hideself
pause
rem
is for comments in commands line,
the %*
part is to pass any arguments provided to the phpGtk script
use this bat to exe converter to convert Bash .bat
file to an executable .exe
rem Hideself
and rem Showself
are advanced commands and
they are just what we need
with this program you can:
- set an icon, - include files - set a password for the executable
Hint: you can phpGtk binarys but you should use
%MyFiles%
to refer to themAdvice: when your project is all done you can trim the
pause
command (it is just to see the errors php cli logged to you)Caution: using multiple icons needs .NET framework
Hint: you can use
Ressource Hacker
to replace the single icon with multiple onesHint: you can use the
WinRAR
'sSFX
feature to handle the installation for you
hope this help somebody's life ! :)
Upvotes: 1
Reputation: 172
if you use Linux, you can create a shell script and put the command with &
to run in the background?
[command] &
If you use Windows, try
start [command]
Upvotes: 0
Reputation: 1462
You can make a .bat file which executes with a double click. If you are under windows, I guess there must be something similar for unix. This is how you do it for windows:
"%CD%\..\..\PhpGtkRuntime\php.exe" "%CD%\test.php"
Of course you will adjust it to your folder depth but the idea is the same.
You can also look this answer which is closely realated and talks about things of immediate interest: Check here
Upvotes: 1