Skip to content

Commit e73b4b8

Browse files
committed
Merge branch 'anjaldoshi/plugin-locations' into development
2 parents 22f018e + 8978a24 commit e73b4b8

19 files changed

Lines changed: 390 additions & 142 deletions

File tree

.github/workflows/linux.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ jobs:
3838
user_info="$bintrayUser:$bintrayApiKey"
3939
curl -T $zipfile --user $user_info https://api.bintray.com/content/open-ephys-gui/Test/Test-linux/$gui_ver/$zipfile
4040
curl -X POST --user $user_info https://api.bintray.com/content/open-ephys-gui/Test/Test-linux/$gui_ver/publish
41+
cd ../Resources/Installers/Linux/Open-Ephys_Installer
42+
mkdir -p usr/local/bin/open-ephys-gui
43+
cp -r ../../../../Build/Release usr/local/bin/open-ephys-gui
44+
cp ../../../Scripts/40-open-ephys.rules usr/local/bin/open-ephys-gui
45+
cd ..
46+
dpkg-deb --build Open-Ephys_Installer
47+
installer=Open-Ephys_Installer_${gui_ver}-beta.deb
48+
mv -v Open-Ephys_Installer.deb $installer
49+
curl -T $installer --user $user_info https://api.bintray.com/content/open-ephys-gui/Test-Installer/Test-Installer-windows/$gui_ver/$installer
50+
curl -X POST --user $user_info https://api.bintray.com/content/open-ephys-gui/Test-Installer/Test-Installer-windows/$gui_ver/publish
4151
shell: bash
4252
- name: deploy_release
4353
if: github.ref == 'refs/heads/master'
@@ -55,4 +65,14 @@ jobs:
5565
user_info="$bintrayUser:$bintrayApiKey"
5666
curl -T $zipfile --user $user_info https://api.bintray.com/content/open-ephys-gui/Release/Release-linux/$gui_ver/$zipfile
5767
curl -X POST --user $user_info https://api.bintray.com/content/open-ephys-gui/Release/Release-linux/$gui_ver/publish
68+
cd ../Resources/Installers/Linux/Open-Ephys_Installer
69+
mkdir -p usr/local/bin/open-ephys-gui
70+
cp -r ../../../../Build/Release usr/local/bin/open-ephys-gui
71+
cp ../../../Scripts/40-open-ephys.rules usr/local/bin/open-ephys-gui
72+
cd ..
73+
dpkg-deb --build Open-Ephys_Installer
74+
installer=Open-Ephys_Installer_${gui_ver}-beta.deb
75+
mv Open-Ephys_Installer.deb $installer
76+
curl -T $installer --user $user_info https://api.bintray.com/content/open-ephys-gui/Release-Installer/Release-Installer-windows/$gui_ver/$installer
77+
curl -X POST --user $user_info https://api.bintray.com/content/open-ephys-gui/Release-Installer/Release-Installer-windows/$gui_ver/publish
5878
shell: bash

