~xionox/ubufox/restart.notifier

« back to all changes in this revision

Viewing changes to content/updateRestart.js

  • Committer: XioNoX
  • Date: 2008-07-09 14:33:09 UTC
  • Revision ID: xionox@gmail.com-20080709143309-sng43u6xkg1j06eg
modified:
  content/updateRestart.js
        - Verify it the update file exist

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
function checkmodif()
33
33
{
34
 
 
 
34
        
35
35
        var ResReqFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
36
36
        ResReqFile.initWithPath("/var/lib/update-notifier/user.d/firefox-3.0-restart-required");
37
 
        var DateResReq = ResReqFile.lastModifiedTime;
38
 
 
39
 
        var ProDir = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile);
40
 
        var DateProDir = ProDir.lastModifiedTime;
41
 
 
42
 
        if(DateResReq > DateProDir)
 
37
        if(ResReqFile.exist)
43
38
        {
44
 
                affresbar();
 
39
                var DateResReq = ResReqFile.lastModifiedTime;
 
40
                var ProDir = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile);
 
41
                var DateProDir = ProDir.lastModifiedTime;
 
42
 
 
43
                if(DateResReq > DateProDir)
 
44
                {
 
45
                        affresbar();
 
46
                }
45
47
        }
46
 
        
47
48
}
48
49
 
49
50