Re: Need to run an application from within main but close the main
- From: Noble Bell <NobleBell@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 23 Feb 2009 15:09:01 -0800
Ok. Thanks.
--
Noble D. Bell
www.noblesoftware.com
"Chris Tacke, eMVP" wrote:
And all of that ios possible - you just have to know how to shut down your.
app. THe original code you posted did not guarantee that - it made the
faulty assumption that APp.Exit would close the app. You need to make sure
all threads exit.
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
"Noble Bell" <NobleBell@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AB3E69EA-C080-47D6-8082-2B2AA1DC5493@xxxxxxxxxxxxxxxx
Hi Chris,
Thanks for your comment. Here is what has to happen:
1) The main app is running
2) At a given event (button click or timer tick) the app looks to see if
there is a new version of itself.
3) If there is a new version of itself (exe and/or db) it needs to start a
seperate updater.exe program and shut itself down completely.
The main app has to shut down completely because in the updater
application
it does the following:
1) Makes a backup of the exitsing app (exe and db)
2) Downloads the new version of the main app and then copies the new
version
of the exe over the top of the existing version
3) Run update scripts against the database.
When the updater has completed the process needs to shut down the updater
app and close it completely and then restart the main application.
--
Noble D. Bell
www.noblesoftware.com
"Chris Tacke, eMVP" wrote:
Sure, this app will run as long as the thread you started runs, and we
have
no idea what it's doing. Application.Exit does *not* exit an app - it's
a
misnomer. It simply exits the current message pump, which will exit a
previous call to Application.Run.
What you should be doing is just launching the remote process and then
exiting.
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
"Noble Bell" <NobleBell@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D558F3F0-C024-4324-9140-F44344DF2A2E@xxxxxxxxxxxxxxxx
I want to start a different exe file from within my main application and
then
close the main application. I can start the other application but it
does
not
seem to be closing the main application. Below is the code that I am
using:
Syncing.ApplicationUpdater appUpdater = new
Syncing.ApplicationUpdater();
if (!System.Diagnostics.Debugger.IsAttached)
{
System.Threading.ThreadStart myThreadDelegate =
new
System.Threading.ThreadStart(appUpdater.StartUpgradeStub);
System.Threading.Thread myThread = new
System.Threading.Thread(myThreadDelegate);
Application.Exit();
myThread.Start();
}
public partial class ApplicationUpdater
{
public void StartUpgradeStub()
{
System.Diagnostics.Process cur = new
System.Diagnostics.Process();
cur.StartInfo.UseShellExecute = true;
cur.StartInfo.FileName = @"\Program
Files\autoupdater\AutoUpdater.exe";
cur.Start();
}
}
--
Noble D. Bell
www.noblesoftware.com
- References:
- Need to run an application from within main but close the main one
- From: Noble Bell
- Re: Need to run an application from within main but close the main one
- From: Chris Tacke, eMVP
- Re: Need to run an application from within main but close the main
- From: Noble Bell
- Re: Need to run an application from within main but close the main
- From: Chris Tacke, eMVP
- Need to run an application from within main but close the main one
- Prev by Date: Re: Need to run an application from within main but close the main
- Next by Date: Pairing in WINCE
- Previous by thread: Re: Need to run an application from within main but close the main
- Next by thread: Manual DNS
- Index(es):
Relevant Pages
|