Mentions légales du service

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

Update windows nsis installer to download FAµST external data with powershell...

Update windows nsis installer to download FAµST external data with powershell as a fallback solution when python was not found.
parent 6ab7ab4f
Branches
No related tags found
No related merge requests found
...@@ -132,13 +132,23 @@ Section "" ; no component so name not needed ...@@ -132,13 +132,23 @@ Section "" ; no component so name not needed
; add the install path ; add the install path
FileWrite $1 "$\r$\n_NSI_INSTALL_PATH='$INSTDIR'" FileWrite $1 "$\r$\n_NSI_INSTALL_PATH='$INSTDIR'"
FileClose $1 FileClose $1
;
; download data into matlab wrapper data folder ; download data into matlab wrapper data folder
; create data folder ; create data folder
; try with python first
${StrRep} '$3' $INSTDIR '\' '\\' ${StrRep} '$3' $INSTDIR '\' '\\'
Exec "python -c $\"from os import mkdir; mkdir('$3\\matlab\\data')$\"" Exec "python -c $\"from os import mkdir; mkdir('$3\\matlab\\data')$\""
; download data ; download data
Exec "python $2\pyfaust\datadl.py $\"$INSTDIR\matlab\data$\"" Exec "python $2\pyfaust\datadl.py $\"$INSTDIR\matlab\data$\""
IfErrors 0 after_data_dl
MessageBox MB_OK "Downloading FAuST data with python has failed, now trying with powershell."
ClearErrors
ExecWait "powershell Invoke-WebRequest $\"@REMOTE_DATA_URL@/@REMOTE_DATA_FILE@$\" -O $\"$TEMP\@REMOTE_DATA_FILE@$\"" ; ExecWait because unzipping needs download finished
Exec "powershell Expand-Archive -Force $\"$TEMP\@REMOTE_DATA_FILE@$\" '$INSTDIR\matlab\data'" ; output folder data is created auto. ; simple quote used to avoid powershell to think there is two arguments when we meant one argument for the dest. path (double quote doesn't allow that).
IfErrors 0 after_data_dl
MessageBox MB_OK "Error downloading FAuST data. You'll need to download manually (please check the documentation)." IDOK after_data_dl
after_data_dl:
; post install matfaust auto-setup ; post install matfaust auto-setup
!include "FileFunc.nsh" ; for Locate !include "FileFunc.nsh" ; for Locate
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment