
But there's one litte tiny thing that's going on my mind:
I wonder if it's possible to implement an automatic update function that works like following:
- Upcoming version creates a service like ucpatcher.exe that runs with elevated rights to avoid UAC
- ucpatcher.exe runs persistent in the user context of SYSTEM or Trusted Installer or something like that(elevated rights), maybe automatic - delayed to make sure you're already connected
Please regard my proposal only as some kind of pseudo code due to my lacking coding experience
Code: Select all
public class ucpatcher{ //define and init vars private const $url string 'https://iamyourdownloadserver.com'; private const $default_uc_local string = '%programfiles%/Ultracopier'; public const $scan_interval long = 604800; //7*24*60*60 = 604.800 seconds aka 1 week should be sufficient public const $ping_threshold int = 200; private const $ping_value int = 0; private const $local_file string null; private const $remote_file string null; public const $race_condition boolean = true; private const $local_version string = 'w.x.y.z'; //currently installed version should be hardcoded right here //do the dirty work while($race_condition)// an infinite loop should do the trick, doesn't it? { // Try to get a ping to the download server public int get_ping_remote(ping $url){ return $ping_value; } if ($ping_value >= $ping_threshold) { message: 'Connection error'; die; } else { //Check file integrity if crc32($local_file == $remote_file) //You can take other hash methods as well if you like { message: 'Congratulations, you've got the latest version'; return null; end; } else { get_version($version) message: 'New version available: %1'; // patch the whole content of $default_uc_local, maybe the core functions of the copy engine of UC can be used for that // progress bar like VLC would be awesome but is not necessary } endif; } sleep $scan_interval; //wait for the preconfigure time (in seconds), then do it again endif; } }
Greetings
Bobbele1984