diff --git a/README.md b/README.md index 5f14cb4..2e1e6b3 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,13 @@ To connect your task worker to the Camunda Cloud, you must set the following env ### Installation +### On Windows + +- Clone or download the repository +- Run `setup.ps1`. If you can not run the file, set your Execution policy to allow remote scripts with `Set-ExecutionPolicy RemoteSigned` +- Add your credentials to `.env` +- run `start.ps1` + ### Running from Docker If you prefer to run the Camunda RPA Runtime using Docker, you can pull the Docker image from the GitHub Container Registry (ghcr.io). diff --git a/requirements.txt b/requirements.txt index a9cfc2d..29ce5d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -85,7 +85,6 @@ packaging==24.1 pdfminer.six==20221105 pendulum==2.1.2 pillow==10.4.0 -pip==24.2 platformdirs==4.2.2 ply==3.11 priority==2.0.0 diff --git a/setup.ps1 b/setup.ps1 new file mode 100644 index 0000000..c30d7a4 --- /dev/null +++ b/setup.ps1 @@ -0,0 +1,66 @@ +# This script assumes you have PowerShell and that execution of scripts is enabled. +# You can enable script execution by running PowerShell as Administrator and typing: +# Set-ExecutionPolicy RemoteSigned + +# Remove the python alias in Windows +Remove-Item $env:LOCALAPPDATA\Microsoft\WindowsApps\python.exe +Remove-Item $env:LOCALAPPDATA\Microsoft\WindowsApps\python3.exe + + +# Install Python +# Define the download URL +$downloadUrl = "https://github.com/winpython/winpython/releases/download/6.1.20230527/Winpython64-3.10.11.1.exe" + +# Define the output path +$outputPath = ".\Winpython64-3.10.11.1.exe" + +# Use WebClient to download WinPython +$webClient = New-Object System.Net.WebClient +$webClient.DownloadFile($downloadUrl, $outputPath) + +# Run the installer non-interactively (silent install) +Start-Process -FilePath $outputPath -ArgumentList "-y" -Wait -NoNewWindow + +# Define the path to the portable Python +$pythonPortablePath = "$(Get-Location)\WPy64-310111\" + +# Add the new directory to the current PATH +$env:PATH += ";$pythonPortablePath;$pythonPortablePath\python-3.10.11.amd64\Scripts;" + +# Verify that the directory has been added +Write-Host "Current PATH: $env:PATH" + +# Setup virtual environment +& "python.exe" -m venv .venv + +& ".venv\Scripts\activate" + + +# Install Node, required for browser automation +# Define the download URL +$nodeDownloadUrl = "https://nodejs.org/dist/v14.18.1/node-v14.18.1-win-x64.zip" + +# Define the output path +$outputPath = ".\node.zip" + +# Use WebClient to download Node.js +$webClient = New-Object System.Net.WebClient +$webClient.DownloadFile($nodeDownloadUrl, $outputPath) + +# Extract Node.js to a portable location +$extractPath = ".\node" +Expand-Archive -Path $outputPath -DestinationPath $extractPath + +# Add Node.js to the PATH +$env:PATH += ";$(Get-Location)\node\node-v14.18.1-win-x64" + +# Install npm packages +& "npm" -v + +# Install Python requirements using the portable pip +& "pip.exe" install -r requirements.txt --no-deps + +# Initialize RF Browser +& "rfbrowser.exe" init + +Write-Host "Installation Done" diff --git a/start.ps1 b/start.ps1 new file mode 100644 index 0000000..6e86ca7 --- /dev/null +++ b/start.ps1 @@ -0,0 +1,10 @@ +# This script assumes you have PowerShell and that execution of scripts is enabled. +# You can enable script execution by running PowerShell as Administrator and typing: +# Set-ExecutionPolicy RemoteSigned + +# Remove the python alias in Windows +Remove-Item $env:LOCALAPPDATA\Microsoft\WindowsApps\python.exe +Remove-Item $env:LOCALAPPDATA\Microsoft\WindowsApps\python3.exe + +& ".venv\Scripts\activate" +& "python.exe" worker.py