Click here to Skip to main content
15,894,460 members
Home / Discussions / C#
   

C#

 
AnswerRe: Multiple Applications writing to one Excel Spreadsheet Pin
shamidi4-Apr-07 6:51
shamidi4-Apr-07 6:51 
GeneralRe: Multiple Applications writing to one Excel Spreadsheet Pin
Dave Kreskowiak4-Apr-07 12:17
mveDave Kreskowiak4-Apr-07 12:17 
QuestionGet position order from coordenates Pin
Diego F.4-Apr-07 5:57
Diego F.4-Apr-07 5:57 
AnswerRe: Get position order from coordenates Pin
Diego F.4-Apr-07 6:04
Diego F.4-Apr-07 6:04 
GeneralRe: Get position order from coordenates Pin
Diego F.4-Apr-07 6:11
Diego F.4-Apr-07 6:11 
Questionhow to work with ClickOnce for automatic updation Pin
pashitech4-Apr-07 5:55
pashitech4-Apr-07 5:55 
AnswerRe: how to work with ClickOnce for automatic updation Pin
rvlemmings4-Apr-07 6:32
rvlemmings4-Apr-07 6:32 
GeneralRe: how to work with ClickOnce for automatic updation Pin
pashitech4-Apr-07 21:19
pashitech4-Apr-07 21:19 
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);
}

}

void appDeploy_UpdateCompleted(object sender, AsyncCompletedEventArgs e)
{
string s = String.Format("UpdateCompleted canceled?{0}, sender: {1}", e.Cancelled, sender);
listBox1.Items.Add(s);

}

void appDeploy_UpdateProgressChanged(object sender, DeploymentProgressChangedEventArgs e)
{
string s = String.Format("UpdateProgressChanged {0}, sender: {1}", e.State, sender);
listBox1.Items.Add(s);
}

void appDeploy_CheckForUpdateCompleted(object sender, CheckForUpdateCompletedEventArgs e)
{
string s = String.Format("CheckForUpdateCompleted {0}, sender: {1}", e.UpdateAvailable, sender);
listBox1.Items.Add(s);

}

void appDeploy_CheckForUpdateProgressChanged(object sender, DeploymentProgressChangedEventArgs e)
{
string s = String.Format("CheckForUpdateProgressChanged {0}, sender: {1}", e.State, sender);
listBox1.Items.Add(s);

}
}



Hope You got me,
please help me thnx in advance

prashanth,
s/w Engineer,
Syfnosys.
GeneralRe: how to work with ClickOnce for automatic updation Pin
roel_v4-Apr-07 21:29
roel_v4-Apr-07 21:29 
GeneralRe: how to work with ClickOnce for automatic updation Pin
roel_v5-Apr-07 0:16
roel_v5-Apr-07 0:16 
GeneralRe: how to work with ClickOnce for automatic updation Pin
pashitech5-Apr-07 2:15
pashitech5-Apr-07 2:15 
GeneralRe: how to work with ClickOnce for automatic updation Pin
roel_v5-Apr-07 2:23
roel_v5-Apr-07 2:23 
AnswerRe: how to work with ClickOnce for automatic updation Pin
roel_v5-Apr-07 0:34
roel_v5-Apr-07 0:34 
QuestionRetrieving columns from joined tables in sql Pin
dboy2214-Apr-07 5:52
dboy2214-Apr-07 5:52 
AnswerRe: Retrieving columns from joined tables in sql Pin
Russell Jones4-Apr-07 5:58
Russell Jones4-Apr-07 5:58 
GeneralRe: Retrieving columns from joined tables in sql Pin
dboy2214-Apr-07 6:19
dboy2214-Apr-07 6:19 
QuestionProblems getting the MDI parent Pin
sinosoidal4-Apr-07 5:50
sinosoidal4-Apr-07 5:50 
AnswerRe: Problems getting the MDI parent Pin
netJP12L4-Apr-07 9:44
netJP12L4-Apr-07 9:44 
QuestionHelp regarding open source c# project Pin
monkeyx4-Apr-07 5:38
monkeyx4-Apr-07 5:38 
AnswerRe: Help regarding open source c# project Pin
Douglas Troy4-Apr-07 6:07
Douglas Troy4-Apr-07 6:07 
QuestionPass By Ref Pin
swjam4-Apr-07 5:14
swjam4-Apr-07 5:14 
AnswerRe: Pass By Ref Pin
Russell Jones4-Apr-07 6:04
Russell Jones4-Apr-07 6:04 
AnswerRe: Pass By Ref Pin
Vikram A Punathambekar4-Apr-07 17:39
Vikram A Punathambekar4-Apr-07 17:39 
QuestionMemory leak Pin
HexaDeveloper4-Apr-07 5:11
HexaDeveloper4-Apr-07 5:11 
AnswerRe: Memory leak Pin
Russell Jones4-Apr-07 6:06
Russell Jones4-Apr-07 6:06 

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.