mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
- Set PRTY_NO_MAGIC=1 automatically on Windows in SFX script to prevent python-magic segfaults - Improve Windows error messages with detailed troubleshooting instructions - Add contrib/run-sfx.bat universal launcher for easy double-click execution - Add contrib/windows/copyparty-sfx.bat template for pairing with specific SFX files - Add comprehensive Windows support documentation in contrib/windows/README.md - Update contrib/README.md to reference new Windows tools This resolves issues where Windows users couldn't double-click SFX files to run them and experienced segmentation faults with the python-magic library. Fixes #324
2.7 KiB
2.7 KiB
Windows Support for copyparty SFX Files
This directory contains Windows-specific tools and solutions for running copyparty SFX (self-extracting) files.
Problem
Windows users often experience issues when trying to run copyparty SFX files:
- Double-click doesn't work: Clicking on
.py
files may open an editor instead of running the script - Segmentation faults: The python-magic library can cause crashes on Windows
- Poor error messages: When something goes wrong, users don't get helpful feedback
Solutions
Option 1: Use the SFX Launcher (Recommended)
- Download
run-sfx.bat
and place it in the same folder as your copyparty SFX file - Double-click
run-sfx.bat
instead of the.py
file - The launcher will:
- Automatically find your Python installation
- Set
PRTY_NO_MAGIC=1
to prevent crashes - Provide helpful error messages
- Keep the window open so you can see what happened
Option 2: Create a Paired Batch File
- Download
copyparty-sfx.bat
- Rename it to match your SFX file (e.g.,
copyparty-1.8.5.py
→copyparty-1.8.5.bat
) - Double-click the
.bat
file instead of the.py
file
Option 3: Manual Environment Variable
If you prefer to run the SFX file directly:
- Open Command Prompt or PowerShell
- Set the environment variable:
set PRTY_NO_MAGIC=1
- Run:
python copyparty-x.x.x.py
Option 4: Fix File Association
Associate .py
files with Python interpreter:
- Right-click any
.py
file → "Open with" → "Choose another app" - Browse to your Python installation (e.g.,
C:\Python39\python.exe
) - Check "Always use this app to open .py files"
Files in this Directory
copyparty-sfx.bat
- Generic batch file template for any SFX filerun-sfx.bat
- Universal SFX launcher that finds any.py
file in the same directorycopyparty-ctmp.bat
- Existing utility for running copyparty.exe with fixed temp directory
Technical Details
The SFX script automatically sets PRTY_NO_MAGIC=1
on Windows to disable the python-magic library, which is known to cause segmentation faults on Windows systems. This environment variable is checked by copyparty to determine whether to use python-magic for file type detection.
Troubleshooting
If you still have issues:
- Make sure Python is installed and accessible from the command line
- Try running
python --version
in Command Prompt to verify - Check that you have the latest copyparty SFX file
- For advanced debugging, run the SFX file from Command Prompt to see detailed error messages