Changeset 68071 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Jul 20, 2017 4:24:08 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r68055 r68071 1286 1286 int fInstallTxs = -1; 1287 1287 const char *pszMachineName = NULL; 1288 Utf8Str strAbsSettingsFile;1289 const char *pszSettingsFile = NULL;1290 1288 bool fSetImageIdx = false; 1291 1289 uint32_t idxImage = 0; … … 1295 1293 Utf8Str strAbsScriptTemplatePath; 1296 1294 const char *pszScriptTemplatePath = NULL; 1295 Utf8Str strAbsPostInstallScriptTemplatePath; 1296 const char *pszPostInstallScriptTemplatePath = NULL; 1297 1297 const char *pszSessionType = "headless"; 1298 1298 … … 1319 1319 { "--image-index", 'm', RTGETOPT_REQ_UINT32 }, 1320 1320 { "--script-template", 'c', RTGETOPT_REQ_STRING }, 1321 { "--post-install-template", 'C', RTGETOPT_REQ_STRING }, 1321 1322 { "--post-install-command", 'P', RTGETOPT_REQ_STRING }, 1322 { "--settings-file", 's', RTGETOPT_REQ_STRING },1323 1323 { "--session-type", 'S', RTGETOPT_REQ_STRING }, 1324 1324 }; … … 1342 1342 break; 1343 1343 1344 case 's': // --settings-file <key value file>1345 vrc = RTPathAbsCxx(strAbsSettingsFile, ValueUnion.psz);1346 if (RT_FAILURE(vrc))1347 return errorSyntax(USAGE_UNATTENDEDINSTALL, "RTPathAbsCxx failed on '%s': %Rrc", ValueUnion.psz, vrc);1348 pszSettingsFile = strAbsSettingsFile.c_str();1349 break;1350 1351 1344 case 'i': // --iso 1352 1345 vrc = RTPathAbsCxx(strAbsIsoPath, ValueUnion.psz); … … 1417 1410 break; 1418 1411 1412 case 'C': // --post-install-script-template 1413 vrc = RTPathAbsCxx(strAbsPostInstallScriptTemplatePath, ValueUnion.psz); 1414 if (RT_FAILURE(vrc)) 1415 return errorSyntax(USAGE_UNATTENDEDINSTALL, "RTPathAbsCxx failed on '%s': %Rrc", ValueUnion.psz, vrc); 1416 pszPostInstallScriptTemplatePath = strAbsPostInstallScriptTemplatePath.c_str(); 1417 break; 1418 1419 1419 case 'P': // --post-install-command. 1420 1420 pszPostInstallCommand = ValueUnion.psz; … … 1436 1436 return errorSyntax(USAGE_UNATTENDEDINSTALL, "Missing VM name/UUID"); 1437 1437 1438 if (!psz SettingsFile && !pszIsoPath)1439 return errorSyntax(USAGE_UNATTENDEDINSTALL, "Missing required --iso (or --settings-file)option");1438 if (!pszIsoPath) 1439 return errorSyntax(USAGE_UNATTENDEDINSTALL, "Missing required --iso option"); 1440 1440 1441 1441 /* … … 1486 1486 ComPtr<IUnattended> ptrUnattended; 1487 1487 CHECK_ERROR_BREAK(machine, CreateUnattendedInstaller(ptrUnattended.asOutParam())); 1488 1489 if (pszSettingsFile)1490 CHECK_ERROR_BREAK(ptrUnattended, LoadSettings(Bstr(pszSettingsFile).raw()));1491 1488 1492 1489 if (pszIsoPath) … … 1512 1509 if (pszScriptTemplatePath) 1513 1510 CHECK_ERROR_BREAK(ptrUnattended, COMSETTER(ScriptTemplatePath)(Bstr(pszScriptTemplatePath).raw())); 1511 if (pszPostInstallScriptTemplatePath) 1512 CHECK_ERROR_BREAK(ptrUnattended, COMSETTER(PostInstallScriptTemplatePath)(Bstr(pszPostInstallScriptTemplatePath).raw())); 1514 1513 if (pszPostInstallCommand) 1515 1514 CHECK_ERROR_BREAK(ptrUnattended, COMSETTER(PostInstallCommand)(Bstr(pszPostInstallCommand).raw())); … … 1529 1528 HRESULT hrc2 = ptrUnattended->COMGETTER(a_Attr)(&Value); \ 1530 1529 if (SUCCEEDED(hrc2)) \ 1531 RTPrintf(" % 22s = " a_szFmt "\n", a_szText, Value); \1530 RTPrintf(" %32s = " a_szFmt "\n", a_szText, Value); \ 1532 1531 else \ 1533 RTPrintf(" % 22s = failed: %Rhrc\n", a_szText, hrc2); \1532 RTPrintf(" %32s = failed: %Rhrc\n", a_szText, hrc2); \ 1534 1533 } while (0) 1535 1534 #define SHOW_STR_ATTR(a_Attr, a_szText) do { \ … … 1537 1536 HRESULT hrc2 = ptrUnattended->COMGETTER(a_Attr)(bstrString.asOutParam()); \ 1538 1537 if (SUCCEEDED(hrc2)) \ 1539 RTPrintf(" % 22s = %ls\n", a_szText, bstrString.raw()); \1538 RTPrintf(" %32s = %ls\n", a_szText, bstrString.raw()); \ 1540 1539 else \ 1541 RTPrintf(" % 22s = failed: %Rhrc\n", a_szText, hrc2); \1540 RTPrintf(" %32s = failed: %Rhrc\n", a_szText, hrc2); \ 1542 1541 } while (0) 1543 1542 … … 1554 1553 SHOW_ATTR( ImageIndex, "imageIndex", ULONG, "%u"); 1555 1554 SHOW_STR_ATTR(ScriptTemplatePath, "scriptTemplatePath"); 1555 SHOW_STR_ATTR(PostInstallScriptTemplatePath, "postInstallScriptTemplatePath"); 1556 1556 SHOW_STR_ATTR(PostInstallCommand, "postInstallCommand"); 1557 1557
Note:
See TracChangeset
for help on using the changeset viewer.