473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Exited event does not to be triggered for ClickOnce process

I want to know when a clickonce app exits. I have code snippet below.
But the Exited event is not triggered. If I change the process to
Notepad.exe(see comment line), it works fine. Any suggestion would be
appreciated.
Process myClickOnce;

private void CheckDownload()
{
myClickOnce = new Process();
myClickOnce.EnableRaisingEvents = true;
myClickOnce.StartInfo = new
ProcessStartInfo(@"c:\temp\myTest.appref-ms");
//myClickOnce.StartInfo = new
ProcessStartInfo("notepad.exe");
myClickOnce.Start();
myClickOnce.Exited += new EventHandler(myClickOnce_Exited);
}

void myClickOnce_Exited(object sender, EventArgs e)
{
MessageBox.Show("Download finished");
}

*** Sent via Developersdex http://www.developersdex.com ***
Oct 25 '06 #1
3 2061
It looks to me like you are going ahead and starting the process (
myClickOnce.Start() ) in the line of code BEFORE you have hooked up the
event, right? Try putting the next line before the first one.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"steven deng" wrote:
I want to know when a clickonce app exits. I have code snippet below.
But the Exited event is not triggered. If I change the process to
Notepad.exe(see comment line), it works fine. Any suggestion would be
appreciated.
Process myClickOnce;

private void CheckDownload()
{
myClickOnce = new Process();
myClickOnce.EnableRaisingEvents = true;
myClickOnce.StartInfo = new
ProcessStartInfo(@"c:\temp\myTest.appref-ms");
//myClickOnce.StartInfo = new
ProcessStartInfo("notepad.exe");
myClickOnce.Start();
myClickOnce.Exited += new EventHandler(myClickOnce_Exited);
}

void myClickOnce_Exited(object sender, EventArgs e)
{
MessageBox.Show("Download finished");
}

*** Sent via Developersdex http://www.developersdex.com ***
Oct 25 '06 #2

Hi Peter,
Thanks for your response.
I am sorry, that was a mistyping. Should hook first like you mentioned.
My code works fine for any other standard excutable(i.e Notepad.exe) or
assembly created with .net. i.e myDotNetSample.exe. Only when I launch
ClickOnce app like this, the event just does not raise.
Process myClickOnce;

private void CheckDownload()
{
myClickOnce = new Process();
myClickOnce.EnableRaisingEvents = true;
myClickOnce.StartInfo = new
ProcessStartInfo(@"c:\temp\myTest.appref-ms");
//myClickOnce.StartInfo = new
ProcessStartInfo("notepad.exe");
myClickOnce.Exited += new EventHandler(myClickOnce_Exited);
myClickOnce.Start();
}

void myClickOnce_Exited(object sender, EventArgs e)
{
MessageBox.Show("Download finished");
}

*** Sent via Developersdex http://www.developersdex.com ***
Oct 25 '06 #3
"steven deng" wrote :

"Only when I launch ClickOnce app like this, the event just does not raise.
"

Process myClickOnce;

private void CheckDownload()
{
myClickOnce = new Process();
myClickOnce.EnableRaisingEvents = true;
myClickOnce.StartInfo = new
ProcessStartInfo(@"c:\temp\myTest.appref-ms");
//myClickOnce.StartInfo = new
ProcessStartInfo("notepad.exe");
myClickOnce.Exited += new EventHandler(myClickOnce_Exited);
myClickOnce.Start();
}

void myClickOnce_Exited(object sender, EventArgs e)
{
MessageBox.Show("Download finished");
}

Hi Steven,

Somehow sent my first reply to your e-mail address rather than this group,
sorry.

Exactly what type of ClickOnce are you launching here : are you launching
the URL or Network Share Address of an on-line-only ClickOnce application
where the end-user must be connected to the Interenet ?

If that's the case, I would be surprised if the .NET 2.0 Framework business
that handles launch and security verification of such ClickOnce
on-line-only-mode apps worked.

Have you tried this with a ClickOnce app deployed and installed as as
"regular" Windows app : i.e., with Start Menu entry, etc.

best, Bill Woodruff
dotScience
Chiang Mai, Thailand
Oct 29 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: T | last post by:
How do you catch the "Exited" event when a process is terminated. In the following code sample the "myProcess_Exited" event is never called. Any help would be appreciated. using System; using...
2
by: Phil Galey | last post by:
I have a FileSystemWatcher that triggers when a PDF file is created. However, the creation of the PDF file is about a 7 or 8 second process ... I cannot refer to the file during that time because...
2
by: Zorpiedoman | last post by:
Is this a known bug? Sub RunCalc() dim P as new Process P = Process.Start("calc.exe") addhandler P.Exited, Addressof DoneCalculating End Sub Sub DoneCalculating(sender as object, e as...
2
by: ari | last post by:
I have an MDI form with a listview and a toolbar. I have 2 instances of this form running at once - lets call them A and B. If I am in A, and I click on the listview control in B, then B's enter...
1
by: Mr. Beck | last post by:
I am in the process of creating a C# ClickOnce application that will be deployed in the coming months. I was initially thinking of deploying it through Windows Installation but due to the need of...
5
by: =?Utf-8?B?QmVuIFIu?= | last post by:
Hi, In a .NET 2.0 winforms application, I've got a textbox that, when updated, uses the validated event to cascade the change to another textbox (along with another value). This works well if...
9
by: kimiraikkonen | last post by:
Hello, I want to automate something and display a simple msgbox that indicates my external process finished processing and "exited". My code is that, what things should i add more: Dim psInfo...
3
by: =?Utf-8?B?Um9nZXIgVHJhbmNoZXo=?= | last post by:
Hello, I would like to know the best way to install an clickonce in .net 3.5 (we use LINQ 8-D) published application on terminal server 2003 Do I have to install it on EVERY user that will use...
6
by: Lord Zoltar | last post by:
I built a small app with VS C# Express 2008, and published it as a click-once app. I tried installing it on my local machine, and when I click on its icon from the Start menu, nothing happens....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.