Home All Groups Group Topic Archive Search About

Clickonce install from CD

Author
16 Dec 2005 4:52 PM
Lelekács Zoltán
Hi,

I generated the deployment files into a local directory with specified
installation URL.

My prolbems:
- If there is an internet connection on the client machine, it skips the
files on the local hard drive, immediately start downloading from the web.
- if there is no internet connection, the setup.exe fails (which is the
startup program from a CD), but the application icon installs the software
well.

I implemented a custom async update. When I call the CheckUpdateAsync method
I have got an exception in the Application.ThreadException event, not in the
AsyncCompleted event as the MSDN says (in the e.Error)...
Why?
Thanks.

lelez
------------
Here it is the code:
try
            {
                ApplicationDeployment dep =
ApplicationDeployment.CurrentDeployment;
                dep.CheckForUpdateCompleted += checkHandler;
                dep.CheckForUpdateAsync();
            }
            catch (System.Net.WebException)
            {
                // never runs!
                System.Windows.Forms.MessageBox.Show("There is no internet
connection.");
            }
            catch (Exception ex)
            {
                xxxx.Common.Util.Logger.LogException(ex);
             }

Here it is the handler:
private static void dep_CheckCompleted(object sender,
CheckForUpdateCompletedEventArgs e)
        {
            if (e.Error is System.Net.WebException)
            {
                System.Windows.Forms.MessageBox.Show("There is no internet
connection.");
                return;
            }

            ApplicationDeployment dep =
ApplicationDeployment.CurrentDeployment;
            dep.CheckForUpdateCompleted -= checkHandler;

            try
            {
                if (e.UpdateAvailable)
                {
                    ContinueQuestionEventArgs ce = new
ContinueQuestionEventArgs(e.AvailableVersion.ToString());
                    // Ask the user about continue...
                    if (updateIsAvailable != null)
                        updateIsAvailable(null, ce);

                    if (ce.Continue)
                    {
                        dep.UpdateCompleted += updateHandler;
                        dep.UpdateAsync();
                    }
                }
            }
            catch(InvalidOperationException ex)
            {
                xxxxx.Common.Util.Logger.LogException(ex);
             }
        } // dep_CheckCompleted...
--
-----------------------------------
http://www.lelez.hu
ICQ: 177465172

Author
17 Dec 2005 2:37 PM
Cowboy (Gregory A. Beamer)
ClickOnce is designed as an Internet technology. If you want to play outside
of that box, you have to be a bit creative. One option is to setup the
Cassini web server to load on the CD and then have it open a browser window
to the drive in question.You can then "click once" install.

If you are putting the software on a CD, however, it seems wiser to just
have an install. If you need to update, bootstrap the startup to check for
newer files and allow it to die gracefully if there is no Internet
connection.

--
Gregory A. Beamer

************************************************
Think outside the box!
************************************************
Show quote
"Lelekács Zoltán" <le***@freemail.hu> wrote in message
news:eERhQEmAGHA.360@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> I generated the deployment files into a local directory with specified
> installation URL.
>
> My prolbems:
> - If there is an internet connection on the client machine, it skips the
> files on the local hard drive, immediately start downloading from the web.
> - if there is no internet connection, the setup.exe fails (which is the
> startup program from a CD), but the application icon installs the software
> well.
>
> I implemented a custom async update. When I call the CheckUpdateAsync
> method I have got an exception in the Application.ThreadException event,
> not in the AsyncCompleted event as the MSDN says (in the e.Error)...
> Why?
> Thanks.
>
> lelez
> ------------
> Here it is the code:
> try
>            {
>                ApplicationDeployment dep =
> ApplicationDeployment.CurrentDeployment;
>                dep.CheckForUpdateCompleted += checkHandler;
>                dep.CheckForUpdateAsync();
>            }
>            catch (System.Net.WebException)
>            {
>                // never runs!
>                System.Windows.Forms.MessageBox.Show("There is no internet
> connection.");
>            }
>            catch (Exception ex)
>            {
>                xxxx.Common.Util.Logger.LogException(ex);
>             }
>
> Here it is the handler:
> private static void dep_CheckCompleted(object sender,
> CheckForUpdateCompletedEventArgs e)
>        {
>            if (e.Error is System.Net.WebException)
>            {
>                System.Windows.Forms.MessageBox.Show("There is no internet
> connection.");
>                return;
>            }
>
>            ApplicationDeployment dep =
> ApplicationDeployment.CurrentDeployment;
>            dep.CheckForUpdateCompleted -= checkHandler;
>
>            try
>            {
>                if (e.UpdateAvailable)
>                {
>                    ContinueQuestionEventArgs ce = new
> ContinueQuestionEventArgs(e.AvailableVersion.ToString());
>                    // Ask the user about continue...
>                    if (updateIsAvailable != null)
>                        updateIsAvailable(null, ce);
>
>                    if (ce.Continue)
>                    {
>                        dep.UpdateCompleted += updateHandler;
>                        dep.UpdateAsync();
>                    }
>                }
>            }
>            catch(InvalidOperationException ex)
>            {
>                xxxxx.Common.Util.Logger.LogException(ex);
>             }
>        } // dep_CheckCompleted...
> --
> -----------------------------------
> http://www.lelez.hu
> ICQ: 177465172
>
Author
17 Dec 2005 3:10 PM
Lelekács Zoltán
> ClickOnce is designed as an Internet technology. If you want to play
> outside of that box, you have to be a bit creative.
OK, but there is even a checkbox under the publish tab, that I want to
create autorun.inf for CD installation...
So I think It is not a question of creativity...
Anyway thanks your answer.

My bigger problem is the second one, that I have got an exception in the
main thread when I try to get update information with no internet
connection. MSDN promises that I will get exceptions in the Completed event
handler in the params (e.Error).
Instead this behaviour I have got the exception in the main thread and I
could catch only here...

lelez
-----------------------------------
http://www.lelez.hu
ICQ: 177465172
Author
17 Dec 2005 3:51 PM
Cowboy (Gregory A. Beamer)
I will have to look at the final bits because it appears things have changed
a bit since I have last played with this. :-)

After a quick search, I fond something that might help:
http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_fxdeploy/html/ccee6551-a1b9-4ca2-8845-9c1cf4ac2560.asp

--
Gregory A. Beamer

************************************************
Think outside the box!
************************************************
Show quote
"Lelekács Zoltán" <le***@freemail.hu> wrote in message
news:e67PmwxAGHA.3936@TK2MSFTNGP12.phx.gbl...
>> ClickOnce is designed as an Internet technology. If you want to play
>> outside of that box, you have to be a bit creative.
> OK, but there is even a checkbox under the publish tab, that I want to
> create autorun.inf for CD installation...
> So I think It is not a question of creativity...
> Anyway thanks your answer.
>
> My bigger problem is the second one, that I have got an exception in the
> main thread when I try to get update information with no internet
> connection. MSDN promises that I will get exceptions in the Completed
> event handler in the params (e.Error).
> Instead this behaviour I have got the exception in the main thread and I
> could catch only here...
>
> lelez
> -----------------------------------
> http://www.lelez.hu
> ICQ: 177465172
>

AddThis Social Bookmark Button