diff --git a/.gitignore b/.gitignore index 8a30d25..0ce4444 100644 --- a/.gitignore +++ b/.gitignore @@ -396,3 +396,8 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml + +# Bonsai folders +Bonsai/Extensions +Bonsai/Gallery +Bonsai/Packages diff --git a/Bonsai/Bonsai.config b/Bonsai/Bonsai.config new file mode 100644 index 0000000..6d36366 --- /dev/null +++ b/Bonsai/Bonsai.config @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Bonsai/Bonsai.exe b/Bonsai/Bonsai.exe new file mode 100644 index 0000000..f3cd29b Binary files /dev/null and b/Bonsai/Bonsai.exe differ diff --git a/Bonsai/Bonsai.exe.settings b/Bonsai/Bonsai.exe.settings new file mode 100644 index 0000000..c645b88 --- /dev/null +++ b/Bonsai/Bonsai.exe.settings @@ -0,0 +1,22 @@ + + + Normal + Light + 351 + + 379 + 318 + 1120 + 450 + + + + 2024-04-08T10:12:52.0277532-04:00 + C:\Users\brand\public\OEPlugins\ephys-socket\Resources\test-ephys-socket-with-function-generator.bonsai + + + 2024-04-08T10:10:32.4529327-04:00 + C:\Users\brand\public\OpenEphys.Sockets.Bonsai\Bonsai\Gallery\Bonsai.Examples.Ephys\Bonsai.Examples.Ephys.bonsai + + + \ No newline at end of file diff --git a/Bonsai/NuGet.config b/Bonsai/NuGet.config new file mode 100644 index 0000000..97e8b73 --- /dev/null +++ b/Bonsai/NuGet.config @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Bonsai/Setup.cmd b/Bonsai/Setup.cmd new file mode 100644 index 0000000..92d983d --- /dev/null +++ b/Bonsai/Setup.cmd @@ -0,0 +1,4 @@ +@echo off +pushd %~dp0 +powershell -ExecutionPolicy Bypass -File ./Setup.ps1 +popd \ No newline at end of file diff --git a/Bonsai/Setup.ps1 b/Bonsai/Setup.ps1 new file mode 100644 index 0000000..01cfba6 --- /dev/null +++ b/Bonsai/Setup.ps1 @@ -0,0 +1,21 @@ +Push-Location $PSScriptRoot +if (!(Test-Path "./Bonsai.exe")) { + $release = "https://github.com/bonsai-rx/bonsai/releases/latest/download/Bonsai.zip" + $configPath = "./Bonsai.config" + if (Test-Path $configPath) { + [xml]$config = Get-Content $configPath + $bootstrapper = $config.PackageConfiguration.Packages.Package.where{$_.id -eq 'Bonsai'} + if ($bootstrapper) { + $version = $bootstrapper.version + $release = "https://github.com/bonsai-rx/bonsai/releases/download/$version/Bonsai.zip" + } + } + Invoke-WebRequest $release -OutFile "temp.zip" + Move-Item -Path "NuGet.config" "temp.config" -ErrorAction SilentlyContinue + Expand-Archive "temp.zip" -DestinationPath "." -Force + Move-Item -Path "temp.config" "NuGet.config" -Force -ErrorAction SilentlyContinue + Remove-Item -Path "temp.zip" + Remove-Item -Path "Bonsai32.exe" +} +& .\Bonsai.exe --no-editor +Pop-Location \ No newline at end of file diff --git a/OpenEphys.Sockets.Bonsai/OpenEphys.Sockets.Bonsai/OpenEphys.Sockets.Bonsai.csproj b/OpenEphys.Sockets.Bonsai/OpenEphys.Sockets.Bonsai/OpenEphys.Sockets.Bonsai.csproj index e8b8f74..b5f5cf9 100644 --- a/OpenEphys.Sockets.Bonsai/OpenEphys.Sockets.Bonsai/OpenEphys.Sockets.Bonsai.csproj +++ b/OpenEphys.Sockets.Bonsai/OpenEphys.Sockets.Bonsai/OpenEphys.Sockets.Bonsai.csproj @@ -19,8 +19,9 @@ git true net472 - 1.0.1 + 1.0.2 strict + README.md diff --git a/OpenEphys.Sockets.Bonsai/OpenEphys.Sockets.Bonsai/Properties/launchSettings.json b/OpenEphys.Sockets.Bonsai/OpenEphys.Sockets.Bonsai/Properties/launchSettings.json index 06dd50d..221171e 100644 --- a/OpenEphys.Sockets.Bonsai/OpenEphys.Sockets.Bonsai/Properties/launchSettings.json +++ b/OpenEphys.Sockets.Bonsai/OpenEphys.Sockets.Bonsai/Properties/launchSettings.json @@ -2,9 +2,9 @@ "profiles": { "Bonsai": { "commandName": "Executable", - "executablePath": "$(registry:HKEY_CURRENT_USER\\Software\\Bonsai Foundation\\Bonsai@InstallDir)Bonsai.exe", + "executablePath": "$(SolutionDir)..\\Bonsai\\Bonsai.exe", "commandLineArgs": "--lib:\"$(TargetDir).\"", "nativeDebugging": true } } -} +} \ No newline at end of file