From 9da3bd5b2ea6bee40ddf31c45c6fb090607b5661 Mon Sep 17 00:00:00 2001 From: frdel <38891707+frdel@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:32:53 +0200 Subject: [PATCH] Bundler updates win and mac updates - self extracting archives, bundle requirements split --- bundle/mac_pkg_scripts/postinstall | 13 +++++--- bundle/macos_bundle.sh | 50 +++++++++++++++++------------- bundle/requirements.txt | 3 ++ bundle/windows_bundle.bat | 48 ++++++++++++++++++---------- requirements.txt | 3 -- 5 files changed, 71 insertions(+), 46 deletions(-) create mode 100644 bundle/requirements.txt diff --git a/bundle/mac_pkg_scripts/postinstall b/bundle/mac_pkg_scripts/postinstall index 09d53b312..72019f97d 100755 --- a/bundle/mac_pkg_scripts/postinstall +++ b/bundle/mac_pkg_scripts/postinstall @@ -1,5 +1,8 @@ #!/bin/bash +# Define the source path in the user's Library/Application Support +SOURCE_PATH="$HOME/Library/Application Support/agent-zero/install" + # Prompt the user to select a folder using an AppleScript dialog TARGET_FOLDER=$(osascript <nul - rmdir /s /q agent-zero + rmdir /s /q agent-zero-git ) - if exist agent-zero ( - echo Error: Failed to purge agent-zero folder after retry. + if exist agent-zero-git ( + echo Error: Failed to purge agent-zero-git folder after retry. pause ) ) -:: 4. Clone the repository (testing branch) -git clone --branch testing https://github.com/frdel/agent-zero agent-zero +:: 4. Clone the repository (development branch) +git clone --branch development https://github.com/frdel/agent-zero agent-zero-git if %ERRORLEVEL% neq 0 ( echo Error cloning the repository pause ) -:: 5. Change directory to agent-zero -cd agent-zero +@REM :: 5. Change directory to agent-zero +@REM cd agent-zero +@REM if %errorlevel% neq 0 ( +@REM echo Error changing directory +@REM pause +@REM ) + +:: 6. Install requirements +pip install -r ./agent-zero-git/requirements.txt if %errorlevel% neq 0 ( - echo Error changing directory + echo Error installing project requirements pause ) -:: 6. Install requirements -pip install -r requirements.txt +pip install -r ./agent-zero-git/bundle/requirements.txt if %errorlevel% neq 0 ( - echo Error installing requirements + echo Error installing bundle requirements pause ) @@ -99,11 +105,19 @@ if %errorlevel% neq 0 ( ) :: 8. Run bundle.py -python ./bundle/bundle.py +python ./agent-zero-git/bundle/bundle.py if %errorlevel% neq 0 ( echo Error running bundle.py pause ) +:: 9. Create Windows self-extracting archive with 7-Zip +echo Creating Windows self-extracting archive... +"C:\Program Files\7-Zip\7z.exe" a -sfx"C:\Program Files\7-Zip\7z.sfx" agent-zero-preinstalled-win-x86.exe ".\agent-zero-git\bundle\dist\agent-zero" -mx=7 +if %errorlevel% neq 0 ( + echo Error creating Windows self-extracting archive. + pause +) + echo Script completed pause diff --git a/requirements.txt b/requirements.txt index efab97562..8e3fac3df 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,9 +18,6 @@ lxml_html_clean==0.3.1 markdown==3.7 newspaper3k==0.2.8 paramiko==3.4.0 -pathspec==0.12.1 -py7zr==0.22.0 -pyinstaller==6.10.0 pypdf==4.3.1 python-dotenv==1.0.1 sentence-transformers==3.0.1