<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://live.mscommunity.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">NotEqu&amp;#39;s Blog</title><subtitle type="html" /><id>http://live.mscommunity.net/blogs/notequ/atom.aspx</id><link rel="alternate" type="text/html" href="http://live.mscommunity.net/blogs/notequ/default.aspx" /><link rel="self" type="application/atom+xml" href="http://live.mscommunity.net/blogs/notequ/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20611.960">Community Server</generator><updated>2008-06-05T12:36:00Z</updated><entry><title>Warning the User when Caps Lock is On</title><link rel="alternate" type="text/html" href="http://live.mscommunity.net/blogs/notequ/archive/2008/06/19/warning-the-user-when-caps-lock-is-on.aspx" /><id>http://live.mscommunity.net/blogs/notequ/archive/2008/06/19/warning-the-user-when-caps-lock-is-on.aspx</id><published>2008-06-19T07:47:03Z</published><updated>2008-06-19T07:47:03Z</updated><content type="html">&lt;p&gt;&lt;a href="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/WarningtheUserwhenCapsLockisOn_E140/image_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="251" alt="image" src="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/WarningtheUserwhenCapsLockisOn_E140/image_thumb.png" width="524" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160; If you need to build really cool login page, warning the user when caps lock is on can be really great trick. You can see the details and a few more tricks on Scott Mitchell article on 4 Guys From Rolla.com.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://aspnet.4guysfromrolla.com/articles/051408-1.aspx" href="http://aspnet.4guysfromrolla.com/articles/051408-1.aspx"&gt;http://aspnet.4guysfromrolla.com/articles/051408-1.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://live.mscommunity.net/aggbug.aspx?PostID=3879" width="1" height="1"&gt;</content><author><name>NotEqu</name><uri>http://live.mscommunity.net/members/NotEqu.aspx</uri></author><category term="ASP .NET" scheme="http://live.mscommunity.net/blogs/notequ/archive/tags/ASP+.NET/default.aspx" /><category term="C#" scheme="http://live.mscommunity.net/blogs/notequ/archive/tags/C_2300_/default.aspx" /></entry><entry><title>Source Code Outliner Power Toy</title><link rel="alternate" type="text/html" href="http://live.mscommunity.net/blogs/notequ/archive/2008/06/17/source-code-outliner-power-toy.aspx" /><id>http://live.mscommunity.net/blogs/notequ/archive/2008/06/17/source-code-outliner-power-toy.aspx</id><published>2008-06-17T13:36:40Z</published><updated>2008-06-17T13:36:40Z</updated><content type="html">&lt;p&gt;The Source Code Outliner Power Toy is a Visual Studio extension that gives you a tree view of source code&amp;#39;s types and members and lets you quickly navigate to them inside the editor. This is great if you are dealing with large code files.&lt;/p&gt;  &lt;p&gt;You can download it from here:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://codeplex.com/SourceCodeOutliner" href="http://codeplex.com/SourceCodeOutliner"&gt;http://codeplex.com/SourceCodeOutliner&lt;/a&gt;&lt;/p&gt;&lt;img src="http://live.mscommunity.net/aggbug.aspx?PostID=3870" width="1" height="1"&gt;</content><author><name>NotEqu</name><uri>http://live.mscommunity.net/members/NotEqu.aspx</uri></author><category term="Visual Studio" scheme="http://live.mscommunity.net/blogs/notequ/archive/tags/Visual+Studio/default.aspx" /></entry><entry><title>PowerCommands 1.1 for Visual Studio 2008</title><link rel="alternate" type="text/html" href="http://live.mscommunity.net/blogs/notequ/archive/2008/06/10/powercommands-1-1-for-visual-studio-2008.aspx" /><id>http://live.mscommunity.net/blogs/notequ/archive/2008/06/10/powercommands-1-1-for-visual-studio-2008.aspx</id><published>2008-06-10T09:42:03Z</published><updated>2008-06-10T09:42:03Z</updated><content type="html">&lt;p&gt;&lt;a href="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/PowerCommandsforVisualStudio2008_CB5A/PowerCommands_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;margin:0px 0px 0px 15px;border-right-width:0px;" height="244" alt="PowerCommands" src="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/PowerCommandsforVisualStudio2008_CB5A/PowerCommands_thumb.jpg" width="239" align="right" border="0" /&gt;&lt;/a&gt;&amp;#160;&amp;#160; Few months ago Microsoft released a set of useful extensions for the Visual Studio 2008. Here is a list of functions from version 1.1: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Collapse Project&lt;/strong&gt; - collapses a hierarchy in the solution explorer starting from the root selected node. It can be executed from three different places: solution, folders and project nodes respectively &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Copy Class&lt;/strong&gt; - copies a selected class entire content to the clipboard. It can be executed from a single project item or a project item with dependent sub items &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Paste Class&lt;/strong&gt; - pastes a class entire content from the clipboard. It can be executed from a project or folder node &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Copy References&lt;/strong&gt; - copies a reference or set of references to the clipboard. It can be executed from the references node, a single reference node of set of reference nodes &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Paste References&lt;/strong&gt; - pastes a reference or set of references from the clipboard. It can be executed from different places depending on the type of project. For C# projects it can be executed from references node. For VB and Website projects it can be executed from the project node &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Copy As Project Reference&lt;/strong&gt; - copies a project as a project reference to the clipboard. It can be executed from a project node &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Edit Project File&lt;/strong&gt; - opens the MSBuild project file for a selected project inside Visual Studio. It can be executed from a project node &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Open Containing Folder&lt;/strong&gt; - opens a Windows Explorer window pointing to the physical path of a selected item. It can be executed from a project item node &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Open Command Prompt&lt;/strong&gt; - opens a Visual Studio command prompt pointing to the physical path of a selected item. It can be executed from four different places: solution, project, folder and project item nodes respectively &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Unload Projects&lt;/strong&gt; - unloads all projects in a solution. It can be executed from the solution node &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Reload Projects&lt;/strong&gt; - reloads all unloaded projects in a solution. It can be executed from the solution node &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Remove and Sort Usings&lt;/strong&gt; - removes and sort using statements for all classes given a project. It can be executed from a solution node or a single project node.      &lt;br /&gt;&lt;strong&gt;Note:&lt;/strong&gt; The Remove and Sort Usings feature is only available for C# projects since the C# editor implements this feature as a command in the C# editor (which this command calls for each .cs file in the project). The Visual Basic IDE implements this functionality for Imports in an interactive way: Project properties, go to the References tab, then click the Unused References... button, then select which references you want removed via a listbox&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You can (must) download the PowerCommands for Visual Studio 2008 from:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=PowerCommands&amp;amp;ReleaseId=559" href="http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=PowerCommands&amp;amp;ReleaseId=559"&gt;http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=PowerCommands&amp;amp;ReleaseId=559&lt;/a&gt;&lt;/p&gt;&lt;img src="http://live.mscommunity.net/aggbug.aspx?PostID=3784" width="1" height="1"&gt;</content><author><name>NotEqu</name><uri>http://live.mscommunity.net/members/NotEqu.aspx</uri></author><category term="Visual Studio" scheme="http://live.mscommunity.net/blogs/notequ/archive/tags/Visual+Studio/default.aspx" /></entry><entry><title>Installer class</title><link rel="alternate" type="text/html" href="http://live.mscommunity.net/blogs/notequ/archive/2008/06/05/installer-class.aspx" /><id>http://live.mscommunity.net/blogs/notequ/archive/2008/06/05/installer-class.aspx</id><published>2008-06-05T10:36:00Z</published><updated>2008-06-05T10:36:00Z</updated><content type="html">&lt;p&gt;&amp;nbsp; If you want to build your own setup project for any kind of application, it is good to know something about &lt;strong&gt;installer classes&lt;/strong&gt;. I will make a little example to show you how to pass the value from custom setup dialogs to installer class.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; First you add installer class into your project or you can make new project just for installer classes inside your solution. I made widows form application and added &lt;em&gt;installer1.cs&lt;/em&gt; into my application.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika1_2.jpg"&gt;&lt;img style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height="542" alt="Slika1" src="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika1_thumb.jpg" width="653" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Next, open design window for &lt;em&gt;installer1.cs&lt;/em&gt; and in properties window on Events tab choose event you would like to override. In this case let&amp;#39;s choose &lt;strong&gt;AfterInstall&lt;/strong&gt; event.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika2_2.jpg"&gt;&lt;img style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height="319" alt="Slika2" src="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika2_thumb.jpg" width="334" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; You will see empty method that look&amp;#39;s like this:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Installer1_AfterInstall(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, InstallEventArgs e)
{&lt;/pre&gt;&lt;pre class="csharpcode"&gt;}&lt;/pre&gt;
&lt;p&gt;&amp;nbsp; Add setup project to your solution. Because my installer class is in windows form project, all I have to do is open &lt;strong&gt;File System&lt;/strong&gt; of my setup project and add primary output to &lt;strong&gt;Application Folder&lt;/strong&gt;. Then open &lt;strong&gt;User Interface&lt;/strong&gt; and add dialog you need. I added RadioButtons (3 buttons) and Textboxes (A) for my example. You can change order of dialogs just by dragging them up and down. This will be the order they will show during the installation.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika3_2.jpg"&gt;&lt;img style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height="304" alt="Slika3" src="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika3_thumb.jpg" width="302" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp; Open properties window for RadioButtons dialog and enter text and values for radio buttons now:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika4_2.jpg"&gt;&lt;img style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height="295" alt="Slika4" src="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika4_thumb.jpg" width="311" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp; Open properties window for Textboxes dialog. This dialog consists four text boxes and because I only need two, I will set visible property to true for the first two text boxes and false for the rest of them:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika5_2.jpg"&gt;&lt;img style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height="398" alt="Slika5" src="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika5_thumb.jpg" width="303" border="0" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Then open &lt;strong&gt;Custom Actions&lt;/strong&gt; and add custom action you need. For this example we only need action &lt;em&gt;OnInstall&lt;/em&gt;. Right click on &lt;strong&gt;Install&lt;/strong&gt; folder and choose &lt;strong&gt;Add Custom Action&lt;/strong&gt;. Then choose &lt;strong&gt;Application folder&lt;/strong&gt; and select the primary output. You can rename it if you wish. I call it OnInstall.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika6_2.jpg"&gt;&lt;img style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height="276" alt="Slika6" src="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika6_thumb.jpg" width="300" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp; Now we need to pass the values from custom dialogs to installer class. From the previous pictures you can see that RadioButtons dialog has property called ButtonProperty witch value is BUTTON3. BUTTTON3 represents the value we chosen with radio buttons. Open properties window for OnInstall action and for CustomActionData enter:&lt;/p&gt;
&lt;p&gt;/TEST=[BUTTON3] /FNAME=[EDITA1] /LNAME=[EDITA2] /PATH=&amp;quot;[TARGETDIR]\&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; We sad that BUTTON3 is the value of radio button we chose. EDITA1 and EDITA2 represents the value for text boxes. We have three parameters (TEST, FNAME and LNAME) which will we use to get to this values from installer class.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika7_2.jpg"&gt;&lt;img style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height="218" alt="Slika7" src="http://blogs.mscommunity.net/blogs/notequ/WindowsLiveWriter/Installerklase_BDEE/Slika7_thumb.jpg" width="270" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp; In &lt;em&gt;Installer1_AfterInstall&lt;/em&gt; method we will now enter some code to do something with values from setup project:&lt;/p&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Installer1_AfterInstall(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, InstallEventArgs e)
{
    &lt;span class="kwrd"&gt;string&lt;/span&gt; myPassedValue = &lt;span class="kwrd"&gt;this&lt;/span&gt;.Context.Parameters[&lt;span class="str"&gt;&amp;quot;TEST&amp;quot;&lt;/span&gt;];
    &lt;span class="kwrd"&gt;string&lt;/span&gt; fName = &lt;span class="kwrd"&gt;this&lt;/span&gt;.Context.Parameters[&lt;span class="str"&gt;&amp;quot;FNAME&amp;quot;&lt;/span&gt;];
    &lt;span class="kwrd"&gt;string&lt;/span&gt; lName = &lt;span class="kwrd"&gt;this&lt;/span&gt;.Context.Parameters[&lt;span class="str"&gt;&amp;quot;LNAME&amp;quot;&lt;/span&gt;];
    &lt;span class="kwrd"&gt;string&lt;/span&gt; path = &lt;span class="kwrd"&gt;this&lt;/span&gt;.Context.Parameters[&lt;span class="str"&gt;&amp;quot;PATH&amp;quot;&lt;/span&gt;];&lt;/pre&gt;&lt;pre class="csharpcode"&gt;    StreamWriter writer = &lt;span class="kwrd"&gt;new&lt;/span&gt; StreamWriter(&lt;span class="str"&gt;&amp;quot;C:\\Install.log&amp;quot;&lt;/span&gt;, &lt;span class="kwrd"&gt;true&lt;/span&gt;);
&lt;/pre&gt;&lt;pre class="csharpcode"&gt;    writer.WriteLine(&lt;span class="str"&gt;&amp;quot;Install log file&amp;quot;&lt;/span&gt;);
    writer.WriteLine(DateTime.Now.ToShortDateString() + &lt;span class="str"&gt;&amp;quot; &amp;quot;&lt;/span&gt; + DateTime.Now.ToShortTimeString());
    writer.WriteLine(&lt;span class="str"&gt;&amp;quot;Install path is &amp;quot;&lt;/span&gt; + path);
&lt;/pre&gt;&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;string&lt;/span&gt; s = &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;
    &lt;span class="kwrd"&gt;switch&lt;/span&gt; (myPassedValue)
    {
        &lt;span class="kwrd"&gt;case&lt;/span&gt; &lt;span class="str"&gt;&amp;quot;1&amp;quot;&lt;/span&gt;:
            s = &lt;span class="str"&gt;&amp;quot;develop&amp;quot;&lt;/span&gt;;
            &lt;span class="kwrd"&gt;break&lt;/span&gt;;
        &lt;span class="kwrd"&gt;case&lt;/span&gt; &lt;span class="str"&gt;&amp;quot;2&amp;quot;&lt;/span&gt;:
            s = &lt;span class="str"&gt;&amp;quot;test&amp;quot;&lt;/span&gt;;
            &lt;span class="kwrd"&gt;break&lt;/span&gt;;
        &lt;span class="kwrd"&gt;case&lt;/span&gt; &lt;span class="str"&gt;&amp;quot;3&amp;quot;&lt;/span&gt;:
            s = &lt;span class="str"&gt;&amp;quot;product&amp;quot;&lt;/span&gt;;
            &lt;span class="kwrd"&gt;break&lt;/span&gt;;
    }
    writer.WriteLine(&lt;span class="str"&gt;&amp;quot;You selected &amp;quot;&lt;/span&gt; + s);
    writer.WriteLine(&lt;span class="str"&gt;&amp;quot;First name: &amp;quot;&lt;/span&gt; + fName);
    writer.WriteLine(&lt;span class="str"&gt;&amp;quot;Last name: &amp;quot;&lt;/span&gt; + lName);
    writer.Flush();
    writer.Close();
}

&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre class="csharpcode"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp; You can see that we used TEST, FNAME and LNAME parameters to get values from setup dialogs. All that this method will do is to put this values into &lt;em&gt;install.log&lt;/em&gt; file. I hope you will find something more useful to do with installer classes then I in this example. Good luck!&lt;/p&gt;&lt;img src="http://live.mscommunity.net/aggbug.aspx?PostID=3716" width="1" height="1"&gt;</content><author><name>NotEqu</name><uri>http://live.mscommunity.net/members/NotEqu.aspx</uri></author></entry></feed>