コード例 #1
0
 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()))
コード例 #2
0
 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)
コード例 #3
0
 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))
コード例 #4
0
 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'))
コード例 #5
0
 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)
コード例 #6
0
 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))
コード例 #7
0
 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)
コード例 #8
0
 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)
コード例 #9
0
 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)
コード例 #10
0
 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()))
コード例 #11
0
 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()))