I need to run a MSI-file (Microsoft Installer) from my application and I want my application to wait until the installation has been finished.
Waitrun() and Winexec() cannot be used since they don't work with a MSI-file.
So I try to use ShellExecute()
This is the code :
- Code: Select all Expand view
- ShellExecute(,"Open","MSXML.MSI",,,3)
SYSWAIT(5)
DO WHILE .T.
hFile := FOPEN("MSXML"+IF(IsWin7(),"6","4")+".MSI",FO_READWRITE + FO_EXCLUSIVE)
IF FERROR() <> 0
SYSREFRESH()
SLEEP(1)
LOOP
ENDIF
FCLOSE(hFile)
EXIT
SYSREFRESH()
ENDDO
Unfortunately, my application doesn't wait until the installation has been finished.
How can I solve this problem?
Thanks you.