View Full Version : Shell.Execute problem
Hi to all.
I have a question regarding the Shell.Execute function. I use the function to start the installation of an application. But how can I determine if the install ends correctly or has been aborted?
Thanks.
Xry
IdeasVacuum
10-25-2009, 05:38 PM
Take a look at the help for File.Run
jassing
10-25-2009, 07:39 PM
You would need to evaluate two things:
1) Application.GetLastError()
2) The return value when using WaitForReturn = true.
As suggested, I would use File.Run() instead of Shell.Execute(), not that there is a big difference, but a subtle one...
Now, that you have those two values -- the problem is, does the installer you're spawning return an error code? If it doesn't, or it's not documented (ie: 0 = success, 1 = user caneled, 2 = install aborted, 3 = missing file etc) then you have to experiment to determine if the installer succeeded or not.
As suggested, I would use File.Run() instead of Shell.Execute(), not that there is a big difference, but a subtle one...
I've used Shell.Execute because the help suggests to use this instead of File.Run, but I'll try with the last.
Now, that you have those two values -- the problem is, does the installer you're spawning return an error code? If it doesn't, or it's not documented (ie: 0 = success, 1 = user caneled, 2 = install aborted, 3 = missing file etc) then you have to experiment to determine if the installer succeeded or not.
Yes, naturally, this depends of what the external installer returns. I need working on these. Thanks.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.