Ejemplo n.º 1
0
    def test_FindToolInWinSdk(self):
        results = locate_tools.FindToolInWinSdk("signtool.exe")
        self.assertIsNotNone(results)
        self.assertTrue(os.path.isfile(results))

        results = locate_tools.FindToolInWinSdk(
            "this_tool_should_never_exist.exe")
        self.assertIsNone(results)
Ejemplo n.º 2
0
def get_signtool_path():
    '''
    helper function to locate a valid installation of Windows Signtool. Will
    attempt to reuse a previously located version, since this call can be
    lengthy
    '''
    global GLOBAL_SIGNTOOL_PATH

    if GLOBAL_SIGNTOOL_PATH is None:
        GLOBAL_SIGNTOOL_PATH = locate_tools.FindToolInWinSdk('signtool.exe')

    return GLOBAL_SIGNTOOL_PATH
Ejemplo n.º 3
0
 def do_pre_build(self, thebuilder):
     #get the locate tools module
     path = locate_tools.FindToolInWinSdk("rc.exe")
     if path is None:
         thebuilder.logging.warning("Failed to find rc.exe")
     else:
         p = os.path.abspath(os.path.dirname(path))
         shell_environment.GetEnvironment().set_shell_var(
             "WINSDK_PATH_FOR_RC_EXE", p)
         version_aggregator.GetVersionAggregator().ReportVersion(
             "WINSDK_PATH_FOR_RC_EXE", p,
             version_aggregator.VersionTypes.INFO)
     return 0
Ejemplo n.º 4
0
 def test_FindInf2CatToolInWinSdk(self):
     results = locate_tools.FindToolInWinSdk("inf2cat.exe")
     self.assertIsNotNone(results)
     self.assertTrue(os.path.isfile(results))
Ejemplo n.º 5
0
 def test_FindToolInWinSdkWithNoValidProduct(self):
     results = locate_tools.FindToolInWinSdk("WontFind.exe",
                                             product="YouWontFindThis")
     self.assertIsNone(results)