-
Notifications
You must be signed in to change notification settings - Fork 0
How to use it step by step
- On the server where the Apache Werb Server is avaiable create directory i.e.
exeoutput_updater
in the www files location (/var/www/html
) - copy
server/pmo.php
to theexeoutput_updater/
- copy
server/htaccess
to theexeoutput_updater/.htaccess
- check the ownership for the files and dir. (i.e.
chown www-data:www-data . .. .htaccess pmo.php
) - check if it's working - type in Web Browser something like:
http://<server>/<dir>/exeoutput_updater/php.php
- You can ban/allow users by updating pmo.php: check_user() function
function check_user() {
//if ($_POST && in_array($_POST['d'],array("HOME","WORK"))) return false; // You can limit the access to You application here
return false; // update allowed
return true; //no update allowed
}
You can use some $_POST variabes i.e.
- $_POST['o'] - operation u-pdate, v-erify
- $_POST['u'] - PC user login name
- $_POST['d'] - domain/workgroup
- $_POST['v'] - exe app version
- $_POST['c'] - cpu id
- $_POST['t'] - actual update file (ts)
which also be saved in the pmo. log file (accesible via i.e. pmo.php?s=1)
In case it return true
on the system all update files will be deleted and application will be close, so You can do some access control here !!!
please be aware of CORS https://enable-cors.org/server.html
- Create directory for the
project
- copy files from
exeoutput/
to thisproject
directory - edit
enc_data.php
:266 for changing the encryption password$pass_buduj_plik="my_new_pass";
<-- enter new password here. Server has no knowledge of unencrypted version of Your software. - edit
enc_data.php
:449 for server url location$url = 'https://<server>/exeoutput_updater/pmo.php?upp';
- edit
enc_data.php
:2 You can change the time zone `$defaultTimeZone='Europe/Warsaw' - edit
enc_data.php
:267/268 Setting the local PC directory$up_dir='C:\Users\<username>\AppData\Local\ExeOutput\UserApplication\{APP GUID}'."\\";
{APP GUID} - ExeOutput --> Application Output --> Output Settings --> Application GUID
i.e.
$up_dir='C:\Users\<username>\AppData\Local\ExeOutput\UserApplication\{3AE5192C-F8CC-477F-B0E0-73D6D84D5BF2}'."\\"; // for windows cmd
$up_dir="/mnt/c/Users/<username>/AppData/Local/ExeOutput/UserApplication/{3AE5192C-F8CC-477F-B0E0-73D6D84D5BF2}/"; // for windoes subsystem for Linux (WSL)
update file will be stored as dane5.txt
in that directory
- edit
enc_data.php
:282 function buduj_plik() (sorry for my Polish --> in English build_a_file)
add here all Your files which You would like to update. For the demo below are requested files
$ar=array(
# mandatory files for demo with toast
"jquery.toast.css",
"jquery.toast.js",
"update.php",
"main.php",
"exe_update.js"
);
Please remember that script now canNOT create directories.
So if You need to use subdirs minumum of file in each directories You want to use should be added into ExeOutput test.exop to create the virtual files system with such directory. If such subdir exists You can overwrite or add new files in such subdir, if not - files will not be created, so update will not work.
- edit
enc_data.php
:313$w=array('files'=>$w,'ts'=>$t,'main'=>"main.php");
// put HERE the YOUR INITIAL PAGE 'main' => my main page is in 'main.php - open console (i.e. WIN-key then
cmd
+ENTER) - go to the proper
project
directory (cd <dirs>/project
) - execute
php.exe enc_data.php build_file1
(in case php.exe is not in path use proper i.e."c:\Program Files\PHP\php.exe"
instead ofphp.exe
- in Your directory should
dane.2.txt
appears. - now You have Your initial version. Files from this file will override the ones inside ExeOutput
test.exe
!!
-
Open ExeOutput and create NEW Project i.e
test.exop
in theproject
directory -
set exe_start.php as the
index page
-
add the following files (as the requested minimum) to the
test.exop
:- dane.2.txt
- enc_data.php
- exe_start.php
-
Add menu
- To add Menu in ExeOutput
- Delete updates:
exe_start.php?noupdate=2
- Check for Updates:
jr_check_update('https://www.jr.pl/projects/exeoutput_updater/pmo.php')
- Start without updates (sometimes fails):
exe_start.php?noupdate=1
- To Reload (F5) use normal ExeOutput menu
Navigate
thenHome
ormain.php
(in my example)
- Build the Project
- Check if it's working
- the application should initially starting with the minimum version
- look and find the update
- download update and restart
- now should be the final version
- Enjoy the application
-
Disable Chrome console in the production version Application Settings --> Components --> Rendering Enginde --> Developer Tools OFF
otherwise the updated javascript code could be hacked and visible in the console and people have the easy access to some console hacking --> i.e. executing php scripts making AJAX query and so on.
-
You can also think about OFF PHP debugging using the following settings:
- Php Settings->Debugging-->Store requests and errors to log files --> I put it OFF in my production
- Php Settings->Debugging-->Enable PHP error logging --> I personally kept it ON to have ability to track claims/bugs
- Php Settings->Debugging-->Display PHP error messaging at runtime--> I personally kept it ON to have ability to track claims/bugs
- open console (i.e. WIN-key then
cmd
+ENTER) - go to the proper
project
directory (cd <dirs>/project
) - execute
php.exe enc_data.php build_file
(in case php.exe is not in path use proper i.e."c:\Program Files\PHP\php.exe"
instead ofphp.exe
) - see it data.5.txt exists and "is newly" created
- execute
php.exe enc_data.php update_server
- in case You are in the network 10.x.x.x use build_file1 instead build_file or comment line 467 (see below for proxy)
- open console (i.e. WIN-key then
cmd
+ENTER) - go to the proper
project
directory (cd <dirs>/project
) - execute
php.exe enc_data.php do_all
(in case php.exe is not in path use proper i.e."c:\Program Files\PHP\php.exe"
instead ofphp.exe
)
-
use
php.exe enc_data.php help
for showing help -
in case of using proxy please update
enc_data.php
proxy settings change line 467 according to Your proxy settingsif ($possible_proxy && preg_match('/^10\\./',$ip)) $options['http']['proxy']='proxy.default.in.case.pc.is.in.net10.x.x.x:8080';
WARNING !!!. The app checking by default if PC is in the network 10.x.x.x --> if Yes add the proxy settings - put Yours
-
You can force not to use proxy using
php.exe enc_data.php build_file1
insteadphp.exe enc_data.php build_file
(not working withphp.exe enc_data.php do_all
by default) -
Some tips are added in Issue 2
-
See also main Wiki
-
And the best - server has no knowledge of unencrypted version of Your software. You crypt it on Your PC, upload encryted to the server. User download it and it's unencrypt in the virtual ExeOutput space for the execution time only.
I hope it will help to use.
In case of any problems please ask the Your Customer to:
- delete update file (menu see in demo)
- and restart the app....
- [sometimes also do update and restart again :-)] --> In my app is the worst scenario to recover i.e. in case of buggy update