Commit 36704663 authored by Jussi Lindgren's avatar Jussi Lindgren

Build: Added install of the Mensia acquisition driver materials

- Added fetching of the related driver dll .zip to win32-install_dependencies
- Added a cmake find script for the dll
- Added the Mensia driver package as optional to the Windows installer. It will bring along vs2013 redistributable.
- Added test for the .dll presence to the Mensia driver to avoid an unnecessary warning if the user has not installed the optional package
- Disabled CoAdapt P300 dependencies from the installer as its not included for the moment
parent 855b897d
......@@ -51,6 +51,7 @@ INCLUDE("FindThirdPartyBioSemiLabViewAPI")
INCLUDE("FindThirdPartyEmotivAPI")
INCLUDE("FindThirdPartyNeXus")
INCLUDE("FindThirdPartyMCS")
INCLUDE("FindThirdPartyMensiaAcquisition")
INCLUDE("FindThirdPartyMicromed")
INCLUDE("FindThirdPartyNeuroelectricsEnobio3G")
INCLUDE("FindThirdPartyThinkGearAPI")
......
......@@ -10,6 +10,8 @@
#include <cmath>
#include <string>
#include <fstream>
using namespace OpenViBEAcquisitionServer;
using namespace OpenViBE;
using namespace OpenViBE::Kernel;
......@@ -89,6 +91,14 @@ CDriverMensiaAcquisition::CDriverMensiaAcquisition(IDriverContext& rDriverContex
// Load the Mensia Acquisition Library
OpenViBE::CString l_sPath = m_rDriverContext.getConfigurationManager().expand("${Path_Bin}") + "/" + s_sMensiaDLL;
if(!std::ifstream(l_sPath.toASCIIString()).is_open())
{
m_rDriverContext.getLogManager() << LogLevel_Trace << "CDriverMensiaAcquisition::CDriverMensiaAcquisition: " <<
" dll file [" << l_sPath.toASCIIString() <<"] not openable, perhaps it was not installed.\n";
m_bValid = false;
return;
}
m_oLibMensiaAcquisition = LoadLibrary(l_sPath);
if(!m_oLibMensiaAcquisition)
{
......
......@@ -195,8 +195,15 @@ CAcquisitionServerGUI::CAcquisitionServerGUI(const IKernelContext& rKernelContex
// BEGIN MENSIA ACQUISITION DRIVERS
#if defined TARGET_OS_Windows && defined TARGET_HasMensiaAcquisitionDriver
m_pAcquisitionServer->getDriverContext().getLogManager() << LogLevel_Trace << "Loading Mensia Driver Collection\n";
CString l_sMensiaDLLPath = m_pAcquisitionServer->getDriverContext().getConfigurationManager().expand("${Path_Bin}/openvibe-driver-mensia-acquisition.dll");
m_pAcquisitionServer->getDriverContext().getLogManager() << LogLevel_Trace << "Loading Mensia Driver Collection\n";
CString l_sMensiaDLLPath = m_pAcquisitionServer->getDriverContext().getConfigurationManager().expand("${Path_Bin}/openvibe-driver-mensia-acquisition.dll");
if(!std::ifstream(l_sMensiaDLLPath.toASCIIString()).is_open())
{
m_pAcquisitionServer->getDriverContext().getLogManager() << LogLevel_Trace << "Couldn't open" <<
" dll file [" << l_sMensiaDLLPath.toASCIIString() <<"], perhaps it was not installed.\n";
}
else
{
HINSTANCE l_oLibMensiaAcquisition; // Library Handle
l_oLibMensiaAcquisition = ::LoadLibrary(l_sMensiaDLLPath.toASCIIString());
......@@ -238,6 +245,7 @@ CAcquisitionServerGUI::CAcquisitionServerGUI(const IKernelContext& rKernelContex
::FreeLibrary(l_oLibMensiaAcquisition);
}
}
#endif
// END MENSIA ACQUISITION DRIVERS
......
IF(WIN32)
FIND_PATH(PATH_MENSIA openvibe-driver-mensia-acquisition.dll PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/sdk-mensia-acquisition-driver/ NO_DEFAULT_PATH)
ENDIF(WIN32)
IF(PATH_MENSIA)
MESSAGE(STATUS " Found Mensia Acquisition driver...")
INSTALL(PROGRAMS "${PATH_MENSIA}/openvibe-driver-mensia-acquisition.dll" DESTINATION "bin")
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyMensiaAcquisition)
ELSE(PATH_MENSIA)
MESSAGE(STATUS " FAILED to find Mensia Acquisition driver (optional)")
ENDIF(PATH_MENSIA)
......@@ -687,6 +687,9 @@ SectionGroup Optional optionalGroup
;##########################################################################################################################################################
;##########################################################################################################################################################
/*
* CoAdapt p300
Section /o "GLFW"
SetOutPath "$INSTDIR"
......@@ -707,7 +710,8 @@ no_need_to_download_glfw:
FileClose $0
SectionEnd
*/
;##########################################################################################################################################################
;##########################################################################################################################################################
;##########################################################################################################################################################
......@@ -741,6 +745,9 @@ SectionEnd
;##########################################################################################################################################################
;##########################################################################################################################################################
/*
* coadapt p300
Section /o "inpout32"
SetOutPath "$INSTDIR"
......@@ -767,6 +774,9 @@ SectionEnd
;##########################################################################################################################################################
;##########################################################################################################################################################
/*
* coadapt p300
Section /o "presage"
; todo skip presage properly on vs2008
......@@ -796,6 +806,7 @@ nopresage:
presagepassed:
SectionEnd
*/
SectionGroupEnd
......@@ -811,6 +822,44 @@ SectionGroup Drivers DriverGroup
;##########################################################################################################################################################
;##########################################################################################################################################################
Section /o "Device PKG: Mensia NeuroRT collection"
; Provides Mensia acquisition driver / NeuroRT driver collection, requires vc2013 redist
SetOutPath "$INSTDIR"
CreateDirectory "$INSTDIR\arch"
IfFileExists "arch\vcredist_2013_x86.exe" no_need_to_install_vc2013_redist
NSISdl::download "http://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x86.exe" "arch\vcredist_2013_x86.exe"
Pop $R0 ; Get the return value
StrCmp $R0 "success" +3
MessageBox MB_OK "Download failed: $R0$\nCheck your Internet connection and your firewall settings.$\nMensia acquisition driver wont be installed...$\n" /SD IDOK
Goto skip_mensia_acquisition
ExecWait '"arch\vcredist_2013_x86.exe" /Q'
no_need_to_install_vc2013_redist:
IfFileExists "arch\sdk-mensia-acquisition-driver-vs120-20150925.zip" no_need_to_download_mensia_acquisition
NSISdl::download http://openvibe.inria.fr/dependencies/win32/sdk-mensia-acquisition-driver-vs120-20150925.zip "arch\sdk-mensia-acquisition-driver-vs120-20150925.zip"
Pop $R0 ; Get the return value
StrCmp $R0 "success" +3
MessageBox MB_OK "Download failed: $R0" /SD IDOK
Goto skip_mensia_acquisition
no_need_to_download_mensia_acquisition:
ZipDLL::extractall "arch\sdk-mensia-acquisition-driver-vs120-20150925.zip" "sdk-mensia-acquisition-driver"
FileOpen $0 "$EXEDIR\win32-dependencies.cmd" a
FileSeek $0 0 END
FileWrite $0 "SET PATH=$INSTDIR\sdk-mensia-acquisition-driver\;%PATH%$\r$\n"
FileClose $0
skip_mensia_acquisition:
SectionEnd
;##########################################################################################################################################################
;##########################################################################################################################################################
;##########################################################################################################################################################
Section /o "Device SDK: BrainProducts ActiCHamp"
; For BrainProducts ActiCHamp driver
......@@ -996,7 +1045,6 @@ SectionEnd
;##########################################################################################################################################################
SectionGroupEnd
;##########################################################################################################################################################
......@@ -1021,6 +1069,7 @@ Section "Uninstall"
RMDir /r "$INSTDIR\tmp"
RMDir /r "$INSTDIR\pthreads"
RMDir /r "$INSTDIR\enobio3g"
RMDir /r "$INSTDIR\sdk-*"
RMDir /r "$INSTDIR\mcs"
Delete "$INSTDIR\..\scripts\win32-dependencies.cmd"
......@@ -1053,7 +1102,7 @@ Function .onInit
; Note that for logging to work, you will need a logging-enabled build of nsis.
; At the time of writing this, you could get one from http://nsis.sourceforge.net/Special_Builds
LogSet on
; On silent install, we install all components
IfSilent 0 +2
Call EnableOptionals
......
......@@ -16,12 +16,13 @@
;Interface Settings
!define MUI_ABORTWARNING
;Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "..\COPYING"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
......@@ -30,6 +31,8 @@
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;Languages
!insertmacro MUI_LANGUAGE "English"
......@@ -43,6 +46,7 @@
;##########################################################################################################################################################
;##########################################################################################################################################################
Function .onInit
; Note that for logging to work, you will need a logging-enabled build of nsis.
......@@ -66,13 +70,18 @@ has_admin_rights:
StrCpy $INSTDIR $0
${EndIf}
; Make OpenViBE section mandatory
IntOp $0 ${SF_SELECTED} | ${SF_RO}
IntOp $0 $0 | ${SF_BOLD}
SectionSetFlags "Section1" $0
FunctionEnd
;##########################################################################################################################################################
;##########################################################################################################################################################
;##########################################################################################################################################################
Section "-OpenViBE"
Section "!OpenViBE" Section1
LogSet on
......@@ -104,16 +113,16 @@ no_need_to_install_directx:
File ..\dependencies\arch\openvibe-vcredist-2010.exe
File ..\dependencies\arch\lua-5.1.4-vs100.zip
File ..\dependencies\arch\expat-2.0.1.zip
File ..\dependencies\arch\glfw-3.0.4-vs100.zip
; File ..\dependencies\arch\glfw-3.0.4-vs100.zip
File ..\dependencies\arch\gtk-2.22.1-runtime.zip
File ..\dependencies\arch\gtk-themes-2009.09.07.zip
File ..\dependencies\arch\inpout32-vs100.zip
; File ..\dependencies\arch\inpout32-vs100.zip
File ..\dependencies\arch\itpp-4.0.7-runtime.zip
File ..\dependencies\arch\ogre-1.7.1-vs100-runtime.zip
File ..\dependencies\arch\cegui-0.7.2-vs100-runtime.zip
File ..\dependencies\arch\vrpn-7.31-vs100-runtime.zip
File ..\dependencies\arch\pthreads-2.8.0-runtime.zip
File ..\dependencies\arch\presage-0.8.9-vs100.zip
; File ..\dependencies\arch\presage-0.8.9-vs100.zip
File ..\dependencies\arch\openal-1.1-runtime.zip
File ..\dependencies\arch\freealut-1.1.0-bin-runtime.zip
File ..\dependencies\arch\libvorbis-1.3.2-vs100-runtime.zip
......@@ -127,16 +136,16 @@ no_need_to_install_directx:
SetOutPath "$INSTDIR\dependencies"
ZipDLL::extractall "arch\lua-5.1.4-vs100.zip" ""
ZipDLL::extractall "arch\expat-2.0.1.zip" "expat"
ZipDLL::extractall "arch\glfw-3.0.4-vs100.zip" ""
; ZipDLL::extractall "arch\glfw-3.0.4-vs100.zip" ""
ZipDLL::extractall "arch\gtk-2.22.1-runtime.zip" "gtk"
ZipDLL::extractall "arch\gtk-themes-2009.09.07.zip" "gtk"
ZipDLL::extractall "arch\inpout32-vs100.zip" ""
; ZipDLL::extractall "arch\inpout32-vs100.zip" ""
ZipDLL::extractall "arch\itpp-4.0.7-runtime.zip" "itpp"
ZipDLL::extractall "arch\ogre-1.7.1-vs100-runtime.zip" "ogre"
ZipDLL::extractall "arch\cegui-0.7.2-vs100-runtime.zip" "cegui"
ZipDLL::extractall "arch\vrpn-7.31-vs100-runtime.zip" ""
ZipDLL::extractall "arch\pthreads-2.8.0-runtime.zip" "pthreads"
ZipDLL::extractall "arch\presage-0.8.9-vs100.zip" ""
; ZipDLL::extractall "arch\presage-0.8.9-vs100.zip" ""
ZipDLL::extractall "arch\openal-1.1-runtime.zip" "openal"
ZipDLL::extractall "arch\freealut-1.1.0-bin-runtime.zip" "freealut"
ZipDLL::extractall "arch\libvorbis-1.3.2-vs100-runtime.zip" "libvorbis"
......@@ -145,8 +154,8 @@ no_need_to_install_directx:
ZipDLL::extractall "arch\enobio3g-1.2.1-vs100-runtime.zip" ""
SetOutPath "$INSTDIR"
; Export binaries
File /nonfatal /r ..\dist\bin
; Export binaries (except the mensia acquisition dll, it will be installed optionally as part of neurort drivers choice)
File /nonfatal /r /x openvibe-driver-mensia-acquisition.dll ..\dist\bin
; Export launch scripts
File /nonfatal ..\dist\*.cmd
; File /nonfatal /r ..\dist\doc
......@@ -180,15 +189,15 @@ no_need_to_patch_3d_functionnality:
FileWrite $0 "SET PATH=$INSTDIR\dependencies\lua\lib;%PATH%$\r$\n"
FileWrite $0 "SET PATH=$INSTDIR\dependencies\itpp\bin;%PATH%$\r$\n"
FileWrite $0 "SET PATH=$INSTDIR\dependencies\expat\bin;%PATH%$\r$\n"
FileWrite $0 "SET PATH=$INSTDIR\dependencies\glfw\lib\;%PATH%$\r$\n"
; FileWrite $0 "SET PATH=$INSTDIR\dependencies\glfw\lib\;%PATH%$\r$\n"
FileWrite $0 "SET PATH=$INSTDIR\dependencies\gtk\bin;%PATH%$\r$\n"
FileWrite $0 "SET PATH=$INSTDIR\dependencies\inpout32\lib;%PATH%$\r$\n"
; FileWrite $0 "SET PATH=$INSTDIR\dependencies\inpout32\lib;%PATH%$\r$\n"
FileWrite $0 "SET PATH=$INSTDIR\dependencies\itpp\bin;%PATH%$\r$\n"
FileWrite $0 "SET PATH=$INSTDIR\dependencies\cegui\bin;%PATH%$\r$\n"
FileWrite $0 "SET PATH=%OGRE_HOME%\bin\release;%OGRE_HOME%\bin\debug;%PATH%$\r$\n"
FileWrite $0 "SET PATH=%VRPNROOT%\bin;%PATH%$\r$\n"
FileWrite $0 "SET PATH=$INSTDIR\dependencies\pthreads\lib;%PATH%$\r$\n"
FileWrite $0 "SET PATH=$INSTDIR\dependencies\presage\lib;%PATH%$\r$\n"
;FileWrite $0 "SET PATH=$INSTDIR\dependencies\presage\lib;%PATH%$\r$\n"
FileWrite $0 "SET PATH=$INSTDIR\dependencies\openal\libs\Win32;%PATH%$\r$\n"
FileWrite $0 "SET PATH=$INSTDIR\dependencies\freealut\lib;%PATH%$\r$\n"
FileWrite $0 "SET PATH=$INSTDIR\dependencies\libvorbis\win32\bin\release;%PATH%$\r$\n"
......@@ -234,9 +243,39 @@ no_need_to_patch_3d_functionnality:
; AccessControl::GrantOnFile "$INSTDIR" "(S-1-5-32-545)" "GenericRead + GenericWrite + GenericExecute + Delete" ; (BU) user group (builtin users) does not exist on win7. this SID replaces it.
SectionEnd
Section "Mensia NeuroRT drivers" Section2
CreateDirectory "$INSTDIR\dependencies\arch"
SetOutPath "$INSTDIR\dependencies"
NSISdl::download "http://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x86.exe" "arch\vcredist_2013_x86.exe"
Pop $R0 ; Get the return value
StrCmp $R0 "success" +3
MessageBox MB_OK "Download failed: $R0$\nCheck your Internet connection and your firewall settings.$\nNeuroRT driver collection wont be installed...$\n" /SD IDOK
Goto skip_mensia_acquisition
ExecWait '"arch\vcredist_2013_x86.exe" /install /quiet'
SetOutPath "$INSTDIR\dependencies\arch"
File ..\dependencies\arch\sdk-mensia-acquisition-driver-vs120-20150925.zip
SetOutPath "$INSTDIR\dependencies"
ZipDLL::extractall "arch\sdk-mensia-acquisition-driver-vs120-20150925.zip" "$INSTDIR\bin"
skip_mensia_acquisition:
SectionEnd
Section "Uninstall"
RMDir /r $INSTDIR
RMDir /r "$SMPROGRAMS\OpenViBE"
SectionEnd
LangString DESC_Section1 ${LANG_ENGLISH} "The OpenViBE package: Designer, Acquisition Server, drivers, examples, etc."
LangString DESC_Section2 ${LANG_ENGLISH} "Mensia NeuroRT driver library. Adds support for Brain Rhythm 8, Simulator, SmartBCI and Wearable Sensing Dry Sensor Interface. Visual Studio 2013 redistributable will be installed."
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)
!insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment