<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Forms Development</title>
        <link>http://geekswithblogs.net/gpro/category/7674.aspx</link>
        <description>Forms Development</description>
        <language>en-US</language>
        <copyright>Gary Pronych</copyright>
        <managingEditor>gary.pronych@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>ClickOnce: Restore a Previous Version of an Application</title>
            <link>http://geekswithblogs.net/gpro/archive/2008/10/30/clickonce-restore-previous-version.aspx</link>
            <description>&lt;p&gt;As a standard, we use ClickOnce to deploy all of our applications.&lt;br /&gt;
&lt;br /&gt;
I don't want to get into all the benefits as I have discussed some in a &lt;a href="http://geekswithblogs.net/gpro/archive/2008/03/16/clickonce-winforms-deployment-part-1.aspx"&gt;previous post&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
To summarize my scenario, I do software development for a 24 x 7 x 365 manufacturing plant.&lt;br /&gt;
Our systems must always be online and we must provide after hours support.&lt;br /&gt;
&lt;br /&gt;
This week, one of our developers deployed an update to his end users.&lt;br /&gt;
It was not until 7 PM that the end user determined there was a significant bug in the application that could cause a mill delay. (Bad!)&lt;br /&gt;
I was on call and I was not at all familiar with this application, luckily the developer notified the team of this update and the fixes included. The bug was a part of one of these fixes, so I knew I could rollback to the previous version so the end user can continue his job and this new bug can be resolved during the next business day.&lt;br /&gt;
&lt;br /&gt;
As a developer, you may consider something like &lt;br /&gt;
'grabbing the source code for the previous version, build it, and deploy'; which can be time time consuming.&lt;br /&gt;
With ClickOnce, you have 2 easy to use options.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;1) Change the Version on the Client&lt;/span&gt;&lt;br /&gt;
- Ask the end user (or remote control) to navigate to the CONTROL PANEL -&amp;gt; ADD REMOVE PROGRAMS&lt;br /&gt;
- Scroll down the list of applications until you find your application name, in my case it is called RSA&lt;br /&gt;
- Click Change/Remove&lt;br /&gt;
- You will then have two options&lt;br /&gt;
a) Restore the application to its previous state&lt;br /&gt;
b) Remove the application from this computer&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;img src="/images/geekswithblogs_net/gpro/7676/r_ClickOnce_Add.Remove_Restore.JPG" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
Select a) and the previous build will become the current version.&lt;br /&gt;
The caveat is the user must use Start -&amp;gt; All Programs -&amp;gt; Your Application Folder -&amp;gt; Your Application Name &amp;lt;RSA&amp;gt; to load the previous version.&lt;br /&gt;
They must run the application from the install folder to get the newest update.&lt;br /&gt;
&lt;br /&gt;
This option works for a single client and is a temporary solution, what if a permanant rolback is required?&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;2) Change the Current Application Version&lt;/span&gt;&lt;br /&gt;
You have likely published a number of version of your application so you ClickOnce publish folder may look like this.&lt;br /&gt;
&lt;br /&gt;
&lt;img height="646" width="546" src="/images/geekswithblogs_net/gpro/7676/o_ClickOnce_On.Network.JPG" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
You will see in this picture, there are a number of &amp;lt;ApplicationName&amp;gt;_&amp;lt;version&amp;gt;.application files as well as folders.&lt;br /&gt;
There is only 1 application with the name &amp;lt;ApplicationName&amp;gt;.application, in this my scenario it is called RSA.application.&lt;br /&gt;
&lt;br /&gt;
My latest build is 1_1_0_14, to restore to 1_1_0_12 I need to follow these steps&lt;br /&gt;
- delete RSA.application&lt;br /&gt;
- Make a copy of RSA_1_1_0_12.application and rename it RSA.application&lt;br /&gt;
&lt;br /&gt;
The next time a user of this application attempts to load their application, they will be notified of an update. Once they select OK, they will be rolled back to 1_1_0_12.&lt;br /&gt;
&lt;br /&gt;
Hope this helps,&lt;br /&gt;
Gary Pronych&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126407"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126407" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/gpro/aggbug/126407.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gary Pronych</dc:creator>
            <guid>http://geekswithblogs.net/gpro/archive/2008/10/30/clickonce-restore-previous-version.aspx</guid>
            <pubDate>Thu, 30 Oct 2008 18:37:09 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gpro/comments/126407.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gpro/archive/2008/10/30/clickonce-restore-previous-version.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/gpro/comments/commentRss/126407.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gpro/services/trackbacks/126407.aspx</trackback:ping>
        </item>
        <item>
            <title>ClickOnce: Winforms Deployment - Part 1</title>
            <link>http://geekswithblogs.net/gpro/archive/2008/03/16/clickonce-winforms-deployment-part-1.aspx</link>
            <description>Currently my client has a number of WinForm applications in development.&lt;br /&gt;
When it came time to deploy these solutions to end users in multiple facilities, discussions of xcopy installations started.&lt;br /&gt;
&lt;br /&gt;
Xcopy is not the best solution; in the past it has been servicable to meet this requirement, today we have better options.&lt;br /&gt;
&lt;br /&gt;
Some of the flaws of xcopy deployment include&lt;br /&gt;
- &lt;span style="font-weight: bold;"&gt;Network connectivity required&lt;/span&gt;: if the PC is off it will not get the update&lt;br /&gt;
- &lt;span style="font-weight: bold;"&gt;Installation Lists: &lt;/span&gt;You need to know which PC's have your software for when updates are available&lt;br /&gt;
- &lt;span style="font-weight: bold;"&gt;Versioning: &lt;/span&gt;Some clients may be running different versions which could damage your data integrity&lt;br /&gt;
- &lt;span style="font-weight: bold;"&gt;Dependencies: &lt;/span&gt;If your software requires any components, you will have to create an installer for each version&lt;br /&gt;
&lt;br /&gt;
Since Visual Studio 2005, including 2008, there is a feature built-in feature know as &lt;a href="http://msdn2.microsoft.com/en-us/library/t71a733d(VS.80).aspx"&gt;ClickOnce&lt;/a&gt;.&lt;br /&gt;
It is my experience is that this 'out of the box' feature is under utilized or developers are not aware that this feature exists.&lt;br /&gt;
&lt;br /&gt;
ClickOnce Provides:&lt;br /&gt;
- &lt;span style="font-weight: bold;"&gt;Automatic Update: &lt;/span&gt;The application 'calls home' to check for the newest version, clients are prompted to update their version&lt;br /&gt;
- &lt;span style="font-weight: bold;"&gt;Rollback&lt;/span&gt;: The client can rollback using Add/Remove; the developer can also make the adjustments using the published version&lt;br /&gt;
&lt;br /&gt;
You can publish an application can be publish to&lt;br /&gt;
1) A URL&lt;br /&gt;
2) File location including on your network &lt;br /&gt;
&lt;br /&gt;
I won't get into the specifics of the options; they are pretty straight forward and there are articles on how to use the &lt;a href="http://msdn2.microsoft.com/en-us/library/31kztyey(VS.80).aspx"&gt;publish wizard&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
But what if you have to deploy and manage a legacy application, or a vendor provided application?&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Managing Other Windows Applications using ClickOnce&lt;/h3&gt;
After my client started seeing the benefits of ClickOnce, the next question was, 'Can I use this for my vendor provided applications?'.&lt;br /&gt;
This is actually very easy to implement.&lt;br /&gt;
&lt;br /&gt;
1) Create a new Visual Studio project&lt;br /&gt;
2) Copy your vendor provided components into your project &lt;br /&gt;
3) Call the application executable in your code&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
namespace AppLauncher&lt;br /&gt;
{&lt;br /&gt;
   class Program&lt;br /&gt;
   {&lt;br /&gt;
      static void Main(string[] args)&lt;br /&gt;
      {&lt;br /&gt;
         Process.Start("LegacyApp.exe"); //put your executable name here&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
4) Publish the application with the above publishing wizard.&lt;br /&gt;
&lt;br /&gt;
Anytime the vendor provides an update, overwrite the project files, increment the publish version and publish the update.&lt;br /&gt;
Next time your end user executes the Launcher application, they will be prompted to update their application.&lt;br /&gt;
&lt;br /&gt;
We have used this strategy for deploying applications to less than 20 internal users and it has worked well.&lt;br /&gt;
We looked into options of creating a 'Whats New' message on first load; which is something we may still look into for the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In part 2 of this series, I will describe some troubleshooting and advanced details that will assist you with ClickOnce.&lt;br /&gt;
&lt;br /&gt;
&lt;img width="797" height="706" src="/images/geekswithblogs_net/gpro/7676/o_ClickOnce.png" alt="" /&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120579"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120579" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/gpro/aggbug/120579.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gary Pronych</dc:creator>
            <guid>http://geekswithblogs.net/gpro/archive/2008/03/16/clickonce-winforms-deployment-part-1.aspx</guid>
            <pubDate>Sun, 16 Mar 2008 14:27:07 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gpro/comments/120579.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gpro/archive/2008/03/16/clickonce-winforms-deployment-part-1.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/gpro/comments/commentRss/120579.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gpro/services/trackbacks/120579.aspx</trackback:ping>
        </item>
    </channel>
</rss>