-
Notifications
You must be signed in to change notification settings - Fork 0
Major Overhaul – Improved Bypass Methods, File Structure, and Robustness #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
7c14c24
Main upload with 1000 lines
PythonChicken123 b212f38
Update and rename portablemc.py to scrtips/portablemc.py
PythonChicken123 c996394
Remove old portablemc.py
PythonChicken123 1a9bff7
Remove bare exceptions for ruff linter
PythonChicken123 7cc2771
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] e4ba405
Only fallback if the individual script fails
PythonChicken123 83752a1
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] 52d93f0
Update .gitignore
PythonChicken123 9ea3329
Amend ruff linter into commits
PythonChicken123 03d4778
Actual proper README.md!
PythonChicken123 be6b4c1
Fix a few typos in README
PythonChicken123 1142309
Create MIT License
PythonChicken123 bd57f8b
Add Socket.io and bolding of text into README
PythonChicken123 f01a0f7
Update the usage of libraries in README.md
PythonChicken123 7e91a90
Only execute ruff linter if any python file has been edited
PythonChicken123 e31c04d
Add TD;LR in README
PythonChicken123 40d5568
Add suggestion/bug section in README
PythonChicken123 2216dbd
Create general.yml
PythonChicken123 a36530e
Create custom.yml
PythonChicken123 5f71102
Create bug_report.yml
PythonChicken123 db4270d
Move into issue_template
PythonChicken123 816690f
Move into issue_template
PythonChicken123 4cdad7a
Create feature_request.yml
PythonChicken123 92a555c
Update main.py
PythonChicken123 72f11c7
Apply automatic ruff fixes and formatting [skip ci]
PythonChicken123 684677c
Merge branch 'main' into scripts
PythonChicken123 311b51d
Apply automatic ruff fixes and formatting [skip ci]
PythonChicken123 5378080
Update main.yml
PythonChicken123 56f0f4a
Apply suggestions from code review
PythonChicken123 7918d15
Amend Sourcery-AI suggested fixes
PythonChicken123 6435f1f
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] 105a941
Update main.yml
PythonChicken123 acc9f6f
Add files via upload
PythonChicken123 ed4799c
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] c1cb18b
Apply suggestions from code review
PythonChicken123 d2dd591
Delete requirements.txt
PythonChicken123 7ed2882
Fix sourcery-ai bugs
PythonChicken123 5455d48
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] ca0a2b6
Apply suggestions from code review
PythonChicken123 a68c5db
Apply suggestions from code review
PythonChicken123 843fa54
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] dae6a5b
Sourcery-ai bug patches
PythonChicken123 b941427
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] cc89acb
Apply suggestions from code review
PythonChicken123 fc38e9b
Update README.md
PythonChicken123 a53d161
Fix KeyError
PythonChicken123 b6c990c
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] 96aa912
Remove unused .hta
PythonChicken123 b929fe2
Rewrite junction logic
PythonChicken123 75402d7
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] e89ee01
Update portablemc.py
PythonChicken123 5a13029
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] 11e9b9e
Update README.md
PythonChicken123 11481aa
Attempt to fix SSL errors
PythonChicken123 57f0ff8
Fix typo
PythonChicken123 b7af6c8
Remove multiple imports
PythonChicken123 991e33c
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] ce65977
Updated code with cursor
PythonChicken123 e990a4e
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] 796a175
Enhance Launcher.targets with conditional execution
PythonChicken123 fefb2dc
Refactor Launcher.ps1 for improved error handling
PythonChicken123 31e7eb5
Refactor Launcher.vbs for improved functionality
PythonChicken123 092316d
Refactor PortableMCLoader.cs for improved clarity
PythonChicken123 068f608
Update portablemc.py with cursor
PythonChicken123 61e2424
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] 1530c5e
Enhance README with Debug Menu and structure updates
PythonChicken123 39d799c
Update main.py
PythonChicken123 cdbfff3
Update README.md
PythonChicken123 54bd090
Update
PythonChicken123 ac412a1
Fix hardcoded paths and ruff linter
PythonChicken123 3e5dafb
Apply automatic ruff fixes and formatting [skip ci]
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2026 PythonChicken123 | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,101 @@ | ||
| A Python Script that you can use to launch minecraft via a web browser using Flask for a portable installation using PortableMC with an additional web console. | ||
| # Minecraft Portable Web Launcher | ||
|
|
||
| In early development. | ||
|
|
||
| Using: | ||
| * C# Code compilation | ||
| * EXE Code compilation | ||
| * Powershell Script Code as fallback | ||
| * VBS Script as fallback | ||
| A Python‑based Minecraft launcher that runs in a browser using [Flask](https://github.com/pallets/flask) and [PortableMC](https://github.com/mindstorm38/portablemc). Designed for restricted Windows environments where arbitrary `.exe` files are blocked. It uses multiple fallback mechanisms (C# compilation, PowerShell, VBScript) to bypass Group Policy restrictions. | ||
|
|
||
|  | ||
|
|
||
| Execution steps: | ||
| 1. Clone this repository | ||
| ```cli | ||
| git clone https://github.com/PythonChicken123/Minecraft-Portable-Web/ | ||
| ``` | ||
| 2. Switch the branch from main to scripts | ||
| ```cli | ||
| git switch scripts | ||
| > [!WARNING] | ||
| > This project is for education, launcher portability, and system compatibility testing. | ||
| > Do not use it for bypassing security policy without authorization. | ||
|
|
||
| ## Features | ||
|
|
||
| - **Web interface** with live console (via Flask‑SocketIO) | ||
| - **CLI mode** for direct terminal launching | ||
| - **MSBuild fallback** – compiles a C# loader on‑the‑fly | ||
| - **PowerShell & VBScript fallbacks** for the most restricted environments | ||
| - **Junctions** for `mods` and `resourcepacks` (or regular directories if junctions are blocked) | ||
| - **All data stored in `%LOCALAPPDATA%\PortableMC`** – no clutter in the project folder | ||
| - **Debugging Menu** - hidden option with many debugging options | ||
|
|
||
| ## Folder Structure & Trusted Dir Strategy | ||
| The launcher uses a hybrid strategy to find a writable/executable directory, prioritizing `%LOCALAPPDATA%\PortableMC`, then falling back to `%TEMP%` or `%PUBLIC%` if necessary. | ||
|
|
||
| ```text | ||
| Minecraft-Portable-Web/ | ||
| ├── main.py # Entry point – menu & bootstrapping | ||
| ├── scripts/ # Launcher helper scripts | ||
| │ ├── Launcher.targets # MSBuild task | ||
| │ ├── PortableMCLoader.cs # C# loader (compiled if needed) | ||
| │ ├── Launcher.vbs # VBScript fallback | ||
| │ └── Launcher.ps1 # PowerShell fallback | ||
| | └── portablemc.py # Web server (Flask + SocketIO) | ||
| ├── static/ # Web UI Assets | ||
| ├── mods/ (optional) your mods | ||
| ├── resourcepacks/ (optional) your resource packs | ||
| ├── options.txt (optional) Minecraft settings | ||
| └── servers.dat (optional) server list | ||
| ``` | ||
| 3. Change into the directory | ||
| ```cli | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Windows 10/11 | ||
| - Python 3.11+ (or the script will download an embedded Python 3.14). | ||
| - (Optional) MSBuild (comes with .NET Framework 4.8) – used for the C# fallback. | ||
| - (Optional) PowerShell 3.0+ – used as a fallback. | ||
| - (Optional) VBScript support – used as a final fallback. | ||
|
|
||
| ## TL;DR | ||
| * Test on a **Restricted Environment** by **Group Policy** | ||
| * Port all code to **Rust** | ||
|
|
||
| ## Getting Started | ||
|
|
||
| ```bash | ||
| git clone https://github.com/PythonChicken123/Minecraft-Portable-Web/ | ||
| cd Minecraft-Portable-Web | ||
| ``` | ||
| 4. Execute the script | ||
| ```cli | ||
| git switch scripts | ||
| python main.py | ||
| ``` | ||
| Then choose a method: | ||
| * `1` – Web launcher (opens `portablemc.py` in your browser) | ||
| * `2` – MSBuild launcher (uses `Launcher.targets`, compiles C# loader in memory) | ||
| * `3` – CLI launcher (runs `portablemc` directly in the terminal) | ||
| * `4` - Debug Menu (shows a hidden debug list) | ||
|
|
||
| ## How It Works (Bypass Chain) | ||
| The launcher tries the most reliable method first, falling back if blocked: | ||
|
|
||
| 1. **Embedded Python + portablemc** (if the system allows Python execution). | ||
| 2. **MSBuild + C# compilation** (uses `csc.exe` to compile a tiny loader). | ||
| 3. **PowerShell** (with `-ExecutionPolicy Bypass`). | ||
| 4. **VBScript** (via `cscript`). | ||
|
|
||
| If a method is blocked, it tries the next. All launchers set __COMPAT_LAYER=RUNASINVOKER to avoid UAC prompts. | ||
| If all methods fail, the script will leave a log dump which you can use to [open an issue](https://github.com/PythonChicken123/Minecraft-Portable-Web/issues) | ||
|
|
||
| All downloaded files (embedded Python, portablemc binary) are stored in `%LOCALAPPDATA%\PortableMC`. Junctions are created for `mods` and `resourcepacks` so that files placed in the project folder appear inside the game. | ||
|
|
||
| ## Development | ||
| * **Linting:** Ruff is used – run `ruff check .` and `ruff format .` before committing. | ||
| * **Workflow:** The GitHub Actions workflow (`.github/workflows/main.yml`) automatically applies Ruff fixes on push/pull requests. | ||
|
|
||
| ## Troubleshooting | ||
| * `OSError: [WinError 1260]` – Group Policy blocks the method you chose. Try another option. | ||
| * **PowerShell / VBScript errors** – Ensure the scripts have proper permissions. The launcher sets `__COMPAT_LAYER=RUNASINVOKER` to avoid UAC prompts. | ||
| * **SSL errors** – The C# loader and Python scripts force TLS 1.2 and fall back to disabling certificate validation. | ||
| * **Junction creation fails** – The launcher falls back to creating regular directories. | ||
|
|
||
| ## Found a bug? / Have a suggestion? | ||
| If you encounter any issues or have an idea to improve the launcher, please [open an issue](https://github.com/PythonChicken123/Minecraft-Portable-Web/issues) and use the appropriate template. We welcome contributions! | ||
|
|
||
| *An attempt to bypass group policy with potentional fallbacks* | ||
| ## License | ||
| MIT | ||
|
|
||
| `OSError: [WinError 1260] This program is blocked by group policy. For more information, contact your system administrator` | ||
| ## Libraries Used | ||
| * [PortableMC](https://github.com/mindstorm38/portablemc) – The Heart of The Launcher | ||
| * [Flask](https://flask.palletsprojects.com/) & [Flask‑SocketIO](https://flask-socketio.readthedocs.io/) – Web Interface | ||
| * [ansi2html](https://github.com/ralphbean/ansi2html) & [ansi_up](https://github.com/drudru/ansi_up) – ANSI colour conversion | ||
| * [Socket.io](https://socket.io) - Communication between the web and Flask interfaces | ||
| * [Ruff Linter](https://github.com/astral-sh/ruff) - An extremely fast Python linter | ||
| * [uv](https://github.com/astral-sh/uv) - An extremely fast Python package and project manager, written in Rust. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.