- 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 |
||
|---|---|---|
| .. | ||
| copyparty-ctmp.bat | ||
| copyparty-sfx.bat | ||
| README.md | ||
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
.pyfiles 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.batand place it in the same folder as your copyparty SFX file - Double-click
run-sfx.batinstead of the.pyfile - The launcher will:
- Automatically find your Python installation
- Set
PRTY_NO_MAGIC=1to 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
.batfile instead of the.pyfile
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
.pyfile → "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.pyfile 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 --versionin 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