.github/workflows/windows.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ jobs:
4242
user_info="$bintrayUser:$bintrayApiKey"
4343
curl -T $zipfile --user $user_info https://api.bintray.com/content/open-ephys-gui/Test/Test-windows/$gui_ver/$zipfile
4444
curl -X POST --user $user_info https://api.bintray.com/content/open-ephys-gui/Test/Test-windows/$gui_ver/publish
45+
cd ../Resources/Installers/Windows
46+
iscc "windows_installer_script.iss"
47+
installer=Open-Ephys_Installer_${gui_ver}-beta.exe
48+
mv Open-Ephys_Installer.exe $installer
49+
curl -T $installer --user $user_info https://api.bintray.com/content/open-ephys-gui/Test-Installer/Test-Installer-windows/$gui_ver/$installer
50+
curl -X POST --user $user_info https://api.bintray.com/content/open-ephys-gui/Test-Installer/Test-Installer-windows/$gui_ver/publish
4551
shell: bash
4652
- name: deploy_release
4753
if: github.ref == 'refs/heads/master'
@@ -60,4 +66,10 @@ jobs:
6066
user_info="$bintrayUser:$bintrayApiKey"
6167
curl -T $zipfile --user $user_info https://api.bintray.com/content/open-ephys-gui/Release/Release-windows/$gui_ver/$zipfile
6268
curl -X POST --user $user_info https://api.bintray.com/content/open-ephys-gui/Release/Release-windows/$gui_ver/publish
69+
cd ../Resources/Installers/Windows
70+
iscc "windows_installer_script.iss"
71+
installer=Open-Ephys_Installer_${gui_ver}.exe
72+
mv Open-Ephys_Installer.exe $installer
73+
curl -T $installer --user $user_info https://api.bintray.com/content/open-ephys-gui/Release-Installer/Release-Installer-windows/$gui_ver/$installer
74+
curl -X POST --user $user_info https://api.bintray.com/content/open-ephys-gui/Release-Installer/Release-Installer-windows/$gui_ver/publish
6375
shell: bash
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Package: open-ephys
2+
Version: 0.5.0
3+
Architecture: amd64
4+
Installed-Size: 18644
5+
Section: science
6+
Priority: optional
7+
Maintainer: Open Ephys <info@open-ephys.com>
8+
Homepage: https://open-ephys.org/gui
9+
Description: Software for processing, recording, and visualizing multichannel electrophysiology data.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Files: *
2+
Copyright: 2020 Open Ephys <info@open-ephys.com>
3+
License: GPL-3+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
# postinst script for Open Ephys
3+
4+
if [ "$1" = configure ]; then
5+
6+
echo "Copying open-ephys udev rules and restaring udev service..."
7+
cd /usr/local/bin
8+
mv open-ephys-gui/40-open-ephys.rules /etc/udev/rules.d
9+
service udev restart
10+
11+
echo "Creating open-ephys symlink to /usr/local/bin..."
12+
ln -sf open-ephys-gui/open-ephys open-ephys
13+
14+
echo "Installation finished!"
15+
16+
fi
17+
14.3 MB
Binary file not shown.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[Setup]
2+
AppName=Open Ephys
3+
AppVersion=0.5.0
4+
AppVerName=Open Ephys 0.5.0
5+
AppPublisher=open-ephys.org
6+
AppPublisherURL=https://open-ephys.org/gui
7+
DefaultDirName={autopf}\Open Ephys
8+
DefaultGroupName=Open Ephys
9+
OutputBaseFilename=Open-Ephys_Installer
10+
OutputDir=.
11+
LicenseFile=..\..\..\Licenses\LICENSE
12+
ArchitecturesAllowed=x64
13+
ArchitecturesInstallIn64BitMode=x64
14+
ChangesAssociations=yes
15+
SetupIconFile="..\..\Build-files\icon.ico"
16+
UninstallDisplayIcon={app}\open-ephys.exe
17+
AllowNoIcons=yes
18+
WizardStyle=modern
19+
20+
[Tasks]
21+
Name: desktopicon; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
22+
Name: install_usb; Description: "Install Opal Kelly Front Panel USB driver for Open Ephys Acquisition Board"; GroupDescription: "External drivers:";
23+
24+
[Files]
25+
Source: "..\..\..\Build\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; BeforeInstall: UpdateProgress(0);
26+
Source: "..\..\DataFiles\*"; DestDir: "{userdocs}\Open Ephys\DataFiles"; Flags: ignoreversion recursesubdirs; BeforeInstall: UpdateProgress(60);
27+
Source: "vcredist_x64.exe"; DestDir: {tmp}; Flags: deleteafterinstall; BeforeInstall: UpdateProgress(70);
28+
Source: "..\..\DLLs\FrontPanelUSB-DriverOnly-4.5.5.exe"; DestDir: {tmp}; Flags: deleteafterinstall; BeforeInstall: UpdateProgress(90);
29+
30+
[Icons]
31+
Name: "{group}\Open Ephys"; Filename: "{app}\open-ephys.exe"
32+
Name: "{autodesktop}\Open Ephys"; Filename: "{app}\open-ephys.exe"; Tasks: desktopicon
33+
Name: "{autoprograms}\Open Ephys"; Filename: "{app}\open-ephys.exe"
34+
35+
[Run]
36+
Filename: "{tmp}\vcredist_x64.exe"; Parameters: "/q /norestart /q:a /c:""VCREDI~3.EXE /q:a /c:""""msiexec /i vcredist.msi /qn"""" """; Check: VCRedistNeedsInstall; WorkingDir: {app}; StatusMsg: "Installing VC++ 2019 Redistributables...";
37+
Filename: "{tmp}\FrontPanelUSB-DriverOnly-4.5.5.exe"; StatusMsg: "Installing Front Panel USB driver..."; Tasks: install_usb; Flags: skipifsilent
38+
39+
[Code]
40+
procedure UpdateProgress(Position: Integer);
41+
begin
42+
WizardForm.ProgressGauge.Position := Position * WizardForm.ProgressGauge.Max div 100;
43+
end;
44+
45+
#IFDEF UNICODE
46+
#DEFINE AW "W"
47+
#ELSE
48+
#DEFINE AW "A"
49+
#ENDIF
50+
type
51+
INSTALLSTATE = Longint;
52+
const
53+
INSTALLSTATE_INVALIDARG = -2; // An invalid parameter was passed to the function.
54+
INSTALLSTATE_UNKNOWN = -1; // The product is neither advertised or installed.
55+
INSTALLSTATE_ADVERTISED = 1; // The product is advertised but not installed.
56+
INSTALLSTATE_ABSENT = 2; // The product is installed for a different user.
57+
INSTALLSTATE_DEFAULT = 5; // The product is installed for the current user.
58+
59+
// Visual C++ 2019 Redistributable 14.25.28508
60+
VC_2019_REDIST_X86_MIN = '{2BC3BD4D-FABA-4394-93C7-9AC82A263FE2}';
61+
VC_2019_REDIST_X64_MIN = '{EEA66967-97E2-4561-A999-5C22E3CDE428}';
62+
63+
VC_2019_REDIST_X86_ADD = '{0FA68574-690B-4B00-89AA-B28946231449}';
64+
VC_2019_REDIST_X64_ADD = '{7D0B74C2-C3F8-4AF1-940F-CD79AB4B2DCE}';
65+
66+
function MsiQueryProductState(szProduct: string): INSTALLSTATE;
67+
external 'MsiQueryProductState{#AW}@msi.dll stdcall';
68+
69+
function VCVersionInstalled(const ProductID: string): Boolean;
70+
begin
71+
Result := MsiQueryProductState(ProductID) = INSTALLSTATE_DEFAULT;
72+
end;
73+
74+
function VCRedistNeedsInstall: Boolean;
75+
begin
76+
Result := not (VCVersionInstalled(VC_2019_REDIST_X64_MIN));
77+
end;

