VirtualBox

Ignore:
Timestamp:
Jun 13, 2013 12:10:23 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
86380
Message:

Main/IGuest::UpdateGuestAdditions: Implemented support for passing optional command line arguments to the performing installer on the guest (untested).

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox

  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp

    r46009 r46524  
    261261                 "                            [--source <guest additions .ISO>] [--verbose]\n"
    262262                 "                            [--wait-start]\n"
     263                 "                            [-- [<argument1>] ... [<argumentN>]]\n"
    263264                 "\n", pcszSep1, pcszSep2);
    264265}
     
    633634    com::SafeArray<ProcessCreateFlag_T>  aCreateFlags;
    634635    com::SafeArray<ProcessWaitForFlag_T> aWaitFlags;
    635     com::SafeArray<IN_BSTR>              args;
    636     com::SafeArray<IN_BSTR>              env;
     636    com::SafeArray<IN_BSTR>              aArgs;
     637    com::SafeArray<IN_BSTR>              aEnv;
    637638    Utf8Str                              strUsername;
    638639    Utf8Str                              strPassword;
     
    669670                    return errorSyntax(USAGE_GUESTCONTROL, "Failed to parse environment value, rc=%Rrc", vrc);
    670671                for (int j = 0; j < cArgs; j++)
    671                     env.push_back(Bstr(papszArg[j]).raw());
     672                    aEnv.push_back(Bstr(papszArg[j]).raw());
    672673
    673674                RTGetOptArgvFree(papszArg);
     
    742743            case VINF_GETOPT_NOT_OPTION:
    743744            {
    744                 if (args.size() == 0 && strCmd.isEmpty())
     745                if (aArgs.size() == 0 && strCmd.isEmpty())
    745746                    strCmd = ValueUnion.psz;
    746747                else
    747                     args.push_back(Bstr(ValueUnion.psz).raw());
     748                    aArgs.push_back(Bstr(ValueUnion.psz).raw());
    748749                break;
    749750            }
     
    837838        ComPtr<IGuestProcess> pProcess;
    838839        rc = pGuestSession->ProcessCreate(Bstr(strCmd).raw(),
    839                                           ComSafeArrayAsInParam(args),
    840                                           ComSafeArrayAsInParam(env),
     840                                          ComSafeArrayAsInParam(aArgs),
     841                                          ComSafeArrayAsInParam(aEnv),
    841842                                          ComSafeArrayAsInParam(aCreateFlags),
    842843                                          cMsTimeout,
     
    26522653     */
    26532654    Utf8Str strSource;
     2655    com::SafeArray<IN_BSTR> aArgs;
    26542656    bool fVerbose = false;
    26552657    bool fWaitStartOnly = false;
     
    26842686                fWaitStartOnly = true;
    26852687                break;
     2688
     2689            case VINF_GETOPT_NOT_OPTION:
     2690            {
     2691                if (aArgs.size() == 0 && strSource.isEmpty())
     2692                    strSource = ValueUnion.psz;
     2693                else
     2694                    aArgs.push_back(Bstr(ValueUnion.psz).raw());
     2695                break;
     2696            }
    26862697
    26872698            default:
     
    27312742        ComPtr<IProgress> pProgress;
    27322743        CHECK_ERROR(guest, UpdateGuestAdditions(Bstr(strSource).raw(),
     2744                                                ComSafeArrayAsInParam(aArgs),
    27332745                                                /* Wait for whole update process to complete. */
    27342746                                                ComSafeArrayAsInParam(aUpdateFlags),
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