Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Reg: Registarion Key check and Roll back
 

Reg: Registarion Key check and Roll back

Hi

My project setup is required to validate registration key by connecting remote server. If entr key is not valid then i have to roll back the project.

To connecting remote server and key validationI have return some code in Installer class.Key Validation is working perfectly. But if key is not matching then iamusing roll back method.

While installtalling time if i enter wrong key also all the files copying into system it is not roll backing.

Custom action[Key checking]] also firingat the end ofinstallation. If any body have the better solution for this please help me.

Regards

Hanu

Hanumantha Rao. Evuri  Friday, July 20, 2007 5:09 AM

Hi, contacthanu,

It seems that calling RollBack method will not invoke the roll back process, and this method is called when the Setup is in Rolling Back process.

However, you can throw an InstallException to causethe Setupto roll back.

Please check the following sample.

Code Snippet

public override void Install(IDictionary savedState)

{

base.Install(savedState);

regForm form = new regForm();// You can add your validation codes here.

form.ShowDialog();

if (form.rollback == true)

{

this.Dispose();

throw new InstallException("Reg code incorrect");

}

else if (form.rollback == false)

{

System.Windows.Forms.MessageBox.Show("Install");

}

}

public override void Rollback(IDictionary savedState)

{

base.Rollback(savedState);

}

Hi, contacthanu,

It seems that calling RollBack method will not invoke the roll back process, and this method is called when the Setup is in Rolling Back process.

However, you can throw an InstallException to causethe Setupto roll back.

Please check the following sample.

Code Snippet public override void Install(IDictionary savedState)

{

base.Install(savedState);

regForm form = new regForm();// You can add your validation codes here.

form.ShowDialog();

if (form.rollback == true)

{

this.Dispose();

throw new InstallException("Reg code incorrect");

}

else if (form.rollback == false)

{

System.Windows.Forms.MessageBox.Show("Install");

}

}

public override void Rollback(IDictionary savedState)

{

base.Rollback(savedState);

}

You can use google to search for other answers

Custom Search

More Threads

• Packaging ActiveX in CAB using C#
• c:\programs files\"application name" in vb.net setup
• Patching dll files with ClickOnce
• create vb.net setup project that will install database on a server and the application on client side
• Cannot find Application Data file when trying to open digital photo file
• Windows Error while running under ClickOnce - runs fine as stand alone app
• Is it not possible to change the name of a ClickOnce app after installed on a computer?
• clickonce 'app cannot be started' error: why no details?
• NANT MSI customaction for Installer.cs class methods
• Setup project with custom actions