autoupgrader Self-upgrading mechansim
Return to Introduction  Previous page  Next page
Self-upgrading mechanism, how does it works?
When the AutoUpgrader downloads required files from the Web it stores them to the working directory with "*.*.uTMP" extensions. It also set for them "temporary" and "hidden" attributes, so user will not see these files.  
 
After successful downloading, the AutoUpgrader extracts so-called self-upgrading module (Upgrader3.exe, 9KB), which performs local updates to the TEMP directory, execute it then terminate the main app itself. The self-upgrading mechanism replaces all files with newer ones and restart the main application.  
 
The self-upgrading module (Upgrader3.exe) performs the local updates with following steps:  
 1. Locate program directory by exe-name transmitted as command-line parameter  
 1.1. Check whether the AutoUpgrader uses the external setup program (#method=1)  
 1.2. Split the file name and parameters  
 1.3. Split the file name and path  
 2. Test whether an exe-file exists + get the filename with correct charcase  
 3. Awaiting for termination of the main program  
 4. Test whether newer (downloaded) exe-file exists  
 5. Find all downloaded (.uTMP) files  
 5.1. If this is executable AND newest exe still not found -- trying to  
      use another suitable EXE. (This may happends if program was renamed  
      by user, or local update should be done by external setup.)  
 5.2. Rename .uTMP file to its normal name  
 6. Re-execute main program (or setup file).  
New steps, added in v3.1.1:  
 7. IF the local update should be done by external setup THEN (else terminate)  
 7.1. Wait until termination of setup program  
 7.2. Delete the setup (we don't need it anymore after installation?)  
 7.3. Restart the original main app  

Note
iiwarning If you wish to use AutoUpgrader for downloading just single setup-file which will perform all further updates — make sure that UpgradeMethod = umUseExternalSetup (#method=1 in the Info-file). Otherwise the self-upgrading module will replace your program with downloaded setup.