-
Notifications
You must be signed in to change notification settings - Fork 35
/
install_windows.txt
58 lines (48 loc) · 2.6 KB
/
install_windows.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
rem Install the great scoop windows package manager!
rem https://scoop.sh
rem https://github.com/lukesampson/scoop/wiki
rem --> Open new command prompt
rem --> Please adjust to your arch (32 or 64 bit)
rem ---------------
scoop install --arch 64bit aria2 git
scoop bucket add versions
scoop install --arch 64bit file ghostscript imagemagick poppler tesseract qpdf
scoop install --arch 64bit python39
rem --> Open new command prompt to refresh environment variables
rem ---------------
rem Language data files can be downloaded from https://github.com/tesseract-ocr/tessdata
rem Example Portuguese (POR) and Spanhish (SPA) - Tesseract branch 4.00
rem ---------------
aria2c "https://github.com/tesseract-ocr/tessdata/blob/main/por.traineddata?raw=true" --dir="%TESSDATA_PREFIX%"
aria2c "https://github.com/tesseract-ocr/tessdata/blob/main/por.traineddata?raw=true" --dir="%TESSDATA_PREFIX%"
rem Complete python with VENV and basic libs
rem ---------------
python3 -m venv "%USERPROFILE%\pdf2pdfocr-venv"
cd "%USERPROFILE%\pdf2pdfocr-venv"
.\Scripts\activate.bat
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
rem TODO - add cuneiform command line on windows
rem Install PDF2PDFOCR and VBS extension (SendTo)
rem ---------------
aria2c "https://github.com/LeoFCardoso/pdf2pdfocr/archive/master.zip" --dir="%TEMP%" --out="pdf2pdfocr.zip"
7z x %TEMP%\pdf2pdfocr.zip -o%USERPROFILE%
del %TEMP%\pdf2pdfocr.zip
"%USERPROFILE%\pdf2pdfocr-venv\Scripts\python" -m pip install -r "%USERPROFILE%\pdf2pdfocr-master\requirements.txt"
"%USERPROFILE%\pdf2pdfocr-venv\Scripts\python" -m pip install -r "%USERPROFILE%\pdf2pdfocr-master\requirements_gui.txt"
rem ---------------
rem If Gooey install fail, please install Visual C++ for Visual Studio Runtime and try again
rem [x64] https://aka.ms/vs/16/release/vc_redist.x64.exe
rem <OR>
rem [x86] https://aka.ms/vs/16/release/vc_redist.x86.exe
rem ----
rem If Gooey install fail, please install Build Tools (needed for GUI) and try again
rem https://visualstudio.microsoft.com/visual-cpp-build-tools/
rem Download / Run / Check C++ Build Tools / Check MSVC v142 and Windows 10 SDK / Install
move /Y "%USERPROFILE%\pdf2pdfocr-master" "%USERPROFILE%\pdf2pdfocr-venv"
move /Y "%USERPROFILE%\pdf2pdfocr-venv\pdf2pdfocr-master\pdf2pdfocr.vbs" "%APPDATA%\Microsoft\Windows\SendTo\"
move /Y "%USERPROFILE%\pdf2pdfocr-venv\pdf2pdfocr-master\*.lnk" "%APPDATA%\Microsoft\Windows\SendTo\"
rem Copy script to "scripts" inside python VENV
rem ---------------
set PYTHON_PREFIX="%USERPROFILE%\pdf2pdfocr-venv"
move /Y "%USERPROFILE%\pdf2pdfocr-venv\pdf2pdfocr-master\*.py" "%PYTHON_PREFIX%\Scripts"