Sunday, 15 February 2015

visual studio 2010 - How can I validate custom dialog input in a .NET Installer class? -



visual studio 2010 - How can I validate custom dialog input in a .NET Installer class? -

i have vs 2010 setup project. in setup project have custom dialog, , custom action. both work, can debug custom action , receives correctly input user provides in custom dialog.

i validate user input , allow user go next step if input valid. can show messagebox messagebox.show, how can prevent go next step until user corrects input?

public override void install(idictionary statesaver) { base.install(statesaver); string myinput = context.parameters["my_input"]; // value custom dialog if (myinput ..... ) { // not valid input, not want proceed next step messagebox.show("not valid input, please right it"); // here? // how can tell installer not take input? } else { // valid input... } }

thx answers

the simplest method of achieving set property custom action , utilize property status newdialog event called when user press "next" button, event not executed if status not true.

a .net installer class custom action cannot set property straight code, utilize c# code write type of custom action can get/set properties, in example: http://www.advancedinstaller.com/user-guide/qa-c-sharp-ca.html

edit: can editing msi generated vs orca, however, quite painful need edit multiple tables manually, binary, customactions, controlevent. here started that:http://support.microsoft.com/kb/255905 method switch creating setup bundle more advanced setup authoring tool. if want go free , powerful 1 recommend wix (http://wix.sourceforge.net/), take time started way faster editing in orca. commercial alternative, allow edit project faster , much easier advanced installer (http://www.advancedinstaller.com), need enterprise license require accomplish.

visual-studio-2010 installer setup-project

No comments:

Post a Comment