Because the boss does not allow the use of smart client, you have to download, overwrite, and restart the application. Program Step 3
First, we need a loader program to guide the main program.
Http://files.cnblogs.com/wildfish/AppUpdateStarter.rar
Second, in the main program
// Obtains the assembly of the dock system.
// Case Sensitive
Assembly ASM = Assembly. loadfrom (application. startuppath + Path. directoryseparatorchar + " SD. dll " );
// Get version information
String Curversion = Versionconfig. getversion (ASM );
// Confirmation window
Form_updateconfirm confirmform = New Form_updateconfirm ();
// Verify version object
Checkversionsystem checkversion = New Checkversionsystem (confirmform, " Sdsystem " , Curversion, application. startuppath, False );
Bool Needrestart = False ;
// Update status window
Form_updatestate stateform = New Form_updatestate (checkversion );
// Judge version and try to upgrade
Checkversion. tryupdate ( Ref Needrestart );
// If you need to restart
If (Needrestart)
{
Environment. exitcode = 2 ; // The surrounding appstarter must look for this to restart the app.
MessageBox. Show ( " Prompt: the system has been updated! Please restart! " , " Updated " );
}
Else
{
Form_sd_main doc_sd= NewForm_sd_main ();
Application. Run (doc_sd );
}
Step 3: Install the program in the following directory
The Directory of the outer layer, a loader, a configuration file, and a folder of the application.
This is the content in the penavicoxm folder.
In this way, we can control the upgrade of the application system.
Of course, this method has a disadvantage. Users cannot update the system in a timely and effective manner, and the update will be reflected only when they enter the system again.
If you want to use the Smart Client in a timely manner, or use the B/S architecture :)