Description
Currently, the setup.ps1 script forces an auto-elevation check to Administrator at the very beginning of the script. While this is necessary for installing Windows Context Menu entries (which require writing to HKLM), it completely breaks the PaddleOCR installation for standard (non-admin) users.
Because the script elevates to an Administrator profile via UAC, the PaddleOCR virtual environment (paddleocr-venv) and models are downloaded and installed into the Administrator's %LOCALAPPDATA% (e.g., C:\Users\Administrator\AppData\Local\autorename-pdf\paddleocr-venv).
When the standard user subsequently runs autorename-pdf-cli.exe, the tool looks for the venv in the standard user's profile, fails to find it, and throws the warning: ⚠ PaddleOCR not installed — run setup.ps1 to install.
Steps to Reproduce
- Log into Windows as a Standard User (non-admin account).
- Open PowerShell and run
.\setup.ps1.
- The script triggers a UAC prompt. Enter the Administrator credentials to proceed.
- Choose
y to install PaddleOCR.
- Once the installation is complete, open a normal (non-elevated) command prompt or PowerShell.
- Run a dry run requiring OCR:
autorename-pdf-cli.exe rename "C:\Path\To\PDFs" --ocr --dry-run
- Expected behavior: The tool uses PaddleOCR to extract text.
- Actual behavior: The tool fails with
PaddleOCR requested but not available because the standard user cannot access the admin's AppData folder where the engine was actually installed.
Proposed Solution
Do not force a blanket Administrator elevation at the start of the script. Instead:
- Ask the user if they want to install the Windows Context Menu entries first.
- Only request UAC elevation specifically for the registry modification portion of the script if they say "Yes" to the context menus.
- Allow the PaddleOCR installation block to run as the current/standard user so the
paddleocr-venv is correctly mapped to the user who is actually running the tool.
Workaround Used
Manually editing setup.ps1 to comment out the Administrator elevation block allows the standard user to install PaddleOCR successfully into their own %LOCALAPPDATA% directory, resolving the issue.
Description
Currently, the
setup.ps1script forces an auto-elevation check to Administrator at the very beginning of the script. While this is necessary for installing Windows Context Menu entries (which require writing toHKLM), it completely breaks the PaddleOCR installation for standard (non-admin) users.Because the script elevates to an Administrator profile via UAC, the PaddleOCR virtual environment (
paddleocr-venv) and models are downloaded and installed into the Administrator's%LOCALAPPDATA%(e.g.,C:\Users\Administrator\AppData\Local\autorename-pdf\paddleocr-venv).When the standard user subsequently runs
autorename-pdf-cli.exe, the tool looks for thevenvin the standard user's profile, fails to find it, and throws the warning:⚠ PaddleOCR not installed — run setup.ps1 to install.Steps to Reproduce
.\setup.ps1.yto install PaddleOCR.autorename-pdf-cli.exe rename "C:\Path\To\PDFs" --ocr --dry-runPaddleOCR requested but not availablebecause the standard user cannot access the admin'sAppDatafolder where the engine was actually installed.Proposed Solution
Do not force a blanket Administrator elevation at the start of the script. Instead:
paddleocr-venvis correctly mapped to the user who is actually running the tool.Workaround Used
Manually editing
setup.ps1to comment out the Administrator elevation block allows the standard user to install PaddleOCR successfully into their own%LOCALAPPDATA%directory, resolving the issue.