Skip to content
⌘ NSIS Forum Archive

Call ExecDos using CallInstDll

5 posts

Kerzh#

Call ExecDos using CallInstDll

Good evening.

How to call ExecDos::exec using CallInstDll?

I'm trying

Push '/NOUNLOAD /ASYNC "C:\Projects\test\stdtest\project2.exe"'
CallInstDll "C:\Program Files\ExecDos\execdos.dll" "exec"

But it doesn't work.

Thank you.
Takhir#
Usage sample included to execdos.zip. Just write:

ExecDos::exec /NOUNLOAD /ASYNC "C:\Projects\test\stdtest\project2.exe" "" ""
Pop $9
...
ExecDos:wait $9
When building the installer dll must be in the program files\nsis\plugins folder.
Kerzh#
Sorry, but this is not what i meant.

I have to dynamically define path with execdos.dll.
So i want to use callinstdll.
Can i do this?
Takhir#
For dll in the $EXEDIR (re-worked Example.nsi, push CL parameters to stack beginning the last param)

DetailPrint "Executing console application"
; async launch
Push "$EXEDIR\stdout.txt"
Push "test_login$\ntest_pwd$\n"
Push "$EXEDIR\consApp.exe"
Push /ASYNC
Push /TIMEOUT=5000
CallInstDLL "$EXEDIR\ExecDos.dll" /NOUNLOAD exec
Pop $0 ; thread handle for 'wait'

; you can add installation code here, for example
Sleep 1000
DetailPrint "Installing Software"
Sleep 1000
DetailPrint "Installing More Software"
Sleep 1000

; time to check process exit code (optional)
Push $0
CallInstDLL "$EXEDIR\ExecDos.dll" wait
Pop $0 ; return value - process exit code or error or STILL_ACTIVE (0x103).
MessageBox MB_OK "Exit code $0"