home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 February
/
PCWorld_2006-02_cd.bin
/
komunikace
/
thunderbird
/
cs_spell.exe
/
cs_spell.xpi
/
install.js
Wrap
Text File
|
2003-10-28
|
1KB
|
44 lines
// this function verifies disk space in kilobytes
function verifyDiskSpace(dirPath, spaceRequired)
{
var spaceAvailable;
// Get the available disk space on the given path
spaceAvailable = fileGetDiskSpaceAvailable(dirPath);
// Convert the available disk space into kilobytes
spaceAvailable = parseInt(spaceAvailable / 1024);
// do the verification
if(spaceAvailable < spaceRequired)
{
logComment("Insufficient disk space: " + dirPath);
logComment(" required : " + spaceRequired + " K");
logComment(" available: " + spaceAvailable + " K");
return(false);
}
return(true);
}
var srDest = 2350; // required kilobytes for files
var err = initInstall("Czech spellchecker for Mozilla and Mozilla Thunderbird", "Czech spellchecker", "1.0.0.0");
logComment("initInstall: " + err);
if (verifyDiskSpace(getFolder("Components"), srDest))
{
var myspell = getFolder("Components", "myspell");
addDirectory("Czech spellchecker", "1.0.0.0", "dict", myspell, "");
// registry name, version, xpisourcepath, localdirspec, relativeLocalPath
if (err==SUCCESS)
performInstall();
else
cancelInstall(err);
}
else
cancelInstall(INSUFFICIENT_DISK_SPACE);