├── .gitignore ├── README.md ├── app.rc ├── icon.ico ├── main.cpp ├── phpbrowserbox.cbp ├── phpbrowserbox.depend ├── phpbrowserbox.exe.Manifest ├── phpbrowserbox.layout ├── vcredist.cpp └── vcredist.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | obj 3 | bin 4 | .vscode -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PHPBrowserBox 2 | 3 | Table of contents: 4 | 5 | - [Introduction](#introduction) 6 | - [Installation](#installation) 7 | - [Downloads](#downloads) 8 | - [Support](#support) 9 | - [Seeking sponsors](#sponsors) 10 | 11 | ## Introduction 12 | 13 | PHPBrowserBox is an open source project founded by Anthony Ogundipe in the year 2013 to provide a way for developing native desktop GUI applications using web technologies such as PHP, HTML5, JavaScript, MySQL, SQLite and Google Chrome. 14 | 15 | \ 16 | ![bbwebkit](https://user-images.githubusercontent.com/948100/230798579-46094938-3ee3-4c5c-8673-98d343455043.png) 17 | 18 | 19 | It is a an excellent software for converting web applications written with HTML/PHP web apps and PHP into desktop applications with little effort. 20 | 21 | In a certain sense phpbrowserbox acts differently from a PHP to EXE compiler. It embeds a web browser, a multi-threaded web server and a PHP interpreter. 22 | All embedded into a single application, a portable folder that you can easily distribute to end users by packing it to zip archive or by making an [installer for your application](../../wiki/Knowledge-Base#application-installer). 23 | 24 | It has been tested with the following php versions : 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 and 8.2 on Windows 7, 8, 10 and Windows 11, 64 bits architecture. 25 | 26 | All popular PHP frameworks are supported, see the [PHP frameworks support](../../wiki/PHP-frameworks-support) wiki page. 27 | 28 | You can create a standalone executable for distribution with the help of the [Inno Setup installer](../../wiki/Knowledge-Base#application-installer). 29 | 30 | PHPBrowserBox is released under non-restrictive license, thus it is [free for commercial use](../../wiki/Knowledge-Base#can-i-use-php-desktop-in-a-commercial-closed-sourced-project). 31 | 32 | Lots of other useful information can be found on the 33 | [Knowledge Base](../../wiki/Knowledge-Base) wiki page and on the 34 | [PHPBrowserBox Website](https://phpbrowserbox.com). 35 | 36 | ## Installation 37 | 38 | ![bbcpanel](https://user-images.githubusercontent.com/948100/230798630-a267ef9e-411a-47ff-a5ea-ef1e14363744.png) 39 | 40 | #### Installation Requirements 41 | 42 | The minimum requirements is Windows 7 x64. 43 | 44 | ## Downloads 45 | 46 | - PHPBrowserBox Binary distribution - [PHPBrowserBox latest release for Windows](https://github.com/dhtml/phpbrowserbox/releases/latest) 47 | 48 | 49 | ## Support 50 | 51 | - Documentation is on the [Wiki Pages](../../wiki). Start with the 52 | [Knowledge Base](../../wiki/Knowledge-Base), and [Tweaks](../../wiki/Tweaks) 53 | wiki pages. 54 | - Ask questions and report problems on the 55 | [PHPBrowserBox Support Page](https://web.facebook.com/phpbrowserbox) 56 | 57 | ## Sponsors 58 | 59 | PHPBrowserBox is seeking companies to sponsor further development of the project. 60 | 61 | If your company would like to sponsor PHPBrowserBox development efforts 62 | then please contact [Anthony](https://www.linkedin.com/in/anthonyogundipe/). 63 | 64 | Long term sponsorships are welcome and Anthony is open to ideas about the project. 65 | He would love to spend more time on developing this project, but he can't afford doing so in his free time. 66 | -------------------------------------------------------------------------------- /app.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhtml/phpbrowserbox/028c45bb54cdaf77f45f0366353e3d51a2a022b9/app.rc -------------------------------------------------------------------------------- /icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhtml/phpbrowserbox/028c45bb54cdaf77f45f0366353e3d51a2a022b9/icon.ico -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #if defined(UNICODE) && !defined(_UNICODE) 2 | #define _UNICODE 3 | #elif defined(_UNICODE) && !defined(UNICODE) 4 | #define UNICODE 5 | #endif 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #ifdef _WIN32 16 | #include 17 | // MSDN recommends against using getcwd & chdir names 18 | #define cwd _getcwd 19 | #define cd _chdir 20 | #else 21 | #include "unistd.h" 22 | #define cwd getcwd 23 | #define cd chdir 24 | #endif 25 | 26 | #include "vcredist.h" 27 | 28 | using namespace std; 29 | 30 | void getEXEPath(char *&exePath, 31 | const char *szFileName) 32 | { 33 | // Get the last position of '/' 34 | std::string aux(szFileName); 35 | 36 | // get '/' or '\\' depending on unix/mac or windows. 37 | #if defined(_WIN32) || defined(WIN32) 38 | int pos = aux.rfind('\\'); 39 | #else 40 | int pos = aux.rfind('/'); 41 | #endif 42 | 43 | // Get the path and the name 44 | std::string path = aux.substr(0, pos + 1); 45 | 46 | char *path_array = new char[path.length() + 1]; 47 | strcpy(path_array, path.c_str()); 48 | 49 | exePath = path_array; 50 | } 51 | 52 | 53 | int WINAPI WinMain(HINSTANCE hThisInstance, 54 | HINSTANCE hPrevInstance, 55 | LPSTR lpszArgument, 56 | int nCmdShow) 57 | { 58 | 59 | // get full EXEpath 60 | TCHAR szFileName[MAX_PATH]; 61 | GetModuleFileName(NULL, szFileName, MAX_PATH); 62 | 63 | /* 64 | get basepath e.g. e:/phpbb/ 65 | */ 66 | char *basePath = NULL; 67 | getEXEPath(basePath, szFileName); 68 | 69 | cd(basePath); 70 | cd("bin\\bbwebkit"); 71 | 72 | STARTUPINFO info = { 73 | sizeof(info)}; 74 | PROCESS_INFORMATION processInfo; 75 | 76 | if (DoesVCRedistNeedUpdate()) 77 | { 78 | TCHAR szVcRedistPath[MAX_PATH]; 79 | sprintf(szVcRedistPath, "%s\\bin\\vc_redist\\VC_redist.x64.exe", basePath); 80 | UpdateVCRedist(szVcRedistPath); 81 | } 82 | 83 | if(!CreateProcess("bbwebkit.exe", NULL, NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo)) { 84 | MessageBoxA(NULL, "Unable to launch application", "Startup Failure", MB_OK | MB_ICONERROR); 85 | } 86 | 87 | return 0; 88 | } 89 | -------------------------------------------------------------------------------- /phpbrowserbox.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 72 | 73 | -------------------------------------------------------------------------------- /phpbrowserbox.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1679165557 source:e:\phpbb\source\phpbrowserbox\main.cpp 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | "resource.h" 11 | 12 | 13 | "funcs.h" 14 | 15 | 16 | 17 | 1679165364 source:e:\phpbb\source\phpbrowserbox\app.rc 18 | 19 | "resource.h" 20 | 21 | 1679165381 e:\phpbb\source\phpbrowserbox\resource.h 22 | 23 | 1679156863 source:e:\phpbb\source\phpbrowserbox\func.cpp 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | "resource.h" 32 | 33 | 34 | "funcs.h" 35 | 36 | "RSJparser.tcc" 37 | 38 | 39 | 1679165519 e:\phpbb\source\phpbrowserbox\funcs.h 40 | 41 | 1627987526 e:\phpbb\source\phpbrowserbox\rsjparser.tcc 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 1679178656 source:e:\php box\repo\phpbrowserboxv6.0\cpp\app.rc 53 | 54 | "resource.h" 55 | 56 | 1679178640 e:\php box\repo\phpbrowserboxv6.0\cpp\resource.h 57 | 58 | 1679178720 source:e:\php box\repo\phpbrowserboxv6.0\cpp\main.cpp 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | "resource.h" 67 | 68 | 69 | "funcs.h" 70 | 71 | 72 | 73 | 1679166108 e:\php box\repo\phpbrowserboxv6.0\cpp\funcs.h 74 | 75 | 1679181269 source:e:\php box\repo\phpbrowserboxv6.0\cpp\func.cpp 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | "resource.h" 84 | 85 | 86 | "funcs.h" 87 | 88 | "RSJparser.tcc" 89 | 90 | 91 | 1627987526 e:\php box\repo\phpbrowserboxv6.0\cpp\rsjparser.tcc 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 1679230710 source:e:\php box\repo\phpbrowserboxv6.0\core\app.rc 103 | 104 | "resource.h" 105 | 106 | 1679230694 e:\php box\repo\phpbrowserboxv6.0\core\resource.h 107 | 108 | 1679238690 source:e:\php box\repo\phpbrowserboxv6.0\core\main.cpp 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | "resource.h" 117 | 118 | 119 | "funcs.h" 120 | 121 | 122 | 123 | 1679166108 e:\php box\repo\phpbrowserboxv6.0\core\funcs.h 124 | 125 | 1679233308 source:e:\php box\repo\phpbrowserboxv6.0\core\func.cpp 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | "resource.h" 134 | 135 | 136 | "funcs.h" 137 | 138 | "RSJparser.tcc" 139 | 140 | 141 | 1627987526 e:\php box\repo\phpbrowserboxv6.0\core\rsjparser.tcc 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 1679434791 source:e:\php box\source\core\app.rc 153 | 154 | "resource.h" 155 | 156 | 1679230694 e:\php box\source\core\resource.h 157 | 158 | 1679751090 source:e:\php box\source\core\func.cpp 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | "resource.h" 167 | 168 | 169 | "funcs.h" 170 | 171 | 172 | 173 | 1679745044 e:\php box\source\core\funcs.h 174 | 175 | 1627987526 e:\php box\source\core\rsjparser.tcc 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 1679750250 source:e:\php box\source\core\main.cpp 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | "resource.h" 197 | 198 | 199 | 200 | 201 | "funcs.h" 202 | 203 | 1680963841 source:e:\phpbrowserbo x\source\phpbrowserbox\app.rc 204 | 205 | 206 | 1679230694 e:\phpbrowserbo x\source\phpbrowserbox\resource.h 207 | 208 | 1679751090 source:e:\phpbrowserbo x\source\phpbrowserbox\func.cpp 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | "resource.h" 217 | 218 | 219 | "funcs.h" 220 | 221 | 222 | 223 | 1680401108 e:\phpbrowserbo x\source\phpbrowserbox\funcs.h 224 | 225 | 1680963841 source:e:\phpbrowserbo x\source\phpbrowserbox6\app.rc 226 | 227 | 228 | 1680963831 source:e:\phpbrowserbo x\source\phpbrowserbox6\main.cpp 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | "unistd.h" 238 | 239 | 1681123189 source:e:\phpbrowserbo x\source\phpbrowserbox\vcredist.cpp 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | "vcredist.h" 252 | 253 | 1681123257 e:\phpbrowserbo x\source\phpbrowserbox\vcredist.h 254 | 255 | 256 | 257 | 258 | 1681123281 source:e:\phpbrowserbo x\source\phpbrowserbox\main.cpp 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | "unistd.h" 268 | "vcredist.h" 269 | 270 | -------------------------------------------------------------------------------- /phpbrowserbox.exe.Manifest: -------------------------------------------------------------------------------- 1 | 2 | 5 | 10 | elevate execution level 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /phpbrowserbox.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /vcredist.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "vcredist.h" 14 | 15 | using namespace std; 16 | 17 | 18 | // registry check 19 | BOOL DoesVCRedistNeedUpdate() 20 | { 21 | BOOL requireUpdate = true; 22 | 23 | CHAR message[MAX_PATH]; 24 | CHAR requiredVal[MAX_PATH] = "14.34.31938"; 25 | CHAR currentVal[MAX_PATH]; 26 | 27 | DWORD dataSize = MAXWORD; 28 | 29 | // Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\X64 30 | // Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Dependencies\Microsoft.VS.VC_RuntimeAdditionalVSU_amd64,v14 31 | // norm - v14.34.31938.00 32 | LONG result = RegGetValueA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Classes\\Installer\\Dependencies\\Microsoft.VS.VC_RuntimeAdditionalVSU_amd64,v14", "Version", RRF_RT_REG_SZ, nullptr, ¤tVal, &dataSize); 33 | if (result != ERROR_SUCCESS) 34 | { 35 | requireUpdate = true; 36 | strcpy(message, "No VCRedist Found"); 37 | } 38 | else 39 | { 40 | // compare version 41 | std::string str_inp1(requiredVal); 42 | std::string str_inp2(currentVal); 43 | 44 | int res = str_inp1.compare(str_inp2); 45 | 46 | if (res == 0) 47 | { 48 | strcpy(message, "Exact match Found"); 49 | requireUpdate = false; 50 | } 51 | else if (res < 0) 52 | { 53 | strcpy(message, "More up to date than required"); 54 | requireUpdate = false; 55 | } 56 | else 57 | { 58 | strcpy(message, "Not up to date at all"); 59 | requireUpdate = true; 60 | } 61 | } 62 | //cout << "VC Redistributable test : " << message << "\n"; 63 | return requireUpdate; 64 | } 65 | 66 | 67 | void UpdateVCRedist(TCHAR path[]) 68 | { 69 | STARTUPINFO info = { 70 | sizeof(info)}; 71 | PROCESS_INFORMATION processInfo; 72 | 73 | // char cmdArgs[] = "VC_redist.x64.exe /Q /norestart"; 74 | char cmdArgs[] = "VC_redist.x64.exe /passive /norestart"; 75 | 76 | //MessageBoxA(NULL, szVcRedistrMessage, szVcRedistrTitle, MB_OK); 77 | 78 | if (CreateProcess(path, cmdArgs, NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo)) 79 | { 80 | WaitForSingleObject(processInfo.hProcess, INFINITE); 81 | CloseHandle(processInfo.hProcess); 82 | CloseHandle(processInfo.hThread); 83 | 84 | //MessageBoxA(NULL, path, "Update Complete", MB_OK | MB_ICONERROR); 85 | } 86 | else 87 | { 88 | // MessageBoxA(NULL, path, "Update Failed", MB_OK | MB_ICONERROR); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /vcredist.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | BOOL DoesVCRedistNeedUpdate(); 8 | void UpdateVCRedist(TCHAR path[]); 9 | --------------------------------------------------------------------------------