Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: remove tesseract from windows

Louis Beaumonta8dad7410412
diff --git a/content/docs/pages/docs/getting-started.mdx b/content/docs/pages/docs/getting-started.mdx
index 60721781b..b2f34f91f 100644
--- a/content/docs/pages/docs/getting-started.mdx
+++ b/content/docs/pages/docs/getting-started.mdx
@@ -52,7 +52,7 @@ for users preferring full control or customization, building the app manually fr
1. start by installing rust and all necessary dependencies:
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- brew install pkg-config ffmpeg jq tesseract cmake wget
+ brew install pkg-config ffmpeg jq cmake wget
```
2. install deno cli (required for building):
diff --git a/screenpipe-app-tauri/scripts/pre_build.js b/screenpipe-app-tauri/scripts/pre_build.js
index 822a018e9..a143f2a64 100644
--- a/screenpipe-app-tauri/scripts/pre_build.js
+++ b/screenpipe-app-tauri/scripts/pre_build.js
@@ -321,7 +321,6 @@ if (platform == 'windows') {
// process.exit(1);
}
-
// Setup FFMPEG
if (!(await fs.exists(config.ffmpegRealname))) {
await $`${wgetPath} --no-config --tries=10 --retry-connrefused --waitretry=10 --secure-protocol=auto --no-check-certificate --show-progress ${config.windows.ffmpegUrl} -O ${config.windows.ffmpegName}.7z`
@@ -331,28 +330,6 @@ if (platform == 'windows') {
await $`mv ${config.ffmpegRealname}/lib/x64/* ${config.ffmpegRealname}/lib/`
}
- // Setup Tesseract
- const tesseractName = 'tesseract-setup'
- const tesseractUrl = 'https://github.com/UB-Mannheim/tesseract/releases/download/v5.4.0.20240606/tesseract-ocr-w64-setup-5.4.0.20240606.exe'
- const tesseractInstaller = `${tesseractName}.exe`
-
- if (!(await fs.exists('tesseract'))) {
- console.log('Setting up Tesseract for Windows...')
- await $`${wgetPath} --no-config -nc --no-check-certificate --show-progress ${tesseractUrl} -O ${tesseractInstaller}`
- await $`"${process.cwd()}\\${tesseractInstaller}" /S /D=C:\\Program Files\\Tesseract-OCR`
- await $`rm ${tesseractInstaller}`
- // Replace the mv command with xcopy
- await $`xcopy "C:\\Program Files\\Tesseract-OCR" tesseract /E /I /H /Y`
- // Optionally, remove the original directory if needed
- // await $`rmdir "C:\\Program Files\\Tesseract-OCR" /S /Q`
- console.log('Tesseract for Windows set up successfully.')
- } else {
- console.log('Tesseract for Windows already exists.')
- }
-
- // Add Tesseract to PATH
- process.env.PATH = `${process.cwd()}\\tesseract;${process.env.PATH}`
-
// Setup ONNX Runtime
const onnxRuntimeName = "onnxruntime-win-x64-gpu-1.19.2";
const onnxRuntimeLibs = `${onnxRuntimeName}.zip`;
@@ -519,6 +496,8 @@ if (platform == 'macos') {
}
+// ! TODO remove all this dead code?
+
// Nvidia
let cudaPath
if (hasFeature('cuda')) {
@@ -548,7 +527,6 @@ if (hasFeature('cuda')) {
[`${cudaPath}\\bin\\cudart64_*`]: './',
[`${cudaPath}\\bin\\cublas64_*`]: './',
[`${cudaPath}\\bin\\cublasLt64_*`]: './',
- 'tesseract\\*': './',
'onnxruntime*\\lib\\*.dll': './',
},
externalBin: [
@@ -757,3 +735,4 @@ if (action?.includes('--build' || action.includes('--dev'))) {
await $`bun install`
await $`bunx tauri ${action.includes('--dev') ? 'dev' : 'build'}`
}
+
diff --git a/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json b/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
index c51875d59..b6426ff0a 100644
--- a/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
+++ b/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
@@ -8,7 +8,6 @@
"resources": {
"ffmpeg\\bin\\x64\\*": "./",
"ffmpeg\\lib\\*": "./",
- "tesseract\\*": "./",
"onnxruntime*\\lib\\*.dll": "./",
"lib\\ollama\\*": "./"
}
diff --git a/screenpipe-server/src/cli.rs b/screenpipe-server/src/cli.rs
index 70741eaed..020aa6c6c 100644
--- a/screenpipe-server/src/cli.rs
+++ b/screenpipe-server/src/cli.rs
@@ -35,7 +35,7 @@ impl From<CliAudioTranscriptionEngine> for CoreAudioTranscriptionEngine {
#[derive(Clone, Debug, ValueEnum, PartialEq)]
pub enum CliOcrEngine {
Unstructured,
- #[cfg(not(target_os = "macos"))]
+ #[cfg(target_os = "linux")]
Tesseract,
#[cfg(target_os = "windows")]
WindowsNative,
@@ -47,7 +47,7 @@ impl From<CliOcrEngine> for CoreOcrEngine {
fn from(cli_engine: CliOcrEngine) -> Self {
match cli_engine {
CliOcrEngine::Unstructured => CoreOcrEngine::Unstructured,
- #[cfg(not(target_os = "macos"))]
+ #[cfg(target_os = "linux")]
CliOcrEngine::Tesseract => CoreOcrEngine::Tesseract,
#[cfg(target_os = "windows")]
CliOcrEngine::WindowsNative => CoreOcrEngine::WindowsNative,