How launch conditions are useful and how to add one to a setup project ?

Launch conditions are used to pre-validate the target machine on some conditions before the installation of the setup project is started. Validations can include software requirements, registry entries, memory or component search etc. If the validation fails, error messages can be displayed. A launch condition can be added to the launch condition editor in the setup project. The Condition and it’s corresponding error message can be added using the Properties window.

How do I deploy shared components ?

Shared Components such as dlls, controls and resources can be installed using the merge modules (.msm) files. Using merge modules, shared components are packaged and shipped along with the application. On the File menu, point to Add, and then choose New Project. In the Add New Project dialog box, select Setup and Deployment Projects in the Project Type pane, and then choose Merge Module Project in the Templates pane. In the Name box, type Sample. Click OK to close the dialog box. In the File System Editor, select the Module Retargetable Folder. On the Action menu, point to Add and then choose Project Output. In the Add Project Output Group dialog box, select the Primary Output of the class library (dll) project. Click OK to close the dialog box. In the Build menu, choose Build Sample to build the merge module.

How do I add registry entries in a setup project ?

In the Solution explorer window, Select ’Setup project’ and Click on the ’Registry’ editor button at the top of the solution explorer window. In the Registry tree shown in the left pane, add necessary registry keys. In the right pane of the window, Right click and select ’New’ and ’Type’ of the value and enter the name of the value.

How do I pass data between pages in a NavigationWindow ?

In most of the web based applications, there is a need to pass data between pages in order to perform specific tasks. Data can be passed between pages in the NavigationWindow using the overloads of the ‘Navigate()’ method in the ‘NavigationService’ class. The following code snippet is used to pass data from one page to another. [C#] mypage newpage = new mypage(); window1.NavigationService.Navigate(newpage, empid); For this to work, mypage class should contain a constructor defined as follows. [C#] public mypage(string empid) { getempprofile(empid); }

How do I handle Back and Forward button click ?

Back and Forward button click can be handled using the ‘CommandBindings’ property of the ‘NavigationWindows’ class. The following code snippet is used to handle the ’Back’ button click in a NavigationWindow. [C#] //after InitializeComponent() navwindow1.CommandBindings.Add(new CommandBinding(NavigationCommands.BrowseForward, OnBrowseForward)); void OnBrowseBack(object sender, ExecutedRoutedEventArgs args) { MessageBox.Show(‘Back Button is Clicked’); }