Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 4cf17b83 authored by hhakim's avatar hhakim
Browse files

Update faust.nsi and pyfaust.demo to retrieve demo data folder in different...

Update faust.nsi and pyfaust.demo to retrieve demo data folder in different situations: install from nsis package, install from pip package on windows.

The pip windows package is coming next.
parent 38ff7991
No related branches found
No related tags found
No related merge requests found
...@@ -122,6 +122,14 @@ Section "" ; no component so name not needed ...@@ -122,6 +122,14 @@ Section "" ; no component so name not needed
File @PROJECT_BINARY_DIR@\wrapper\python\*pyd File @PROJECT_BINARY_DIR@\wrapper\python\*pyd
File @PROJECT_BINARY_DIR@\wrapper\python\*pxd File @PROJECT_BINARY_DIR@\wrapper\python\*pxd
;add data path in __init__.py
FileOpen $1 "$2\pyfaust\__init__.py" a
; go at the end of file (but with append mode is that necessary ?)
FileSeek $1 0 END
; add the install path
FileWrite $1 "$\r$\n_NSI_INSTALL_PATH='$INSTDIR'"
FileClose $1
; post install matfaust auto-setup ; post install matfaust auto-setup
!include "FileFunc.nsh" ; for Locate !include "FileFunc.nsh" ; for Locate
!include "WordFunc.nsh" ; for WordFind !include "WordFunc.nsh" ; for WordFind
......
...@@ -10,7 +10,16 @@ DEFT_FIG_DIR = 'pyfaust_demo_figures' ...@@ -10,7 +10,16 @@ DEFT_FIG_DIR = 'pyfaust_demo_figures'
def get_data_dirpath(): def get_data_dirpath():
from pkg_resources import resource_filename from pkg_resources import resource_filename
import os.path import os.path
from os import sep
path = resource_filename(__name__, 'data') path = resource_filename(__name__, 'data')
if (sys.platform == 'win32' and not os.path.exists(path)):
from pyfaust import _NSI_INSTALL_PATH
# in windows nsis based installation the data can be anywhere
# users choose to install faust
# the nsi installer is responsible to set this const var
# at installation stage
# in this case, matlab is inst so point to its data dir
path = _NSI_INSTALL_PATH+sep+'matlab'+sep+'data'
if(not os.path.exists(path)): if(not os.path.exists(path)):
# fallback to matlab wrapper data # fallback to matlab wrapper data
# it will not help if we are from pip pkg # it will not help if we are from pip pkg
...@@ -1188,5 +1197,3 @@ if sys.platform == 'win32': ...@@ -1188,5 +1197,3 @@ if sys.platform == 'win32':
else: else:
timer = time timer = time
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment