Click here to Skip to main content
15,949,686 members
Home / Discussions / C#
   

C#

 
GeneralRe: Minimize all open programs Pin
originSH5-Apr-07 2:15
originSH5-Apr-07 2:15 
GeneralRe: Minimize all open programs Pin
anderslundsgard5-Apr-07 2:28
anderslundsgard5-Apr-07 2:28 
GeneralRe: Minimize all open programs Pin
originSH5-Apr-07 4:14
originSH5-Apr-07 4:14 
Questionhow to listen a connection from a specific IP address? Pin
F.E.L.I.X.4-Apr-07 22:16
F.E.L.I.X.4-Apr-07 22:16 
QuestionSome vb to c# Pin
akkram4-Apr-07 21:30
akkram4-Apr-07 21:30 
AnswerRe: Some vb to c# Pin
akkram4-Apr-07 22:18
akkram4-Apr-07 22:18 
AnswerRe: Some vb to c# Pin
Dave Doknjas5-Apr-07 12:50
Dave Doknjas5-Apr-07 12:50 
Questionhow to overcome this exception --in ClickonceDeployment INVALIDDEPLOYMENTEXEPTION, --"Application in not installed" Pin
pashitech4-Apr-07 21:21
pashitech4-Apr-07 21: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 21:20
abyclassic4-Apr-07 21:20 
AnswerRe: how to enable & disable USB ports from .NET applications? Pin
Niiiissssshhhhhuuuuu4-Apr-07 22:34
Niiiissssshhhhhuuuuu4-Apr-07 22:34 
GeneralRe: how to enable & disable USB ports from .NET applications? Pin
abyclassic8-Apr-07 19:40
abyclassic8-Apr-07 19:40 
QuestionC# API Doc Generator Pin
Ollie19864-Apr-07 20:59
Ollie19864-Apr-07 20:59 
AnswerRe: C# API Doc Generator Pin
Stefan Troschuetz4-Apr-07 21:10
Stefan Troschuetz4-Apr-07 21:10 
QuestionDocking Form? Pin
Muhammad Nauman Yousuf4-Apr-07 20:48
Muhammad Nauman Yousuf4-Apr-07 20:48 
AnswerRe: Docking Form? Pin
__DanC__4-Apr-07 22:31
__DanC__4-Apr-07 22:31 
QuestionHow can i rename a file on ftp with .net1.1? Pin
Nafiseh Salmani4-Apr-07 20:34
Nafiseh Salmani4-Apr-07 20:34 
AnswerRe: How can i rename a file on ftp with .net1.1? Pin
andre_swnpl4-Apr-07 20:43
andre_swnpl4-Apr-07 20:43 
GeneralRe: How can i rename a file on ftp with .net1.1? Pin
Nafiseh Salmani4-Apr-07 20:56
Nafiseh Salmani4-Apr-07 20:56 
GeneralRe: How can i rename a file on ftp with .net1.1? Pin
andre_swnpl4-Apr-07 21:06
andre_swnpl4-Apr-07 21:06 
QuestionQuery. Pin
Nekshan4-Apr-07 19:52
Nekshan4-Apr-07 19:52 
AnswerRe: Query. Pin
andre_swnpl4-Apr-07 20:40
andre_swnpl4-Apr-07 20:40 
QuestionRegular Expression to remove single line comments Pin
irsh_is4-Apr-07 19:49
irsh_is4-Apr-07 19:49 
QuestionTo get the country names Pin
John.L.Ponratnam4-Apr-07 19:49
John.L.Ponratnam4-Apr-07 19:49 
AnswerRe: To get the country names Pin
Tamimi - Code4-Apr-07 20:38
Tamimi - Code4-Apr-07 20:38 
GeneralRe: To get the country names Pin
John.L.Ponratnam4-Apr-07 21:07
John.L.Ponratnam4-Apr-07 21: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.