<volume-check script="volumeCheck()"/>
<script>
function volumeCheck()
{
// if they have some file, they cannot install on that volume
if (system.files.fileExistsAtPath('whatever'))
{
my.result.title = system.localizedString('TITLE_ERROR');
my.result.message = system.localizedStringWithFormat('ERROR_ERROR');
my.result.type = 'Fatal';
return false;
}
}
In bundle packages, there's a file called VolumeCheck, which returns an error code.