diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index bdb0cab..0000000 --- a/.gitattributes +++ /dev/null @@ -1,17 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index cd2946a..1071ddb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,47 +1,4 @@ -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# ========================= -# Operating System Files -# ========================= - -# OSX -# ========================= - -.DS_Store -.AppleDouble -.LSOverride - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk +*.log +obj +bin +.vscode \ No newline at end of file diff --git a/Makefile.win b/Makefile.win deleted file mode 100644 index 51d4461..0000000 --- a/Makefile.win +++ /dev/null @@ -1,33 +0,0 @@ -# Project: phpbrowserbox -# Makefile created by Dev-C++ 5.11 - -CPP = g++.exe -CC = gcc.exe -WINDRES = windres.exe -RES = phpbox_private.res -OBJ = main.o $(RES) -LINKOBJ = main.o $(RES) -LIBS = -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib32" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32" -static-libgcc -mwindows -m32 -INCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -CXXINCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++" -BIN = phpbrowserbox.exe -CXXFLAGS = $(CXXINCS) -m32 -CFLAGS = $(INCS) -m32 -RM = rm.exe -f - -.PHONY: all all-before all-after clean clean-custom - -all: all-before $(BIN) all-after - -clean: clean-custom - ${RM} $(OBJ) $(BIN) - -$(BIN): $(OBJ) - $(CPP) $(LINKOBJ) -o $(BIN) $(LIBS) - -main.o: main.cpp - $(CPP) -c main.cpp -o main.o $(CXXFLAGS) - -phpbox_private.res: phpbox_private.rc - $(WINDRES) -i phpbox_private.rc -F pe-i386 --input-format=rc -o phpbox_private.res -O coff - diff --git a/README.md b/README.md index 93a2bd4..bca6729 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,65 @@ -# Webkit +# PHPBrowserBox -This package is deprecated, please check this link for the [most recent version](https://sourceforge.net/projects/phpbrowserbox/). +Table of contents: -## What am I looking at? +- [Introduction](#introduction) +- [Installation](#installation) +- [Downloads](#downloads) +- [Support](#support) +- [Seeking sponsors](#sponsors) -You are looking at the main binary of phpbrowserbox i.e phpbrowserbox.exe that powers [phpbrowserbox](http://www.africoders.com/forum/phpbrowserbox). You can download the [full app here](https://sourceforge.net/p/phpbrowserbox/). +## Introduction -## Features - * It grabs the port number to use for the localpath of the browser from support/port.ini - * It starts mysql binaries to allow mysql support (by default, but this feature might be removed with no advertse effect) - * It initiates the internal php server - * It finally launches the webkit browser component found in support/webkit/webkit.exe - -If you are interested in modifying the webkit component, you should be looking at https://github.com/dhtml/webkit +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. +\ +![bbwebkit](https://user-images.githubusercontent.com/948100/230798579-46094938-3ee3-4c5c-8673-98d343455043.png) -## Installation and Usage -One of the main goals of phpbrowserbox is that the components should be flexible and easily replaceable. -This major aspect of the phpbrowserbox was written in dev c++ 5.11. If you are able to improve this aspect of the app, please share with the community +It is a an excellent software for converting web applications written with HTML/PHP web apps and PHP into desktop applications with little effort. -[Download the archive](https://github.com/dhtml/phpbrowserbox/archive/master.zip) and simply modify it, then repackage it as phpbrowserbox.exe. +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. +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). -And that should be all. +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. -### Support -Visit the [project page](http://www.africoders.com/forum/phpbrowserbox) for documentation, configuration, and more advanced usage examples. +All popular PHP frameworks are supported, see the [PHP frameworks support](../../wiki/PHP-frameworks-support) wiki page. +You can create a standalone executable for distribution with the help of the [Inno Setup installer](../../wiki/Knowledge-Base#application-installer). -### Author +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). -**Anthony Ogundipe** a.k.a dhtml +Lots of other useful information can be found on the +[Knowledge Base](../../wiki/Knowledge-Base) wiki page and on the +[PHPBrowserBox Website](https://phpbrowserbox.com). +## Installation -### License +![bbcpanel](https://user-images.githubusercontent.com/948100/230798630-a267ef9e-411a-47ff-a5ea-ef1e14363744.png) -Licensed under the MIT License - +#### Installation Requirements + +The minimum requirements is Windows 7 x64. + +## Downloads + +- PHPBrowserBox Binary distribution - [PHPBrowserBox latest release for Windows](https://github.com/dhtml/phpbrowserbox/releases/latest) + + +## Support + +- Documentation is on the [Wiki Pages](../../wiki). Start with the + [Knowledge Base](../../wiki/Knowledge-Base), and [Tweaks](../../wiki/Tweaks) + wiki pages. +- Ask questions and report problems on the + [PHPBrowserBox Support Page](https://web.facebook.com/phpbrowserbox) + +## Sponsors + +PHPBrowserBox is seeking companies to sponsor further development of the project. + +If your company would like to sponsor PHPBrowserBox development efforts +then please contact [Anthony](https://www.linkedin.com/in/anthonyogundipe/). + +Long term sponsorships are welcome and Anthony is open to ideas about the project. +He would love to spend more time on developing this project, but he can't afford doing so in his free time. diff --git a/README.txt b/README.txt deleted file mode 100644 index 2205ab2..0000000 --- a/README.txt +++ /dev/null @@ -1,22 +0,0 @@ -Developer: Ogundipe Anthony -Site: www.africoders.com -Phone: +234(0)7030290746 -E-mail: diltony@yahoo.com, support@africoders.com -Facebook: www.facebook.com/dhtml5 -Discussion Link: http://www.africoders.com/forum/phpbrowserbox - -This is a standalone windows browser that allows you to package your entire web application. -It supports HTML5, CSS 3, Javascript, and also provides an internal PHP/MySQL server. - -If you do not require MySQL support, you can look at https://sourceforge.net/p/phpbrowserbox2/ - -How it works: -It does not need an installation, you just run it directly from a pc, you can even run from your flashdrive. -And it does not conflict with regular servers like wamp or other apache server. - -Once the browser loads, it starts its internal php server and displays the default index.php almost immediately. - -Developers Info: -- The browser links to its internal homepage with a link like http://localhost:90/index.php. -- The MySQL port number here is 3308 by default, database username is root and no password. -- The index.php for is located inside the \support\inetpub - this is where to start your application development. \ No newline at end of file diff --git a/app.rc b/app.rc new file mode 100644 index 0000000..3ed160e --- /dev/null +++ b/app.rc @@ -0,0 +1,59 @@ + +////////////////////////////////////////////////////////////////////////////// +// +// Archivo Manifest genérico para Windows XP/Vista +// + +#if !defined(wxUSE_NO_MANIFEST) || (wxUSE_NO_MANIFEST == 0) +#if !defined(WX_MSC_FULL_VER) || WX_MSC_FULL_VER < 140040130 + +// ver la página sobre "isolated applications" en MSDN +# +#ifdef ISOLATION_AWARE_ENABLED +#define APP_MANIFEST 2 +#else +#define APP_MANIFEST 1 +#endif + +#define RT_MANIFEST 24 + +APP_MANIFEST RT_MANIFEST phpbrowserbox.exe.Manifest + +#endif // !defined(WX_MSC_FULL_VER) || WX_MSC_FULL_VER < 140040130 +#endif // !defined(wxUSE_NO_MANIFEST) || (wxUSE_NO_MANIFEST == 0) + +#include // include for version info constants + + +A ICON "icon.ico" + + +// +// TO CHANGE VERSION INFORMATION, EDIT PROJECT OPTIONS... +// +1 VERSIONINFO +FILEVERSION 6,0,0,0 +PRODUCTVERSION 6,0 +FILETYPE VFT_APP +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4" + { + VALUE "FileDescription", "PHPBrowserBox" + VALUE "Type", "Application" + VALUE "FileVersion", "6.0.0.0" + VALUE "ProductName", "PHPBrowserBox" + VALUE "WebsiteName", "phpbrowserbox.com" + VALUE "ProductVersion", "6.0" + VALUE "LegalCopyright", "Copyright 2023 Africoders Network" + VALUE "LegalTrademarks", "Copyright 2023 Africoders Network" + VALUE "InternalName", "PHPBrowserBox" + VALUE "OriginalFilename", "phpbrowserbox.exe" + } + } + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409, 1252 + } +} diff --git a/icon.ico b/icon.ico new file mode 100644 index 0000000..509ff1f Binary files /dev/null and b/icon.ico differ diff --git a/main.cpp b/main.cpp index 23b95d4..dec1676 100644 --- a/main.cpp +++ b/main.cpp @@ -1,105 +1,88 @@ -#include -#include -#include -#include -#include -#include +#if defined(UNICODE) && !defined(_UNICODE) +#define _UNICODE +#elif defined(_UNICODE) && !defined(UNICODE) +#define UNICODE +#endif -FILE *fr; /* declare the file pointer */ - -void Stealth() +#include +#include +#include +#include +#include +#include +#include + +#ifdef _WIN32 +#include +// MSDN recommends against using getcwd & chdir names +#define cwd _getcwd +#define cd _chdir +#else +#include "unistd.h" +#define cwd getcwd +#define cd chdir +#endif + +#include "vcredist.h" + +using namespace std; + +void getEXEPath(char *&exePath, + const char *szFileName) { - HWND Stealth; - AllocConsole(); - Stealth = FindWindowA("ConsoleWindowClass", NULL); - ShowWindow(Stealth,0); -} - -int main(int argc, char** argv) { - //std::cout << "Hello world!\n"; - - STARTUPINFO StartupInfo; - PROCESS_INFORMATION ProcessInfo; - - memset(&StartupInfo, 0, sizeof(StartupInfo)); - StartupInfo.cb = sizeof(STARTUPINFO); - StartupInfo.dwFlags = STARTF_USESHOWWINDOW; - StartupInfo.wShowWindow = SW_HIDE; + // Get the last position of '/' + std::string aux(szFileName); - //to hide console window - //Stealth(); +// get '/' or '\\' depending on unix/mac or windows. +#if defined(_WIN32) || defined(WIN32) + int pos = aux.rfind('\\'); +#else + int pos = aux.rfind('/'); +#endif - //system("title PHPBrowserBox"); - STARTUPINFO si = {}; - si.cb = sizeof si; + // Get the path and the name + std::string path = aux.substr(0, pos + 1); - PROCESS_INFORMATION pi = {}; - PROCESS_INFORMATION pi1 = {}; - PROCESS_INFORMATION pi2 = {}; + char *path_array = new char[path.length() + 1]; + strcpy(path_array, path.c_str()); + exePath = path_array; +} - char the_path[256]; - char port[80]; - char cmd[250]; - char params[250]; - char cfile[250]; - - char wcmd[250]; - char wparams[250]; - - //grab app path - getcwd(the_path, 255); - - //get server port - sprintf(cfile, "%s\\support\\port.ini",the_path); - fr = fopen (cfile, "rt"); /* open the file for reading */ - fgets(port, 80, fr); - fclose(fr); /* close the file prior to exiting the routine */ - - - //start mysqld at this point - sprintf(cmd, "%s\\support\\mysql\\bin\\mysqld.exe",the_path); - if ( !CreateProcess(cmd, 0, 0, FALSE, 0, 0, 0, 0, &StartupInfo,&pi1) ) - { - printf("MySQL failed to start %s \n",cmd); - } else { - printf("MySQL launched\n"); - } - - - //switch to the correct directory - chdir("support\\inetpub"); - - //initiate php server - sprintf(cmd, "%s\\support\\php\\php.exe",the_path); - sprintf(params, "php.exe -S localhost:%s ..\\php\\router.php -c php.ini",port); - if ( !CreateProcess(cmd,params, 0, FALSE, 0, 0, 0, 0, &StartupInfo,&pi2)) - { - printf("PHP failed to start \n"); - } else { - printf("PHP launched on port %s\n",port); - } +int WINAPI WinMain(HINSTANCE hThisInstance, + HINSTANCE hPrevInstance, + LPSTR lpszArgument, + int nCmdShow) +{ - sprintf(wcmd, "%s\\support\\webkit\\webkit.exe",the_path); - sprintf(wparams, "webkit.exe http://localhost:%s",port); + // get full EXEpath + TCHAR szFileName[MAX_PATH]; + GetModuleFileName(NULL, szFileName, MAX_PATH); - if(CreateProcess(wcmd, wparams, 0, FALSE, 0, 0, 0, 0, &si,&pi)) { - printf("Launching webkit engine here \n"); + /* + get basepath e.g. e:/phpbb/ + */ + char *basePath = NULL; + getEXEPath(basePath, szFileName); - //wait for target to shutdown at this point - WaitForSingleObject(pi.hProcess, INFINITE); - } else { - printf("Path %s",wcmd); - printf("Unable to launch webkit engine here \n"); - } + cd(basePath); + cd("bin\\bbwebkit"); + STARTUPINFO info = { + sizeof(info)}; + PROCESS_INFORMATION processInfo; - //close mysql and php handle - TerminateProcess(pi1.hProcess,0); - TerminateProcess(pi2.hProcess,0); + if (DoesVCRedistNeedUpdate()) + { + TCHAR szVcRedistPath[MAX_PATH]; + sprintf(szVcRedistPath, "%s\\bin\\vc_redist\\VC_redist.x64.exe", basePath); + UpdateVCRedist(szVcRedistPath); + } - //system("pause"); + if(!CreateProcess("bbwebkit.exe", NULL, NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo)) { + MessageBoxA(NULL, "Unable to launch application", "Startup Failure", MB_OK | MB_ICONERROR); + } - return 0; + return 0; } diff --git a/main.o b/main.o deleted file mode 100644 index f8c1c93..0000000 Binary files a/main.o and /dev/null differ diff --git a/phpbox.layout b/phpbox.layout deleted file mode 100644 index c9d66ee..0000000 --- a/phpbox.layout +++ /dev/null @@ -1,8 +0,0 @@ -[Editors] -Order=0 -Focused=0 -[Editor_0] -CursorCol=1 -CursorRow=18 -TopLine=1 -LeftChar=1 diff --git a/phpbox_private.h b/phpbox_private.h deleted file mode 100644 index 22bce0b..0000000 --- a/phpbox_private.h +++ /dev/null @@ -1,23 +0,0 @@ -/* THIS FILE WILL BE OVERWRITTEN BY DEV-C++ */ -/* DO NOT EDIT ! */ - -#ifndef PHPBOX_PRIVATE_H -#define PHPBOX_PRIVATE_H - -/* VERSION DEFINITIONS */ -#define VER_STRING "1.0.0.0" -#define VER_MAJOR 1 -#define VER_MINOR 0 -#define VER_RELEASE 0 -#define VER_BUILD 0 -#define COMPANY_NAME "africoders" -#define FILE_VERSION "1.0.0.0" -#define FILE_DESCRIPTION "Developed using the Dev-C++ IDE" -#define INTERNAL_NAME "" -#define LEGAL_COPYRIGHT "" -#define LEGAL_TRADEMARKS "" -#define ORIGINAL_FILENAME "" -#define PRODUCT_NAME "" -#define PRODUCT_VERSION "1.0.0.0" - -#endif /*PHPBOX_PRIVATE_H*/ diff --git a/phpbox_private.rc b/phpbox_private.rc deleted file mode 100644 index 1dafbb7..0000000 --- a/phpbox_private.rc +++ /dev/null @@ -1,36 +0,0 @@ -/* THIS FILE WILL BE OVERWRITTEN BY DEV-C++ */ -/* DO NOT EDIT! */ - -#include // include for version info constants - - -A ICON "phpbrowserbox.ico" - -// -// TO CHANGE VERSION INFORMATION, EDIT PROJECT OPTIONS... -// -1 VERSIONINFO -FILEVERSION 1,0,0,0 -PRODUCTVERSION 1,0,0,0 -FILETYPE VFT_APP -{ - BLOCK "StringFileInfo" - { - BLOCK "040904E4" - { - VALUE "CompanyName", "africoders" - VALUE "FileVersion", "1.0.0.0" - VALUE "FileDescription", "Developed using the Dev-C++ IDE" - VALUE "InternalName", "" - VALUE "LegalCopyright", "" - VALUE "LegalTrademarks", "" - VALUE "OriginalFilename", "" - VALUE "ProductName", "" - VALUE "ProductVersion", "1.0.0.0" - } - } - BLOCK "VarFileInfo" - { - VALUE "Translation", 0x0409, 1252 - } -} diff --git a/phpbox_private.res b/phpbox_private.res deleted file mode 100644 index 2801c37..0000000 Binary files a/phpbox_private.res and /dev/null differ diff --git a/phpbrowserbox.cbp b/phpbrowserbox.cbp new file mode 100644 index 0000000..aa932dc --- /dev/null +++ b/phpbrowserbox.cbp @@ -0,0 +1,72 @@ + + + + + + diff --git a/phpbrowserbox.depend b/phpbrowserbox.depend new file mode 100644 index 0000000..87e5b09 --- /dev/null +++ b/phpbrowserbox.depend @@ -0,0 +1,269 @@ +# depslib dependency file v1.0 +1679165557 source:e:\phpbb\source\phpbrowserbox\main.cpp + + + + + + + + "resource.h" + + + "funcs.h" + + + +1679165364 source:e:\phpbb\source\phpbrowserbox\app.rc + + "resource.h" + +1679165381 e:\phpbb\source\phpbrowserbox\resource.h + +1679156863 source:e:\phpbb\source\phpbrowserbox\func.cpp + + + + + + + + "resource.h" + + + "funcs.h" + + "RSJparser.tcc" + + +1679165519 e:\phpbb\source\phpbrowserbox\funcs.h + +1627987526 e:\phpbb\source\phpbrowserbox\rsjparser.tcc + + + + + + + + + + +1679178656 source:e:\php box\repo\phpbrowserboxv6.0\cpp\app.rc + + "resource.h" + +1679178640 e:\php box\repo\phpbrowserboxv6.0\cpp\resource.h + +1679178720 source:e:\php box\repo\phpbrowserboxv6.0\cpp\main.cpp + + + + + + + + "resource.h" + + + "funcs.h" + + + +1679166108 e:\php box\repo\phpbrowserboxv6.0\cpp\funcs.h + +1679181269 source:e:\php box\repo\phpbrowserboxv6.0\cpp\func.cpp + + + + + + + + "resource.h" + + + "funcs.h" + + "RSJparser.tcc" + + +1627987526 e:\php box\repo\phpbrowserboxv6.0\cpp\rsjparser.tcc + + + + + + + + + + +1679230710 source:e:\php box\repo\phpbrowserboxv6.0\core\app.rc + + "resource.h" + +1679230694 e:\php box\repo\phpbrowserboxv6.0\core\resource.h + +1679238690 source:e:\php box\repo\phpbrowserboxv6.0\core\main.cpp + + + + + + + + "resource.h" + + + "funcs.h" + + + +1679166108 e:\php box\repo\phpbrowserboxv6.0\core\funcs.h + +1679233308 source:e:\php box\repo\phpbrowserboxv6.0\core\func.cpp + + + + + + + + "resource.h" + + + "funcs.h" + + "RSJparser.tcc" + + +1627987526 e:\php box\repo\phpbrowserboxv6.0\core\rsjparser.tcc + + + + + + + + + + +1679434791 source:e:\php box\source\core\app.rc + + "resource.h" + +1679230694 e:\php box\source\core\resource.h + +1679751090 source:e:\php box\source\core\func.cpp + + + + + + + + "resource.h" + + + "funcs.h" + + + +1679745044 e:\php box\source\core\funcs.h + +1627987526 e:\php box\source\core\rsjparser.tcc + + + + + + + + + + +1679750250 source:e:\php box\source\core\main.cpp + + + + + + + + + + "resource.h" + + + + + "funcs.h" + +1680963841 source:e:\phpbrowserbo x\source\phpbrowserbox\app.rc + + +1679230694 e:\phpbrowserbo x\source\phpbrowserbox\resource.h + +1679751090 source:e:\phpbrowserbo x\source\phpbrowserbox\func.cpp + + + + + + + + "resource.h" + + + "funcs.h" + + + +1680401108 e:\phpbrowserbo x\source\phpbrowserbox\funcs.h + +1680963841 source:e:\phpbrowserbo x\source\phpbrowserbox6\app.rc + + +1680963831 source:e:\phpbrowserbo x\source\phpbrowserbox6\main.cpp + + + + + + + + + "unistd.h" + +1681123189 source:e:\phpbrowserbo x\source\phpbrowserbox\vcredist.cpp + + + + + + + + + + + + "vcredist.h" + +1681123257 e:\phpbrowserbo x\source\phpbrowserbox\vcredist.h + + + + +1681123281 source:e:\phpbrowserbo x\source\phpbrowserbox\main.cpp + + + + + + + + + "unistd.h" + "vcredist.h" + diff --git a/phpbrowserbox.dev b/phpbrowserbox.dev deleted file mode 100644 index 60370e0..0000000 --- a/phpbrowserbox.dev +++ /dev/null @@ -1,62 +0,0 @@ -[Project] -FileName=phpbrowserbox.dev -Name=phpbrowserbox -Type=0 -Ver=2 -ObjFiles= -Includes= -Libs= -PrivateResource=phpbox_private.rc -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker= -IsCpp=1 -Icon=phpbrowserbox.ico -ExeOutput= -ObjectOutput= -LogOutput= -LogOutputEnabled=0 -OverrideOutput=0 -OverrideOutputName=phpbrowserbox.exe -HostApplication= -UseCustomMakefile=0 -CustomMakefile= -CommandLine= -Folders= -IncludeVersionInfo=1 -SupportXPThemes=0 -CompilerSet=3 -CompilerSettings=0000000100000000000000000 -UnitCount=1 - -[VersionInfo] -Major=1 -Minor=0 -Release=0 -Build=0 -LanguageID=1033 -CharsetID=1252 -CompanyName=africoders -FileVersion=1.0.0.0 -FileDescription=Developed using the Dev-C++ IDE -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -AutoIncBuildNr=0 -SyncProduct=1 - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - diff --git a/phpbrowserbox.exe.Manifest b/phpbrowserbox.exe.Manifest new file mode 100644 index 0000000..295b9a7 --- /dev/null +++ b/phpbrowserbox.exe.Manifest @@ -0,0 +1,18 @@ + + + +elevate execution level + + + + + + + + diff --git a/phpbrowserbox.ico b/phpbrowserbox.ico deleted file mode 100644 index bfe873e..0000000 Binary files a/phpbrowserbox.ico and /dev/null differ diff --git a/phpbrowserbox.layout b/phpbrowserbox.layout index 856331c..b8dfd65 100644 --- a/phpbrowserbox.layout +++ b/phpbrowserbox.layout @@ -1,8 +1,20 @@ -[Editors] -Order=0 -Focused=0 -[Editor_0] -CursorCol=28 -CursorRow=93 -TopLine=80 -LeftChar=1 + + + + + + + + + + + + + + + + + + + + diff --git a/vcredist.cpp b/vcredist.cpp new file mode 100644 index 0000000..a7ec7fd --- /dev/null +++ b/vcredist.cpp @@ -0,0 +1,90 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "vcredist.h" + +using namespace std; + + +// registry check +BOOL DoesVCRedistNeedUpdate() +{ + BOOL requireUpdate = true; + + CHAR message[MAX_PATH]; + CHAR requiredVal[MAX_PATH] = "14.34.31938"; + CHAR currentVal[MAX_PATH]; + + DWORD dataSize = MAXWORD; + + // Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\X64 + // Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Dependencies\Microsoft.VS.VC_RuntimeAdditionalVSU_amd64,v14 + // norm - v14.34.31938.00 + LONG result = RegGetValueA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Classes\\Installer\\Dependencies\\Microsoft.VS.VC_RuntimeAdditionalVSU_amd64,v14", "Version", RRF_RT_REG_SZ, nullptr, ¤tVal, &dataSize); + if (result != ERROR_SUCCESS) + { + requireUpdate = true; + strcpy(message, "No VCRedist Found"); + } + else + { + // compare version + std::string str_inp1(requiredVal); + std::string str_inp2(currentVal); + + int res = str_inp1.compare(str_inp2); + + if (res == 0) + { + strcpy(message, "Exact match Found"); + requireUpdate = false; + } + else if (res < 0) + { + strcpy(message, "More up to date than required"); + requireUpdate = false; + } + else + { + strcpy(message, "Not up to date at all"); + requireUpdate = true; + } + } + //cout << "VC Redistributable test : " << message << "\n"; + return requireUpdate; +} + + +void UpdateVCRedist(TCHAR path[]) +{ + STARTUPINFO info = { + sizeof(info)}; + PROCESS_INFORMATION processInfo; + + // char cmdArgs[] = "VC_redist.x64.exe /Q /norestart"; + char cmdArgs[] = "VC_redist.x64.exe /passive /norestart"; + + //MessageBoxA(NULL, szVcRedistrMessage, szVcRedistrTitle, MB_OK); + + if (CreateProcess(path, cmdArgs, NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo)) + { + WaitForSingleObject(processInfo.hProcess, INFINITE); + CloseHandle(processInfo.hProcess); + CloseHandle(processInfo.hThread); + + //MessageBoxA(NULL, path, "Update Complete", MB_OK | MB_ICONERROR); + } + else + { + // MessageBoxA(NULL, path, "Update Failed", MB_OK | MB_ICONERROR); + } +} diff --git a/vcredist.h b/vcredist.h new file mode 100644 index 0000000..8e3c1af --- /dev/null +++ b/vcredist.h @@ -0,0 +1,8 @@ +#include +#include +#include + +using namespace std; + +BOOL DoesVCRedistNeedUpdate(); +void UpdateVCRedist(TCHAR path[]);