VirtualBox

Ignore:
Timestamp:
Jul 20, 2022 7:02:32 PM (2 years ago)
Author:
vboxsync
Message:

ValKit/vboxinstaller.py: Implemented the installer parameter support detection, getting rid of the idea that 6.1 and trunk always supported --msi-log-file. bugref:8691

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testdriver/vboxinstaller.py

    r95761 r95762  
    915915            return None; # There shouldn't be anything to uninstall, and if there is, it's not our fault.
    916916
    917         fGreaterOrEqual61 = True; ## @todo Parse the --version output from the executable.
    918         fSupportsForceTsCAInstall = True; ## @todo Parse the --help output.
     917        # We need the help text to detect supported options below.
     918        reporter.log('Executing: %s' % ([sExe, '--silent', '--help'], ));
     919        reporter.flushall();
     920        (iExitCode, sHelp, _) = utils.processOutputUnchecked([sExe, '--silent', '--help'], fIgnoreEncoding = True);
     921        reporter.log('Exit code: %d, %u chars of help text' % (iExitCode, len(sHelp),));
    919922
    920923        # Gather installer arguments.
     
    925928            asArgs.extend(['INSTALLDIR="%s"' % (sVBoxInstallPath,)]);
    926929
    927         if fGreaterOrEqual61:
    928             # We need to explicitly specify the location, otherwise the log would end up at a random location.
    929             sLogFile = os.path.join(tempfile.gettempdir(), 'VBoxInstallLog.txt');
     930        if sHelp.find("--msi-log-file") >= 0:
     931            ## @todo why do we use the TMP dir?  This belongs in the scratch dir (which may be a lot faster than TMP).
     932            sLogFile = os.path.join(tempfile.gettempdir(), 'VBoxInstallLog.txt'); # Specify location to prevent a random one.
    930933            asArgs.extend(['--msi-log-file', sLogFile]);
    931         else: # Prior to 6.1 the location was hardcoded.
    932             sLogFile = os.path.join(tempfile.gettempdir(), 'VirtualBox', 'VBoxInstallLog.txt');
    933 
    934         if fSupportsForceTsCAInstall and self._fWinForcedInstallTimestampCA:
     934        else:
     935            sLogFile = os.path.join(tempfile.gettempdir(), 'VirtualBox', 'VBoxInstallLog.txt'); # Hardcoded TMP location.
     936
     937        if self._fWinForcedInstallTimestampCA and sHelp.find("--force-install-timestamp-ca") >= 0:
    935938            asArgs.extend(['--force-install-timestamp-ca']);
    936939
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette