VirtualBox

Changeset 96431 in vbox


Ignore:
Timestamp:
Aug 23, 2022 8:39:25 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
153261
Message:

ValidationKit/testdriver/vboxinstaller.py: Added options --[no-]-win-install-mscrt to download + install the current MS Visual Studio Redistributable on Windows hosts. See @todo. bugref:10284

File:
1 edited

Legend:

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

    r96407 r96431  
    8585        self._fKernelDrivers          = True;
    8686        self._fWinForcedInstallTimestampCA = True;
     87        self._fInstallMSCRT = False; # By default we don't install any CRT.
    8788
    8889    #
     
    110111        reporter.log('      If not forced, it will only installed on the hosts that needs it.');
    111112        reporter.log('      Default: --no-forced-win-install-timestamp-ca');
     113        reporter.log('  --win-install-mscrt, --no-win-install-mscrt');
     114        reporter.log('      Whether to install the MS Visual Studio Redistributable.');
     115        reporter.log('      Default: --no-win-install-mscrt');
    112116        reporter.log('  --');
    113117        reporter.log('      Indicates the end of our parameters and the start of the sub');
     
    142146        elif asArgs[iArg] == '--forced-win-install-timestamp-ca':
    143147            self._fWinForcedInstallTimestampCA = True;
     148        elif asArgs[iArg] == '--no-win-install-mscrt':
     149            self._fInstallMSCRT = False;
     150        elif asArgs[iArg] == '--win-install-mscrt':
     151            self._fInstallMSCRT = True;
    144152        else:
    145153            return TestDriverBase.parseOption(self, asArgs, iArg);
     
    925933            return None; # There shouldn't be anything to uninstall, and if there is, it's not our fault.
    926934
     935        #
     936        # Install the MS Visual Studio Redistributable, if needed.
     937        #
     938        # Since VBox 7.0 this is a prerequisite, as we don't ship our own redistributable files anymore.
     939        #
     940        if self._fInstallMSCRT:
     941            reporter.log('Installing MS Visual Studio Redistributable ...');
     942            sName = "vc_redist.x64.exe"
     943            ## @todo Can we cache this somewhere, so that we don't need to download this everytime?
     944            sUrl  = "https://aka.ms/vs/17/release/" + sName # Permalink, according to MS.
     945            if webutils.downloadFile(sUrl, sName, self.sBuildPath, reporter.log, reporter.log) is not True:
     946                sExe   = os.path.join(self.sBuildPath, sName);
     947                asArgs = [ sExe, '/Q' ];
     948                fRc2, iRc = self._sudoExecuteSync(asArgs);
     949                if fRc2 is False:
     950                    reporter.error('Installing MS Visual Studio Redistributable failed, exit code: %s' % (iRc,));
     951                    return False;
     952                reporter.log('Installing MS Visual Studio Redistributable done');
     953
    927954        # We need the help text to detect supported options below.
    928955        reporter.log('Executing: %s' % ([sExe, '--silent', '--help'], ));
Note: See TracChangeset for help on using the changeset viewer.

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