def IncludeInstallerSource(self, value): if value not in ('true', 'false'): return ValidatorError(LANG.INIVALIDATOR.BOOL_BAD % dict(filename=self.validator.path(), section='Source', key='IncludeInstallerSource')) elif value == 'false': return ValidatorWarning(LANG.INIVALIDATOR.OMIT_DEFAULT % dict(filename=self.validator.path(), section='Source', key='IncludeInstallerSource', default='false')) else: return ValidatorWarning(LANG.INSTALLER.INCLUDEINSTALLERSOURCE % dict(filename=self.validator.path()))
def ExtractIcon(self, value): if not os.path.isfile(self.package.path(value)): return ValidatorError(LANG.APPINFO.CONTROL_FILE_NOT_EXIST % dict(section='Control', key='ExtractIcon')) else: return ValidatorWarning( LANG.APPINFO.CONTROL_EXTRACTICON_OMIT_UNLESS_REQUIRED)
def Description(self, value): chars = len(value) if chars > 512: return ValidatorError(LANG.APPINFO.DETAILS_DESCRIPTION_TOO_LONG) elif chars > 150: return ValidatorWarning(LANG.APPINFO.DETAILS_DESCRIPTION_LONG % dict(chars=chars))
def Start(self, value): if '/' in value or '\\' in value: return ValidatorWarning(LANG.APPINFO.CONTROL_START_NO_SUBDIRS % dict(section='Control', key='Start')) elif not os.path.isfile(self.package.path(value)): return ValidatorError(LANG.APPINFO.CONTROL_FILE_NOT_EXIST % dict(section='Control', key='Start'))
def Plugins(self, value): if value == 'NONE': return ValidatorWarning(LANG.INIVALIDATOR.OMIT_DEFAULT % dict(filename=self.validator.path(), section='SpecialPaths', key='Plugins', default='NONE')) elif not os.path.isdir(self.package.path(value)): return ValidatorError(LANG.APPINFO.SPECIALPATHS_PLUGINS_BAD)
def Version(self, value): if value != FORMAT_VERSION: if value < FORMAT_VERSION: return ValidatorWarning( LANG.APPINFO.OLD_FORMAT_VERSION % dict(old_version=value, current_version=FORMAT_VERSION)) else: return ValidatorError(LANG.APPINFO.BAD_FORMAT_VERSION % dict(version=FORMAT_VERSION))
def UsesDotNetVersion(self, value): if value not in ('1.1', '2.0', '3.0', '3.5', '4.0'): return ValidatorWarning( LANG.APPINFO.DEPENDENCIES_USESDOTNETVERSION_PROBABLY_BAD) else: try: map(int, value.split('.')) except ValueError: return ValidatorError( LANG.APPINFO.DEPENDENCIES_USESDOTNETVERSION_BAD)
def UsesGhostscript(self, value): if value == 'no': return ValidatorWarning(LANG.INIVALIDATOR.OMIT_DEFAULT % dict(filename=self.validator.path(), section='Dependencies', key='UsesGhostscript', default='no')) elif value not in ('yes', 'optional'): return ValidatorError( LANG.APPINFO.DEPENDENCIES_USESGHOSTSCRIPT_BAD)
def UsesJava(self, value): if value == 'no': return ValidatorWarning(LANG.INIVALIDATOR.OMIT_DEFAULT % dict(filename=self.validator.path(), section='Dependencies', key='UsesJava', default='no')) elif value in ('true', 'false'): if value == 'true': new_value = 'yes' elif value == 'false': new_value = 'no' return ValidatorError(LANG.INIVALIDATOR.VALUE_DEPRECATED % dict(filename=self.validator.path(), section='Dependencies', key='UsesJava', old_value=value, new_value=new_value)) elif value not in ('yes', 'optional'): return ValidatorError(LANG.APPINFO.DEPENDENCIES_USESJAVA_BAD)
def CloseName(self, value): if self.package.appinfo.ini and self.package.appinfo.ini.Details.Name == value: return ValidatorWarning(LANG.INSTALLER.CLOSENAME_SAME_AS_APPINFO % dict(filename=self.validator.path()))
def CloseEXE(self, value): if not value.endswith('.exe') and value != 'NONE': return ValidatorWarning( LANG.INSTALLER.CHECKRUNNING_CLOSEEXE_NOT_EXE % dict(filename=self.validator.path()))