Click here to Skip to main content
15,847,653 members
Home / Discussions / C#
   

C#

 
GeneralRe: Minimize all open programs Pin
originSH5-Apr-07 3:15
originSH5-Apr-07 3:15 
GeneralRe: Minimize all open programs Pin
anderslundsgard5-Apr-07 3:28
anderslundsgard5-Apr-07 3:28 
GeneralRe: Minimize all open programs Pin
originSH5-Apr-07 5:14
originSH5-Apr-07 5:14 
Questionhow to listen a connection from a specific IP address? Pin
F.E.L.I.X.4-Apr-07 23:16
F.E.L.I.X.4-Apr-07 23:16 
QuestionSome vb to c# Pin
akkram4-Apr-07 22:30
akkram4-Apr-07 22:30 
AnswerRe: Some vb to c# Pin
akkram4-Apr-07 23:18
akkram4-Apr-07 23:18 
AnswerRe: Some vb to c# Pin
Dave Doknjas5-Apr-07 13:50
Dave Doknjas5-Apr-07 13:50 
Questionhow to overcome this exception --in ClickonceDeployment INVALIDDEPLOYMENTEXEPTION, --"Application in not installed" Pin
pashitech4-Apr-07 22:21
pashitech4-Apr-07 22:21 
Thnx alot Mr.Roel
I found ur help on click once is useful, but here i have a doubt about my current Error: INVALIDDEPLOYMENTEXEPTION, saying "Application in not installed"

Here i have taken a button[Update] and when user clicks the buttion the functionality should checks the updated version and if available it should download the latest version for that my code is,,


in Buttion

private void button1_Click(object sender, EventArgs e)
{
if (ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment appDeploy = ApplicationDeployment.CurrentDeployment;

bool update = appDeploy.CheckForUpdate();
if (update)
{
UpdateCheckInfo updateInfo = appDeploy.CheckForDetailedUpdate();
string version = updateInfo.AvailableVersion.ToString();
bool updateRequired = updateInfo.IsUpdateRequired;
string minVersion = "";
if (updateInfo.MinimumRequiredVersion!=null)
minVersion = updateInfo.MinimumRequiredVersion.ToString();
bool updateAvail = updateInfo.UpdateAvailable;
long footprint = updateInfo.UpdateSizeBytes;

StringBuilder sb = new StringBuilder();
sb.AppendFormat("Update Version: {0}\r\n", version);
sb.AppendFormat("Minimum Version: {0}\r\n", minVersion);
sb.AppendFormat("Update Required: {0}\r\n", updateRequired);
sb.AppendFormat("Update Available: {0}\r\n", updateAvail);
sb.AppendFormat("Update Footprint: {0} bytes\r\n", footprint);

MessageBox.Show(sb.ToString());

if (updateAvail)
{
bool updated = appDeploy.Update();
if (updated)
Application.Restart();
}
}
else
MessageBox.Show("No updates are available.");
}
else
{
MessageBox.Show("This application was not launched using ClickOnce. Cannot perform update.");
}
}


in PageLoad

private void Form1_Load(object sender, EventArgs e)
{
if (ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment appDeploy = ApplicationDeployment.CurrentDeployment;
this.label1.Text = appDeploy.CurrentVersion.ToString();

appDeploy.CheckForUpdateProgressChanged += new DeploymentProgressChangedEventHandler(appDeploy_CheckForUpdateProgressChanged);
appDeploy.CheckForUpdateCompleted += new CheckForUpdateCompletedEventHandler(appDeploy_CheckForUpdateCompleted);

appDeploy.UpdateProgressChanged += new DeploymentProgressChangedEventHandler(appDeploy_UpdateProgressChanged);
appDeploy.UpdateCompleted += new AsyncCompletedEventHandler(appDeploy_UpdateCompleted);
}

}

}



Hope You got me,
please help me thnx in advance

prashanth,
s/w Engineer,
Syfnosys.

Questionhow to enable & disable USB ports from .NET applications? Pin
abyclassic4-Apr-07 22:20
abyclassic4-Apr-07 22:20 
AnswerRe: how to enable & disable USB ports from .NET applications? Pin
Niiiissssshhhhhuuuuu4-Apr-07 23:34
Niiiissssshhhhhuuuuu4-Apr-07 23:34 
GeneralRe: how to enable & disable USB ports from .NET applications? Pin
abyclassic8-Apr-07 20:40
abyclassic8-Apr-07 20:40 
QuestionC# API Doc Generator Pin
Ollie19864-Apr-07 21:59
Ollie19864-Apr-07 21:59 
AnswerRe: C# API Doc Generator Pin
Stefan Troschuetz4-Apr-07 22:10
Stefan Troschuetz4-Apr-07 22:10 
QuestionDocking Form? Pin
Muhammad Nauman Yousuf4-Apr-07 21:48
Muhammad Nauman Yousuf4-Apr-07 21:48 
AnswerRe: Docking Form? Pin
__DanC__4-Apr-07 23:31
__DanC__4-Apr-07 23:31 
QuestionHow can i rename a file on ftp with .net1.1? Pin
Nafiseh Salmani4-Apr-07 21:34
Nafiseh Salmani4-Apr-07 21:34 
AnswerRe: How can i rename a file on ftp with .net1.1? Pin
andre_swnpl4-Apr-07 21:43
andre_swnpl4-Apr-07 21:43 
GeneralRe: How can i rename a file on ftp with .net1.1? Pin
Nafiseh Salmani4-Apr-07 21:56
Nafiseh Salmani4-Apr-07 21:56 
GeneralRe: How can i rename a file on ftp with .net1.1? Pin
andre_swnpl4-Apr-07 22:06
andre_swnpl4-Apr-07 22:06 
QuestionQuery. Pin
Nekshan4-Apr-07 20:52
Nekshan4-Apr-07 20:52 
AnswerRe: Query. Pin
andre_swnpl4-Apr-07 21:40
andre_swnpl4-Apr-07 21:40 
QuestionRegular Expression to remove single line comments Pin
irsh_is4-Apr-07 20:49
irsh_is4-Apr-07 20:49 
QuestionTo get the country names Pin
John.L.Ponratnam4-Apr-07 20:49
John.L.Ponratnam4-Apr-07 20:49 
AnswerRe: To get the country names Pin
Tamimi - Code4-Apr-07 21:38
Tamimi - Code4-Apr-07 21:38 
GeneralRe: To get the country names Pin
John.L.Ponratnam4-Apr-07 22:07
John.L.Ponratnam4-Apr-07 22:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.