Thursday, April 21, 2005

Creating Visual Studio .Net Setup Projects With Custom User Interfaces and Actions

Given Below is a Problem that one Member of the Sri Lankan Dotnet UserGroup came up with..

"As you all of them aware that we can build setups using setup wizard or setup project in visual studio.NET enviornment. Once we have build a setup and when installing the same, the dialog boxes which directs the
user to successfull installations are fixed in the visual studio.NET envrionment. But we can add additional Read Me, License Agreement, Register User,..etc through the User Interface.
My problem is this, if I need to request additional data from the user while he was installing the application such as Server Name, User Name, Password. how can I do this....
note : - the application which is insalled in the client machine depends on the data which he has entered while he was installing.

(for example : when we are installing SQL Server, Oracle or any other
applications the setup will ask for the Server Name, user name, passwords...like wise I have to do with my setup project)

if anyone know the anwer for this, please help me..!
tks,
Ammar.
"

Here is the answer I came up with

"You can add Dialogs which contain text boxes for the user to input some data for you. Did you notice there are 3 builtin Textbox Dialogs.Namely TextBoxes (A),TextBoxes (B),TextBoxes (C)
You can set the labels for these text boxes and also you can make them visible/invisible using the properties window.

Ok. You now have the information from the user, Now you want to configure your application using this information.

To achieve this you have to add a custom action to your setup.

What differs from the solution given in the c-sharpcorner ????

We're not going to create an Installer Class rather we use a simple executable file (.exe/.dll).
To this executable file we can pass the information we got from the user as arguments. Lets say that you want to pass Information from the Textboxes (A) window to the custom action. Then we set the Custom Actions
Arguments property to [EDITA1], [EDITA2],[EDITA3],[EDITA4] (you must include them in square braces when you are refering to the textboxes exactly as given above also notice that I have included a comma
to separate the arguments)

Since we are not going to use an Installer Class we have to set the Custom Actions InstallerClass Property To False. In the executable file you have to write code to modify your applications configuration file or where you plan to store configuration information.

Lolitha
"

Our friend Prasanna(MVP) gave a solution too....

"You can use the user interface option to create new screen in your
deployment.


But if you want something advanced you can try creating custom actions to
show the UI you want and customizing the setup as per that. Also try out
the following URL on creating custom actions for your setup
http://www.c-sharpcorner.com/Code/2003/Dec/CustomInstallMG.asp

Just try it out and if you face any problems shoot a msg here.

Prasanna(MVP)
"

If any one comes up with such a problem above information will help you to get a solution.

0 Comments:

Post a Comment

<< Home