Click here to Skip to main content
16,015,094 members

Comments by Pooja Kharape (Top 3 by date)

Pooja Kharape 26-Dec-12 0:56am View    
Hi Subrahmanyam,
Like you am too new to setup and deployment type of programming.Am also facing same problem. Have you got any solution for the same...I hope you must have...
Pooja Kharape 25-Dec-12 6:56am View    
protected override void OnBeforeInstall(IDictionary savedState)
{
MessageBox.Show("OnBeforeInstall");
base.OnBeforeInstall(savedState);
error_msg = "";
try
{

string cd_key;
cd_key = Context.Parameters["PathValue"];
if (cd_key == "")
{
error_msg = "Enter Cd key to proceed further";
this.Rollback(savedState);
}
else
{
string str = "Select isnull(mac_id,'') as mac_id,cd_key,isnull(is_installed,0) as is_installed from tblInstallationMaster where cd_key='" + cd_key + "' and is_active=1";
try
{
ConnectionOpen();
}
catch (Exception ex)
{

error_msg = "You are not online. Net Connection problem";
this.Rollback(savedState);
}

if (string.IsNullOrEmpty(error_msg))
{
SqlCommand cmd = new SqlCommand(str, conn);

SqlDataReader dr = cmd.ExecuteReader();
bool has_rows = false;
string mac_id = "";
int is_installed = 1;
if (dr.HasRows)
{
dr.Read();
is_installed = int.Parse(dr["is_installed"].ToString());
mac_id = dr["mac_id"].ToString();
has_rows = true;
}
cmd = null;
ConnectionClose();
if (!has_rows)
{
error_msg = "Incorrect CD key";
this.Rollback(savedState);

}
else
{
if (string.IsNullOrEmpty(mac_id))
{

this.Install(savedState);

}
else if (mac_id == ConnectionClass.GetMACAddress())
{
// UpdateInstallationMaster();
if (is_installed == 0)
{
this.Install(savedState);

}
else
{

error_msg = "CD already Installed on your PC";
this.Rollback(savedState);

}

}
else
{
//MessageBox.Show("CD already Installed on " + mac_id);
error_msg = "CD already Installed on " + mac_id;
this.Rollback(savedState);

}
}
}
}
}
catch
{
MessageBox.Show(error_msg);
}
}
public override void Rollback(IDictionary savedState)
{ try
{
MessageBox.Show(error_msg);
base.Rollback(savedState);
}
catch
{
MessageBox.Show(error_msg);
}
}
Pooja Kharape 25-Dec-12 6:53am View    
Deleted
public override void Rollback(IDictionary savedState)
{
try
{
MessageBox.Show("In rollback");
MessageBox.Show(error_msg);
base.Rollback(savedState);
//savedState.Clear();
}
catch
{
MessageBox.Show(error_msg);
}





}

protected override void OnBeforeInstall(IDictionary savedState)
{
MessageBox.Show("OnBeforeInstall---1");
base.OnBeforeInstall(savedState);

error_msg = "";
try
{
MessageBox.Show("OnBeforeInstall---2");

string cd_key;

cd_key = Context.Parameters["PathValue"];
if (cd_key == "")
{

MessageBox.Show("Enter Cd key to proceed further");
error_msg = "Enter Cd key to proceed further";

this.Rollback(savedState);
}
else
{


string str = "Select isnull(mac_id,'') as mac_id,cd_key,isnull(is_installed,0) as is_installed from tblInstallationMaster where cd_key='" + cd_key + "' and is_active=1";
try
{
ConnectionOpen();
}
catch (Exception ex)
{
MessageBox.Show("You are not online. Net Connection problem");

error_msg = "You are not online. Net Connection problem";

}

if (string.IsNullOrEmpty(error_msg))
{
SqlCommand cmd = new SqlCommand(str, conn);

SqlDataReader dr = cmd.ExecuteReader();
bool has_rows = false;
string mac_id = "";

int is_installed = 1;
if (dr.HasRows)
{
dr.Read();
is_installed = int.Parse(dr["is_installed"].ToString());
mac_id = dr["mac_id"].ToString();
has_rows = true;
}

cmd = null;
ConnectionClose();
if (!has_rows)
{
error_msg = "Incorrect CD key";
this.Rollback(savedState);
}
else
{


if (string.IsNullOrEmpty(mac_id))
{

this.Install(savedState);

}
else if (mac_id == ConnectionClass.GetMACAddress())
{

if (is_installed == 0)
{
this.Install(savedState);

}
else
{
error_msg = "CD already Installed on your PC";
//MessageBox.Show("CD already Installed on your PC");
this.Rollback(savedState);

}

}
else
{
error_msg = "CD already Installed on " + mac_id;
//MessageBox.Show("CD already Installed on " + mac_id);
this.Rol