From 21bd819e3ecbebf550e1ed0ee106729f6d7543a1 Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 7 Nov 2002 21:54:22 +0000 Subject: [PATCH] Reading output to a variable example git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1614 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/nsExec/test.nsi | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Contrib/nsExec/test.nsi b/Contrib/nsExec/test.nsi index 0eada467..39af6d8f 100644 --- a/Contrib/nsExec/test.nsi +++ b/Contrib/nsExec/test.nsi @@ -4,9 +4,27 @@ OutFile "nsExec Test.exe" ShowInstDetails show -Section +Section "MakeNSIS commands help" nsExec::ExecToLog '"${NSISDIR}\makensis.exe" /CMDHELP' Pop $0 DetailPrint "" DetailPrint " Return value: $0" +SectionEnd + +Section "Output to variable" + ReadEnvStr $0 COMSPEC + GetTempFileName $1 + StrCpy $2 "${NSISDIR}\makensis.exe" + GetFullPathName /SHORT $2 $2 + StrCpy $0 '"$0" /C $2 /VERSION > "$1"' + nsExec::Exec $0 + FileOpen $0 $1 r + FileRead $0 $3 + FileClose $0 + SetDetailsPrint none + Delete $1 + SetDetailsPrint both + DetailPrint "" + DetailPrint "$2 /VERSION returned: $3" + DetailPrint "" SectionEnd \ No newline at end of file