by karinca » August 28th, 2012, 8:36 am
ok i do it but my problem is different when i setup my app on a new computer updater is working in the first opening it checks the updates and it gets the last update when my dektop program opens firstly the updater working
but when i open my program the second time the updater doesnt work but when i click the my program update button it works but it doesnt work automaticly in the second time
my code
static AutomaticUpdaterBackend auBackend;
//static void CheckEveryOneDays()
//{
// if ((DateTime.Now - auBackend.LastCheckDate).TotalDays > 1
// && auBackend.UpdateStepOn == UpdateStepOn.Nothing)
// {
// auBackend.ForceCheckForUpdate();
// }
//}
static void auBackend_ReadyToBeInstalled(object sender, EventArgs e)
{
if (auBackend.UpdateStepOn == UpdateStepOn.UpdateReadyToInstall)
{
auBackend.InstallNow();
}
}
static void auBackend_UpdateSuccessful(object sender, SuccessArgs e)
{
}
[STAThread]
static void Main()
{
auBackend = new AutomaticUpdaterBackend{
GUID = "3711322D-DB82-4610-9E27-140CCBFDE06C",
UpdateType = UpdateType.Automatic,
};
auBackend.ReadyToBeInstalled += auBackend_ReadyToBeInstalled;
auBackend.UpdateSuccessful += auBackend_UpdateSuccessful;
auBackend.Initialize();
auBackend.AppLoaded();
if (!auBackend.ClosingForInstall)
{
//CheckEveryOneDays();
auBackend.ForceCheckForUpdate();
}
}