Skip to content

Commit

Permalink
Add local Bonsai executable (#7)
Browse files Browse the repository at this point in the history
* Ignore Bonsai subfolders

* Add Bonsai environment files

* Point to local Bonsai.exe

* Add README to package

* Update version to 1.0.2
  • Loading branch information
bparks13 authored Apr 8, 2024
1 parent a1285a9 commit 9920599
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,8 @@ FodyWeavers.xsd

# JetBrains Rider
*.sln.iml

# Bonsai folders
Bonsai/Extensions
Bonsai/Gallery
Bonsai/Packages
79 changes: 79 additions & 0 deletions Bonsai/Bonsai.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Packages>
<Package id="Bonsai" version="2.8.2" />
<Package id="Bonsai.Core" version="2.8.1" />
<Package id="Bonsai.Design" version="2.8.0" />
<Package id="Bonsai.Design.Visualizers" version="2.4.0" />
<Package id="Bonsai.Dsp" version="2.4.0" />
<Package id="Bonsai.Dsp.Design" version="2.4.0" />
<Package id="Bonsai.Editor" version="2.8.1" />
<Package id="Bonsai.Ephys" version="2.4.0" />
<Package id="Bonsai.System" version="2.4.0" />
<Package id="FTD2XX_NET" version="1.0.14" />
<Package id="jacobslusser.ScintillaNET" version="3.6.3" />
<Package id="Markdig" version="0.18.1" />
<Package id="Microsoft.Web.WebView2" version="1.0.1823.32" />
<Package id="OpenCV.Net" version="3.3.1" />
<Package id="Rhythm.Net" version="1.5.0" />
<Package id="Rx-Core" version="2.2.5" />
<Package id="Rx-Interfaces" version="2.2.5" />
<Package id="Rx-Linq" version="2.2.5" />
<Package id="Rx-PlatformServices" version="2.2.5" />
<Package id="SvgNet" version="3.3.3" />
<Package id="YamlDotNet" version="13.1.1" />
<Package id="ZedGraph" version="5.1.7" />
</Packages>
<AssemblyReferences>
<AssemblyReference assemblyName="Bonsai" />
<AssemblyReference assemblyName="Bonsai.Core" />
<AssemblyReference assemblyName="Bonsai.Design" />
<AssemblyReference assemblyName="Bonsai.Design.Visualizers" />
<AssemblyReference assemblyName="Bonsai.Dsp" />
<AssemblyReference assemblyName="Bonsai.Dsp.Design" />
<AssemblyReference assemblyName="Bonsai.Editor" />
<AssemblyReference assemblyName="Bonsai.Ephys" />
<AssemblyReference assemblyName="Bonsai.System" />
</AssemblyReferences>
<AssemblyLocations>
<AssemblyLocation assemblyName="Bonsai" processorArchitecture="MSIL" location="Packages\Bonsai.2.8.2\lib\net48\Bonsai.exe" />
<AssemblyLocation assemblyName="Bonsai.Core" processorArchitecture="MSIL" location="Packages\Bonsai.Core.2.8.1\lib\net462\Bonsai.Core.dll" />
<AssemblyLocation assemblyName="Bonsai.Design" processorArchitecture="MSIL" location="Packages\Bonsai.Design.2.8.0\lib\net462\Bonsai.Design.dll" />
<AssemblyLocation assemblyName="Bonsai.Design.Visualizers" processorArchitecture="MSIL" location="Packages\Bonsai.Design.Visualizers.2.4.0\lib\net45\Bonsai.Design.Visualizers.dll" />
<AssemblyLocation assemblyName="Bonsai.Dsp" processorArchitecture="MSIL" location="Packages\Bonsai.Dsp.2.4.0\lib\net45\Bonsai.Dsp.dll" />
<AssemblyLocation assemblyName="Bonsai.Dsp.Design" processorArchitecture="MSIL" location="Packages\Bonsai.Dsp.Design.2.4.0\lib\net45\Bonsai.Dsp.Design.dll" />
<AssemblyLocation assemblyName="Bonsai.Editor" processorArchitecture="MSIL" location="Packages\Bonsai.Editor.2.8.1\lib\net472\Bonsai.Editor.dll" />
<AssemblyLocation assemblyName="Bonsai.Ephys" processorArchitecture="MSIL" location="Packages\Bonsai.Ephys.2.4.0\lib\net45\Bonsai.Ephys.dll" />
<AssemblyLocation assemblyName="Bonsai.System" processorArchitecture="MSIL" location="Packages\Bonsai.System.2.4.0\lib\net45\Bonsai.System.dll" />
<AssemblyLocation assemblyName="FTD2XX_NET" processorArchitecture="MSIL" location="Packages\FTD2XX_NET.1.0.14\lib\net40\FTD2XX_NET.dll" />
<AssemblyLocation assemblyName="libFrontPanel-csharp" processorArchitecture="MSIL" location="Packages\Rhythm.Net.1.5.0\lib\net40\libFrontPanel-csharp.dll" />
<AssemblyLocation assemblyName="Markdig" processorArchitecture="MSIL" location="Packages\Markdig.0.18.1\lib\net40\Markdig.dll" />
<AssemblyLocation assemblyName="Microsoft.Web.WebView2.Core" processorArchitecture="MSIL" location="Packages\Microsoft.Web.WebView2.1.0.1823.32\lib\net45\Microsoft.Web.WebView2.Core.dll" />
<AssemblyLocation assemblyName="Microsoft.Web.WebView2.WinForms" processorArchitecture="MSIL" location="Packages\Microsoft.Web.WebView2.1.0.1823.32\lib\net45\Microsoft.Web.WebView2.WinForms.dll" />
<AssemblyLocation assemblyName="Microsoft.Web.WebView2.Wpf" processorArchitecture="MSIL" location="Packages\Microsoft.Web.WebView2.1.0.1823.32\lib\net45\Microsoft.Web.WebView2.Wpf.dll" />
<AssemblyLocation assemblyName="OpenCV.Net" processorArchitecture="MSIL" location="Packages\OpenCV.Net.3.3.1\lib\net40\OpenCV.Net.dll" />
<AssemblyLocation assemblyName="Rhythm.Net" processorArchitecture="MSIL" location="Packages\Rhythm.Net.1.5.0\lib\net40\Rhythm.Net.dll" />
<AssemblyLocation assemblyName="ScintillaNET" processorArchitecture="MSIL" location="Packages\jacobslusser.ScintillaNET.3.6.3\lib\net40\ScintillaNET.dll" />
<AssemblyLocation assemblyName="SVG" processorArchitecture="MSIL" location="Packages\SvgNet.3.3.3\lib\net462\SVG.dll" />
<AssemblyLocation assemblyName="System.Reactive.Core" processorArchitecture="MSIL" location="Packages\Rx-Core.2.2.5\lib\net45\System.Reactive.Core.dll" />
<AssemblyLocation assemblyName="System.Reactive.Interfaces" processorArchitecture="MSIL" location="Packages\Rx-Interfaces.2.2.5\lib\net45\System.Reactive.Interfaces.dll" />
<AssemblyLocation assemblyName="System.Reactive.Linq" processorArchitecture="MSIL" location="Packages\Rx-Linq.2.2.5\lib\net45\System.Reactive.Linq.dll" />
<AssemblyLocation assemblyName="System.Reactive.PlatformServices" processorArchitecture="MSIL" location="Packages\Rx-PlatformServices.2.2.5\lib\net45\System.Reactive.PlatformServices.dll" />
<AssemblyLocation assemblyName="YamlDotNet" processorArchitecture="MSIL" location="Packages\YamlDotNet.13.1.1\lib\net47\YamlDotNet.dll" />
<AssemblyLocation assemblyName="ZedGraph" processorArchitecture="MSIL" location="Packages\ZedGraph.5.1.7\lib\net35-Client\ZedGraph.dll" />
</AssemblyLocations>
<LibraryFolders>
<LibraryFolder path="Packages\Microsoft.Web.WebView2.1.0.1823.32\runtimes\win-arm64\native" platform="arm64" />
<LibraryFolder path="Packages\Microsoft.Web.WebView2.1.0.1823.32\runtimes\win-arm64\native_uap" platform="arm64" />
<LibraryFolder path="Packages\Microsoft.Web.WebView2.1.0.1823.32\runtimes\win-x64\native" platform="x64" />
<LibraryFolder path="Packages\Microsoft.Web.WebView2.1.0.1823.32\runtimes\win-x64\native_uap" platform="x64" />
<LibraryFolder path="Packages\Microsoft.Web.WebView2.1.0.1823.32\runtimes\win-x86\native" platform="x86" />
<LibraryFolder path="Packages\Microsoft.Web.WebView2.1.0.1823.32\runtimes\win-x86\native_uap" platform="x86" />
<LibraryFolder path="Packages\OpenCV.Net.3.3.1\build\native\bin\Win32\v110" platform="x86" />
<LibraryFolder path="Packages\OpenCV.Net.3.3.1\build\native\bin\Win32\v110\Release" platform="x86" />
<LibraryFolder path="Packages\OpenCV.Net.3.3.1\build\native\bin\x64\v110" platform="x64" />
<LibraryFolder path="Packages\OpenCV.Net.3.3.1\build\native\bin\x64\v110\Release" platform="x64" />
<LibraryFolder path="Packages\Rhythm.Net.1.5.0\build\native\bin\x64" platform="x64" />
<LibraryFolder path="Packages\Rhythm.Net.1.5.0\build\native\bin\x86" platform="x86" />
</LibraryFolders>
</PackageConfiguration>
Binary file added Bonsai/Bonsai.exe
Binary file not shown.
22 changes: 22 additions & 0 deletions Bonsai/Bonsai.exe.settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<EditorSettings>
<WindowState>Normal</WindowState>
<EditorTheme>Light</EditorTheme>
<AnnotationPanelSize>351</AnnotationPanelSize>
<DesktopBounds>
<X>379</X>
<Y>318</Y>
<Width>1120</Width>
<Height>450</Height>
</DesktopBounds>
<RecentlyUsedFiles>
<RecentlyUsedFile>
<Timestamp>2024-04-08T10:12:52.0277532-04:00</Timestamp>
<Name>C:\Users\brand\public\OEPlugins\ephys-socket\Resources\test-ephys-socket-with-function-generator.bonsai</Name>
</RecentlyUsedFile>
<RecentlyUsedFile>
<Timestamp>2024-04-08T10:10:32.4529327-04:00</Timestamp>
<Name>C:\Users\brand\public\OpenEphys.Sockets.Bonsai\Bonsai\Gallery\Bonsai.Examples.Ephys\Bonsai.Examples.Ephys.bonsai</Name>
</RecentlyUsedFile>
</RecentlyUsedFiles>
</EditorSettings>
8 changes: 8 additions & 0 deletions Bonsai/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Gallery" value="Gallery" />
<add key="Bonsai Packages" value="https://www.myget.org/F/bonsai/api/v3/index.json" />
<add key="Community Packages" value="https://www.myget.org/F/bonsai-community/api/v3/index.json" />
</packageSources>
</configuration>
4 changes: 4 additions & 0 deletions Bonsai/Setup.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off
pushd %~dp0
powershell -ExecutionPolicy Bypass -File ./Setup.ps1
popd
21 changes: 21 additions & 0 deletions Bonsai/Setup.ps1
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
<RepositoryType>git</RepositoryType>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFramework>net472</TargetFramework>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Features>strict</Features>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}

0 comments on commit 9920599

Please sign in to comment.