VirtualBox

Changeset 103028 in vbox for trunk/src/VBox/Installer/win


Ignore:
Timestamp:
Jan 24, 2024 3:53:59 PM (10 months ago)
Author:
vboxsync
Message:

Main/Python: Big revamp to modernize our vboxapi Python package to now use a so-called src-layout, which also can be used with pip directly. Also added compatibility w/ Python 3.12 where distutils are not shipped anymore. We also now do have automatic linting for our code, which hopefully should improve quality in this area. Moved some Python-related files into an own sub folder so that it's more clear to which these belong to. The "sdk/installer" directories also have an own "python" sub directory where the stuff resides now. The Windows installer also uses "sdk/installer" instead of "sdk/install", to match the other platforms. bugref:10579

Location:
trunk/src/VBox/Installer/win
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp

    r100687 r103028  
    608608     */
    609609    /* Get the VBox API setup string. */
    610     WCHAR wszVBoxSDKPath[RTPATH_MAX];
    611     rcWin = VBoxGetMsiProp(hModule, L"CustomActionData", wszVBoxSDKPath, RT_ELEMENTS(wszVBoxSDKPath));
     610    WCHAR wszVBoxPythonInstallerPath[RTPATH_MAX];
     611    rcWin = VBoxGetMsiProp(hModule, L"CustomActionData", wszVBoxPythonInstallerPath, RT_ELEMENTS(wszVBoxPythonInstallerPath));
    612612    if (rcWin == ERROR_SUCCESS)
    613613    {
    614614        /* Make sure our current working directory is the VBox installation path. */
    615         if (SetCurrentDirectoryW(wszVBoxSDKPath))
     615        if (SetCurrentDirectoryW(wszVBoxPythonInstallerPath))
    616616        {
    617617            /* Set required environment variables. */
    618             if (SetEnvironmentVariableW(L"VBOX_INSTALL_PATH", wszVBoxSDKPath))
    619             {
    620                 logStringF(hModule, "InstallPythonAPI: Invoking vboxapisetup.py in \"%ls\" ...", wszVBoxSDKPath);
     618            if (SetEnvironmentVariableW(L"VBOX_INSTALL_PATH", wszVBoxPythonInstallerPath)) /** @todo BUGBUG r=andy That can't be right! */
     619            {
     620                logStringF(hModule, "InstallPythonAPI: Invoking vboxapisetup.py in \"%ls\" ...", wszVBoxPythonInstallerPath);
    621621
    622622                rcWin = procRun(hModule, wszPythonExe, L"vboxapisetup.py install");
     
    650650        else
    651651            logStringF(hModule, "InstallPythonAPI: Could set working directory to \"%ls\": LastError=%u",
    652                        wszVBoxSDKPath, GetLastError());
     652                       wszVBoxPythonInstallerPath, GetLastError());
    653653    }
    654654    else
  • trunk/src/VBox/Installer/win/VBoxMergePython.wxi

    r98103 r103028  
    3333    <Component Id="cp_VBoxPyInst" Guid="C9A40306-5102-11DE-A7BA-C3C555D89593" Win64="$(var.Property_Win64)">
    3434         <File Id="file_vboxapisetup.py" Name="vboxapisetup.py"
    35                Source="$(env.PATH_OUT)\bin\sdk\installer\vboxapisetup.py"
     35               Source="$(env.PATH_OUT)\bin\sdk\installer\python\vboxapisetup.py"
    3636               DiskId="$(var.Property_DiskIdCommon)" />
    3737    </Component>
     
    3939        <Component Id="cp_VBoxPyMod" Guid="DF19CB76-5102-11DE-943B-13C755D89593" Win64="$(var.Property_Win64)">
    4040            <File Id="file___init__.py" Name="__init__.py"
    41                   Source="$(env.PATH_OUT)\bin\sdk\installer\vboxapi\__init__.py"
     41                  Source="$(env.PATH_OUT)\bin\sdk\installer\python\vboxapi\__init__.py"
    4242                  DiskId="$(var.Property_DiskIdCommon)" />
    4343            <File Id="file_VirtualBox_constants.py" Name="VirtualBox_constants.py"
    44                   Source="$(env.PATH_OUT)\bin\sdk\installer\vboxapi\VirtualBox_constants.py"
     44                  Source="$(env.PATH_OUT)\bin\sdk\installer\python\vboxapi\VirtualBox_constants.py"
    4545                  DiskId="$(var.Property_DiskIdCommon)" />
    4646        </Component>
  • trunk/src/VBox/Installer/win/VirtualBox.wxs

    r98103 r103028  
    384384                <Directory Id="dir_SDK" Name="sdk">
    385385<?if $(env.VBOX_WITH_PYTHON) = "yes" ?>
    386                     <Directory Id="dir_SDKInstall" Name="install">
    387     <?if $(env.VBOX_WITH_MSM_INSTALL) = "yes" ?>
    388                         <Merge Id="msm_VBoxPython" Language="!(loc.LANG)" SourceFile="$(var.Property_VBoxMergePython)" DiskId="1" />
    389     <?else ?>
    390                         <Directory Id="msm_VBoxPythonFolder" FileSource=".">
    391                             <?include VBoxMergePython.wxi ?>
     386                    <Directory Id="dir_SDKInstaller" Name="installer"> <!-- Note: For < VBox 7.1 this folder was called 'install'. -->
     387                        <Directory Id="dir_SDKInstallerPython" Name="python">
     388        <?if $(env.VBOX_WITH_MSM_INSTALL) = "yes" ?>
     389                            <Merge Id="msm_VBoxPython" Language="!(loc.LANG)" SourceFile="$(var.Property_VBoxMergePython)" DiskId="1" />
     390        <?else ?>
     391                            <Directory Id="msm_VBoxPythonFolder" FileSource=".">
     392                                <?include VBoxMergePython.wxi ?>
     393                            </Directory>
     394        <?endif ?>
    392395                        </Directory>
    393     <?endif ?>
    394396                    </Directory>
    395397<?endif ?>
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