Archive: Loading Bar and Execwait question?


Loading Bar and Execwait question?
I put “ Execwait “ command in install section, but when the files extract finish and execute program, loading bar can not auto close, so it will be appear two windows together.Is there a way to let loading bar display the files extract finish and auto close itself then run the program?


Well, ExecWait means execute the specified process and wait until finishes, thus is useful if you want during the installation to execute a process and continue.
Probably you should replace it with Exec and add it in function .onInstSuccess instead of section.


Thanks help
Thanks Red Wine, Thanks for your help

But I still have another question ,How do I know use which command when program close then the files can be delete in function .onInstSuccess.


Well, one option is to add the command Delete /REBOOTOK right after the Exec command, e.g.
Exec "$TEMP\my_file.exe"
Sleep 100
Delete /REBOOTOK "$TEMP\my_file.exe"
Another option, hide installer window and use ExecWait, e.g.
HideWindow
ExecWait "$TEMP\my_file.exe"
Delete "$TEMP\my_file.exe"


The program can not run ...
OutFile "App.exe"
Caption "Loading..."
Section
DetailPrint 'Initializing...'
Sleep 500
Sleep 500
DetailPrint 'Loading Graphics...'
Sleep 500
Sleep 500
DetailPrint 'Finalizing...'
Sleep 500
Sleep 500
SetDetailsPrint None

SetOutPath $Temp\ABC
File "AAA.dll"
File "BBB.dat"
File " App.exe "

SectionEnd

Subcaption 3 " "
XPStyle on
AutoCloseWindow true
ChangeUI all "${NSISDIR}\Contrib\UIs\LoadingBar.exe"

Function .onInstSuccess

Exec "$INSTDIR\ App.exe "

FunctionEnd

My question is when user close the program then how can let these files will be delete automatically. If put delete command in Function .onInstSuccess ,the program can not run


You're extracting these 3 files in $TEMP and then you execute a file from $INSTDIR, is this correct? Anyway, probably you don't need the callback at all.
Extract the files in $PLUGINSDIR and add a last hidden section where you should hide installer (HideWindow) and ExecWait "$PLUGINSDIR\App.exe"
That's all


Thanks Red Wine
Thank you for help
I have try , very success