hi all,i am a newbie in NSIS.i want to exec a Batch file(such as a java ant command) background,let the cmd window minimize.how to do it in NSIS?
thanks
how to execute Batch background?
7 posts
ExecShell "open" "program.exe" "" "SW_SHOWMINIMIZED" Replace "program.exe" with your program file name.OR
If want the details about the operation to appear when installing (but not its window), you can use the plugin nsExec:
nsExec::Exec "program.exe" thank you.
i use
Execwait '$INSTDIR\loannewetna.bat $INSTDIR\build upgrade.xml $INSTDIR\loadresult.txt'
in my .nsi file,it works.
but when i use :
ExecShell "open" "$INSTDIR\loannewetna.bat" "$INSTDIR\build upgrade.xml $INSTDIR\loadresult.txt" "SW_SHOWMINIMIZED"
nothing happens.
here $INSTDIR\build upgrade.xml $INSTDIR\loadresult.txt are parameters to this batch.can you tell me why?
best regards
i use
Execwait '$INSTDIR\loannewetna.bat $INSTDIR\build upgrade.xml $INSTDIR\loadresult.txt'
in my .nsi file,it works.
but when i use :
ExecShell "open" "$INSTDIR\loannewetna.bat" "$INSTDIR\build upgrade.xml $INSTDIR\loadresult.txt" "SW_SHOWMINIMIZED"
nothing happens.
here $INSTDIR\build upgrade.xml $INSTDIR\loadresult.txt are parameters to this batch.can you tell me why?
best regards
I recommend you not to rely on ExecShell, use nsExec.
en ,i use nsExec::Exec like this ,also nothing happens
thanks again🙂
nsExec::Exec "$INSTDIR\bin\upgrade.bat loadGenerationXMLData" can you tell me the difference between nsExec::Exec,Execwait and ExecShell.thanks again🙂
this should work... [if the path is correct]
nsExec::Exec '"$INSTDIR\bin\upgrade.bat" loadGenerationXMLData'
nsExec::Exec '"$INSTDIR\bin\upgrade.bat" loadGenerationXMLData'
thank you,it can works now🙂