From 78deb9c37d6e6fc57d17170bf13bfcb55cccaaab Mon Sep 17 00:00:00 2001 From: Asd22 Entertainment <158327205+neoapps-dev@users.noreply.github.com> Date: Sun, 2 Jun 2024 23:44:44 +0300 Subject: [PATCH 1/4] Create windows-compiler.bat --- windows-compiler.bat | 68 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 windows-compiler.bat diff --git a/windows-compiler.bat b/windows-compiler.bat new file mode 100644 index 00000000..0fdb1203 --- /dev/null +++ b/windows-compiler.bat @@ -0,0 +1,68 @@ +@echo off +if "%1" == "next" goto :next + +:------------------------------------- +IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" ( +>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system" +) ELSE ( +>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" +) + +if '%errorlevel%' NEQ '0' ( + echo Requesting administrative privileges... + goto UACPrompt +) else ( goto gotAdmin ) + +:UACPrompt + echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" + set params= %* + echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs" + + "%temp%\getadmin.vbs" + del "%temp%\getadmin.vbs" + exit /B + +:gotAdmin + pushd "%CD%" + CD /D "%~dp0" +:-------------------------------------- + +@echo off +title Bussin Napture Windows Compiler - By NEOAPPS +rustc --version +IF %ERRORLEVEL% NEQ 0 ( + echo Rust is not installed. Please install Rust before proceeding. >error.txt + SET pc=i686 + if "%ProgramFiles(x86)%" == "C:\Program Files (x86)" set pc=x86_64 + echo Downloading Rust Installer for your PC... + powershell -Command "Invoke-WebRequest -Uri https://static.rust-lang.org/rustup/dist/%pc%-pc-windows-msvc/rustup-init.exe -OutFile rustup-init.exe" + echo Downloaded rustup-init.exe. Complete installation then open the compiler again. >>error.txt + rustup-init + setx PATH "%PATH%;%USERPROFILE%\.cargo\bin" /m + exit /b +) +rustup toolchain install stable-gnu +rustup default stable-gnu +SET MSYS2_URL=https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-base-x86_64-latest.sfx.exe +SET MSYS2_EXE=msys2-installer.exe +if not exist %MSYS2_EXE% powershell -Command "Invoke-WebRequest -Uri %MSYS2_URL% -OutFile %MSYS2_EXE%" +if not exist C:\msys64 %MSYS2_EXE% -y -oC:\ +start C:\msys64\msys2_shell.cmd -defterm -here -no-start -mingw32 -c "pacman -Syu --noconfirm && pacman -S --noconfirm mingw-w64-x86_64-toolchain base-devel mingw-w64-x86_64-gtk4 mingw-w64-x86_64-gettext mingw-w64-x86_64-libxml2 mingw-w64-x86_64-librsvg mingw-w64-x86_64-pkgconf mingw-w64-x86_64-gcc mingw-w64-x86_64-libadwaita mingw-w64-x86_64-lua && exit" +pacman -S mingw-w64-x86_64-gtk4 mingw-w64-x86_64-gettext mingw-w64-x86_64-libxml2 mingw-w64-x86_64-librsvg mingw-w64-x86_64-pkgconf mingw-w64-x86_64-gcc +setx PATH "C:\msys64\usr\bin;%PATH%" /m +setx GSK_RENDERER cairo /m +REM if not exist pkg-config_0.26-1_win32.zip powershell -Command "Invoke-WebRequest -Uri http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip -OutFile pkg-config_0.26-1_win32.zip" +REM powershell -Command "Expand-Archive -Path pkg-config_0.26-1_win32.zip" +REM move pkg-config_0.26-1_win32\bin C:\msys64\mingw64 +pacman -S mingw-w64-x86_64-gdk-pixbuf2 +setx PKG_CONFIG_PATH "C:\msys64\mingw64\lib\pkgconfig" /m + + +:next +echo Move your 'webx-master' folder here and then +pause +cd webx-master +cd napture +cargo run +echo Job Done. +pause From 6e71f85b8d0579b6709e95729101f2106f9736ed Mon Sep 17 00:00:00 2001 From: Asd22 Entertainment <158327205+neoapps-dev@users.noreply.github.com> Date: Sun, 2 Jun 2024 23:52:30 +0300 Subject: [PATCH 2/4] Update README.md --- README.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 13b5ca42..65b43942 100644 --- a/README.md +++ b/README.md @@ -61,19 +61,12 @@ Then you could just launch it using `webx` in your terminal. # Download and Compile ## Linux Install [Rust](https://www.rust-lang.org/tools/install) if you haven't already. -It should work by default, but if you're getting errors such as "missing PC files", you should Google it. Most likely you just have to install a library +It should work by default, but if you're getting errors such as "missing .PC files", you should Google it. Most likely you just have to install a library ## Windows -Welcome to Gaming OS 🙂 -1. Download [Rust](https://www.rust-lang.org/tools/install) -2. Download GNU target: `rustup toolchain install stable-gnu && rustup default stable-gnu` -3. Download [MSYS32](https://www.msys2.org/) -4. Open MSYS32 MINGW32 -5. Run: `pacman -Syu` just in case. -6. Run `pacman -S mingw-w64-x86_64-toolchain base-devel mingw-w64-x86_64-gtk4 mingw-w64-x86_64-gettext mingw-w64-x86_64-libxml2 mingw-w64-x86_64-librsvg mingw-w64-x86_64-pkgconf mingw-w64-x86_64-gcc mingw-w64-x86_64-libadwaita mingw-w64-x86_64-lua` -7. Go to `Settings` -> `Search` and open `Advanced system settings` -> Click on `Environment variables` (or just search "path") -8. Select `Path` -> Click on `Edit` -> Add the following three entries: `C:\msys64\mingw64\include`, `C:\msys64\mingw64\bin`, and `C:\msys64\mingw64\lib`. -9. Open a terminal in the folder with `napture/`, run `cargo run`. +1. Download this repo as a zip and extract it. +2. Run `windows-compiler.bat` by @neoapps-dev +3. that's it. ## MacOS (Apple Silicon) 1. Install [Rust](https://www.rust-lang.org/tools/install) From 9a174b129e74fa968e4e6306ea8e42b3434d6632 Mon Sep 17 00:00:00 2001 From: Asd22 Entertainment <158327205+neoapps-dev@users.noreply.github.com> Date: Mon, 3 Jun 2024 17:12:40 +0300 Subject: [PATCH 3/4] Update windows-compiler.bat --- windows-compiler.bat | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/windows-compiler.bat b/windows-compiler.bat index 0fdb1203..f26e18a6 100644 --- a/windows-compiler.bat +++ b/windows-compiler.bat @@ -1,13 +1,17 @@ @echo off if "%1" == "next" goto :next + +:: BatchGotAdmin :------------------------------------- +REM --> Check for permissions IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" ( >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system" ) ELSE ( >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" ) +REM --> If error flag set, we do not have admin. if '%errorlevel%' NEQ '0' ( echo Requesting administrative privileges... goto UACPrompt @@ -32,10 +36,14 @@ title Bussin Napture Windows Compiler - By NEOAPPS rustc --version IF %ERRORLEVEL% NEQ 0 ( echo Rust is not installed. Please install Rust before proceeding. >error.txt - SET pc=i686 + set pc=i686 if "%ProgramFiles(x86)%" == "C:\Program Files (x86)" set pc=x86_64 echo Downloading Rust Installer for your PC... - powershell -Command "Invoke-WebRequest -Uri https://static.rust-lang.org/rustup/dist/%pc%-pc-windows-msvc/rustup-init.exe -OutFile rustup-init.exe" +if %pc% NEQ i686 ( +powershell -Command "Invoke-WebRequest -Uri https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe -OutFile rustup-init.exe" +) else ( +powershell -Command "Invoke-WebRequest -Uri https://static.rust-lang.org/rustup/dist/i686-pc-windows-msvc/rustup-init.exe -OutFile rustup-init.exe" +) echo Downloaded rustup-init.exe. Complete installation then open the compiler again. >>error.txt rustup-init setx PATH "%PATH%;%USERPROFILE%\.cargo\bin" /m From 8e0743b2cb6a0e9a085530e090caee903600ef25 Mon Sep 17 00:00:00 2001 From: Asd22 Entertainment <158327205+neoapps-dev@users.noreply.github.com> Date: Mon, 3 Jun 2024 17:51:42 +0300 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 65b43942..68c23a64 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ It should work by default, but if you're getting errors such as "missing .PC fil ## Windows 1. Download this repo as a zip and extract it. -2. Run `windows-compiler.bat` by @neoapps-dev +2. Run `windows-compiler.bat` 3. that's it. ## MacOS (Apple Silicon)