diff --git a/jsreport/jsreport.Embedded/install.ps1 b/jsreport/jsreport.Embedded/install.ps1 index 11e81d2..64ddc91 100644 --- a/jsreport/jsreport.Embedded/install.ps1 +++ b/jsreport/jsreport.Embedded/install.ps1 @@ -128,6 +128,7 @@ if (-Not (Test-Path $jsreport)) { $jsreportPath = join-path $projectDirectory jsreport $installPath = join-path $projectDirectory jsreport/install.cmd $installToolsPath = join-path $toolsPath jsreport/install.cmd +$installModulePath = join-path $toolsPath /install.js if (Test-Path $installPath) { write-Host "Copy " $installToolsPath " to " $jsreportPath @@ -135,10 +136,17 @@ if (Test-Path $installPath) { Push-Location $jsreportPath write-Host "Running " $installPath - & $installPath + & $installPath $installModulePath if ($lastexitcode) { - throw 'Failed to install jsreport from npm, check install-log.txt for details' + write-Host "ERROR Exit code: " $lastexitcode + if ($lastexitcode -eq 87) { + throw 'Empty installModulePath parameter.' + } + if ($lastexitcode -eq 2) { + throw 'installModulePath not found.' + } + throw 'Failed to install jsreport from npm, check install-log.txt for details' } } diff --git a/jsreport/jsreport.Embedded/jsreport/install.cmd b/jsreport/jsreport.Embedded/jsreport/install.cmd index fdb72dd..c0366bd 100644 --- a/jsreport/jsreport.Embedded/jsreport/install.cmd +++ b/jsreport/jsreport.Embedded/jsreport/install.cmd @@ -1,9 +1,17 @@ REM This is being run by the nuget install and also if you run update.cmd, there should be no need to run it manually otherwise +set installScriptPath=%~1 if exist "install.js" ( - "../.bin/node.cmd" install.js -) else ( - "../.bin/node.cmd" "../../packages/jsreport.Embedded.1.0.3/tools/install.js" + "../.bin/node.cmd" install.js + exit /b ) +if "%installScriptPath%" == "" ( + exit /b 87 +) + +if not exist "%installScriptPath%" ( + exit /b 2 +) +"../.bin/node.cmd" "%installScriptPath%" \ No newline at end of file