how to cause current application to close upon arrival of new updated application ?
-
hello, i wrote an application in c# that starts automaticaly when computer starts. i allready have code that prevents the application from running more than once as follows:
static void Main()
{
Boolean firstInstance = false;
string safeName = "xxx";
Mutex mutex = new Mutex(true, safeName, out firstInstance);
if (!firstInstance) return;
}now when i publish a new version (i set the revision to increase automaticaly) and run the setup file all is fine but the old application still remains. i get two copies running , one new and one old. is there a way to tell the old version to close ? like an external event? i am using only visual studio tools. thanks in advance avi
-
hello, i wrote an application in c# that starts automaticaly when computer starts. i allready have code that prevents the application from running more than once as follows:
static void Main()
{
Boolean firstInstance = false;
string safeName = "xxx";
Mutex mutex = new Mutex(true, safeName, out firstInstance);
if (!firstInstance) return;
}now when i publish a new version (i set the revision to increase automaticaly) and run the setup file all is fine but the old application still remains. i get two copies running , one new and one old. is there a way to tell the old version to close ? like an external event? i am using only visual studio tools. thanks in advance avi
Hi! Do you mean to say that during updated installation you SETUP should remove previous installation. Thanks!
Develop2Program & Program2Develop
-
Hi! Do you mean to say that during updated installation you SETUP should remove previous installation. Thanks!
Develop2Program & Program2Develop
no no navneet hegde, i ment that a previous program is still running, now a new program needs to run instead of it so how will it end the process of the previous program ? i dont want the old program and the new program to run but only the new one. after the installation of the new program finishes , the old program closes and the new program takes it place.. i seen it done in famous apps , i wanna do it too... thanks :)
-
no no navneet hegde, i ment that a previous program is still running, now a new program needs to run instead of it so how will it end the process of the previous program ? i dont want the old program and the new program to run but only the new one. after the installation of the new program finishes , the old program closes and the new program takes it place.. i seen it done in famous apps , i wanna do it too... thanks :)
Hi! Your new Application starts. In Main get the collection of all the running processes. Iterating it you get your running process object. Compare it's build with this process build. If it's greater than kill the previous process and continue with this process. Else kill this process. Thanks!
Develop2Program & Program2Develop
-
Hi! Your new Application starts. In Main get the collection of all the running processes. Iterating it you get your running process object. Compare it's build with this process build. If it's greater than kill the previous process and continue with this process. Else kill this process. Thanks!
Develop2Program & Program2Develop