Skip to content

Commit

Permalink
feat(windows): add setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
marstamm committed Sep 10, 2024
1 parent 74db9e3 commit a8c8a15
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
66 changes: 66 additions & 0 deletions setup.ps1
Original file line number Diff line number Diff line change
@@ -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"
10 changes: 10 additions & 0 deletions start.ps1
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a8c8a15

Please sign in to comment.