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

How to set errors?


2 replies to this topic

Poll: Do you know the answer?

Do you know the answer?

You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.
Vote Guests cannot vote

s26f84

s26f84
  • Full Members
  • 5 posts

Posted 14 January 2008 - 23:11

Hi All

I have a C# application which checks the locale of the system and runs the particular SQL server installer using the following code:

CODE

try{
System.Diagnostics.Process installProcess = new System.Diagnostics.Process();
installProcess.StartInfo.FileName = installApp;
installProcess.StartInfo.Arguments = installArgs;

// Start the SQL Express installed
installProcess.Start();

// Wait for the SQl Express installer to complete
installProcess.WaitForExit();

// Check for sucessful completion
return (installProcess.ExitCode == 0) ? true : false;
}Catch (Exception)
{
// sets the environment exit code to 1935 but it does not work
System.Environment.ExitCode = 1935;
}


the problem is tht exception handling is not working and i have following issues:
1. when there is error in SQL installer my C# application keeps on waiting for the installer to exit.
2. if it fails i want that the prerequisite dialog (installshield) knows there is error and exits the installation.

it would be great if someone can shed some light on the above issues. you time is highly appreciated
thanks
sunny

Edited by s26f84, 20 January 2008 - 22:26.


MrSensitive

MrSensitive
  • Full Members
  • 9 posts

Posted 18 January 2008 - 11:37

First; the angry face isn't really a good motivator for getting replies..

why don't you just include the SQL express merge module in your project?


s26f84

s26f84
  • Full Members
  • 5 posts

Posted 20 January 2008 - 23:24

QUOTE (MrSensitive @ 2008-01-18 11:37)
First; the angry face isn't really a good motivator for getting replies..

why don't you just include the SQL express merge module in your project?

changed the post icon smile.gif and thanks alot for replying.


http://msdn2.microso...y/ms345154.aspx

according to msdn merge module is not supported by sql server 2005 express edition. sad.gif

the oonly wayout is could see was the one i have implemented. i have tested my application. it works fine but when error occurs, it sets System.Environment.ExitCode, which is not working in installshield.

please help me in understandin how to set the errors in c#, which can be seen by installshield. so that i can halt the installation if any error occurs during execution of my application.

waitin for reply again...