Source/CoreServices.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,30 @@ namespace CoreServices
229229
File getDefaultUserSaveDirectory()
230230
{
231231
#if defined(__APPLE__)
232-
File dir = File::getSpecialLocation(File::userDocumentsDirectory).getChildFile("open-ephys");
232+
const File dir = File::getSpecialLocation(File::userDocumentsDirectory).getChildFile("Open Ephys");
233+
#elif _WIN32
234+
const File dir = File::getSpecialLocation(File::userDocumentsDirectory).getChildFile("Open Ephys");
235+
#else
236+
const File dir = File::getSpecialLocation(File::userHomeDirectory).getChildFile("open-ephys");
237+
#endif
233238
if (!dir.isDirectory()) {
234239
dir.createDirectory();
235240
}
236241
return std::move(dir);
242+
}
243+
244+
File getSavedStateDirectory() {
245+
#if defined(__APPLE__)
246+
File dir = File::getSpecialLocation(File::userApplicationDataDirectory).getChildFile("Application Support/open-ephys");
247+
#elif _WIN32
248+
File dir = File::getSpecialLocation(File::commonApplicationDataDirectory).getChildFile("Open Ephys");
237249
#else
238-
return File::getCurrentWorkingDirectory();
250+
File dir = File::getSpecialLocation(File::userApplicationDataDirectory).getChildFile(".open-ephys");;
239251
#endif
252+
if (!dir.isDirectory()) {
253+
dir.createDirectory();
254+
}
255+
return std::move(dir);
240256
}
241257

242258
String getGUIVersion()

Source/CoreServices.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ PLUGIN_API const char* getApplicationResource(const char* name, int& size);
129129
/** Gets the default directory for user-initiated file saving/loading */
130130
PLUGIN_API File getDefaultUserSaveDirectory();
131131

132+
/** Gets the save directory for GUI-related file saving/loading */
133+
PLUGIN_API File getSavedStateDirectory();
134+
132135
/** Gets the GUI version */
133136
PLUGIN_API String getGUIVersion();
134137

Source/Main.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,20 @@ class OpenEphysApplication : public JUCEApplication
6565

6666
#ifdef WIN32
6767
//glWinInit();
68-
69-
int consoleArg = parameters.indexOf("--console", true);
70-
if (consoleArg != -1)
68+
if (AllocConsole())
7169
{
72-
parameters.remove(consoleArg);
73-
if (AllocConsole())
74-
{
75-
freopen("CONOUT$","w",stdout);
76-
freopen("CONOUT$","w",stderr);
77-
console_out = std::ofstream("CONOUT$");
78-
std::cout.rdbuf(console_out.rdbuf());
79-
std::cerr.rdbuf(console_out.rdbuf());
80-
SetConsoleTitle("Debug Console");
81-
std::cout << "Debug console..." << std::endl;
82-
}
70+
freopen("CONOUT$","w",stdout);
71+
freopen("CONOUT$","w",stderr);
72+
console_out = std::ofstream("CONOUT$");
73+
std::cout.rdbuf(console_out.rdbuf());
74+
std::cerr.rdbuf(console_out.rdbuf());
75+
SMALL_RECT windowSize = {0, 0, 85 - 1, 35 - 1};
76+
COORD bufferSize = { 85 , 9999 };
77+
HANDLE wHnd = GetStdHandle(STD_OUTPUT_HANDLE);
78+
SetConsoleTitle("[Open Ephys] Debug Console");
79+
SetConsoleWindowInfo(wHnd, true, &windowSize);
80+
SetConsoleScreenBufferSize(wHnd, bufferSize);
81+
std::cout << "Debug console..." << std::endl;
8382
}
8483

8584
#endif

0 commit comments

Comments
 (0)