Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Custom Action Return Value


4 replies to this topic

MetinSenkal

MetinSenkal
  • Members
  • 15 posts

Posted 02 July 2001 - 09:09

I am using IPWI 2.03, is there an easy way to handle return values of CAs, without using install script?

Instead of displaying error message "Internal Error bla,bla...." i want to display in a message box a message which is more meaningful for a customer.
BUut how can I get which value ERROR_SUCCESS or ERROR_INSTALL_FAILURE that  CA returns?

I don't know much about Install Script,so i am looking for an easy way to do it in InstallShield.


MetinSenkal

MetinSenkal
  • Members
  • 15 posts

Posted 06 July 2001 - 23:05

I have a little bit solve my problem. I use install script, and call LaunchAppAndWait function.

And i check its return value, in the help documents it says it returns <0 when the app was not launched successfully, and returns 1 means app was launched successfully.

I need to run osql.exe with some sql scripts, application launches successfully and creates databases on the server and LaunchAppAndWait returns zero. I displayed its return value in a message box, and it was zero and i couldn't understand why it returns zero.

But my main question is LaunchAppAndWait controls window handle of the application. I need to check if application's  return value (in my case, osql.exe's)
Although application creates window but doesn't create databases due to some error (for example script file is missing) LaunchAppAndWait returns zero, same as above.

When I use InstallShields CustomActionWizard, returns internal failures when above error (missing script file) occurs.

I do not care if my application creates window or not, i do want to know that it successfully creates the database or there was an error. How can I do this?

Thanks,
Metin SENKAL


Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 07 July 2001 - 06:09

If you use the extended version of LaunchAppAndWait, from the IS5/6 Samples, one of the parameters it takes is an integer receives the return value of the application that is being called.

Another option for creating SQL databases is to do it through VBScript, using the SQLDMO objects.  If the error checking is done as part of the VBScript, it will give you a lot more options over checking the return code from OSQL.


MetinSenkal

MetinSenkal
  • Members
  • 15 posts

Posted 09 July 2001 - 07:23

As I said, i am using ISWI 2.03, i haven't got IS5/6 samples, and i searched for that extended version of LaunchAppAndWait in the help documents, i couldn't find any related links.

And i don't know how to use SQLDMO objects, but l would like to learn. Can you offer me some good links, Leigh?

Thanks,
Metin SENKAL


Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 10 July 2001 - 00:25

Sorry, I should have been more specific.  The IS5/6 samples I was talking about are the ones available on this site.  Expand that section, then look under External Programs and Shell.

If you would like to try SQLDMO, the best reference that I've found so far is the Microsoft SQL Server Books Online.  Failing that, there is plenty of information available on the Microsoft site.