Changeset 42748 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 10, 2012 9:33:34 AM (12 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r42739 r42748 1424 1424 <interface 1425 1425 name="IVirtualBox" extends="$unknown" 1426 uuid=" 3b90eded-f061-432f-9e0f-4b53cc7b6fa0"1426 uuid="5c8814a1-2a35-402d-8680-68e5cb4e72aa" 1427 1427 wsmap="managed" 1428 1428 > … … 1452 1452 publisher tag, at the end. The publisher tag starts with an underscore 1453 1453 just like the prerelease build type tag. 1454 </desc> 1455 </attribute> 1456 1457 <attribute name="versionNormalized" type="wstring" readonly="yes"> 1458 <desc> 1459 A string representing the version number of the product, 1460 without the publisher information (but still with other tags). 1461 See <link to="#version" />. 1454 1462 </desc> 1455 1463 </attribute> … … 8193 8201 name="ISystemProperties" 8194 8202 extends="$unknown" 8195 uuid=" 20fc263c-e1e9-4e86-b9b0-835950790d13"8203 uuid="1d7aca29-97f0-4287-9874-a60ec4f80ea6" 8196 8204 wsmap="managed" 8197 8205 > … … 8447 8455 The path to the autostart database. Depending on the host this might 8448 8456 be a filesystem path or something else. 8457 </desc> 8458 </attribute> 8459 8460 <attribute name="defaultAdditionsISO" type="wstring"> 8461 <desc> 8462 The path to the default Guest Additions ISO image. Can be empty if 8463 the location is not known in this installation. 8449 8464 </desc> 8450 8465 </attribute> -
trunk/src/VBox/Main/include/SystemPropertiesImpl.h
r42178 r42748 7 7 8 8 /* 9 * Copyright (C) 2006-201 0Oracle Corporation9 * Copyright (C) 2006-2012 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 46 46 47 47 BEGIN_COM_MAP(SystemProperties) 48 VBOX_DEFAULT_INTERFACE_ENTRIES 48 VBOX_DEFAULT_INTERFACE_ENTRIES(ISystemProperties) 49 49 END_COM_MAP() 50 50 … … 94 94 STDMETHOD(COMGETTER(AutostartDatabasePath))(BSTR *aAutostartDbPath); 95 95 STDMETHOD(COMSETTER(AutostartDatabasePath))(IN_BSTR aAutostartDbPath); 96 STDMETHOD(COMGETTER(DefaultAdditionsISO))(BSTR *aDefaultAdditionsISO); 97 STDMETHOD(COMSETTER(DefaultAdditionsISO))(IN_BSTR aDefaultAdditionsISO); 96 98 97 99 STDMETHOD(GetMaxNetworkAdapters)(ChipsetType_T aChipset, ULONG *aMaxInstances); … … 127 129 HRESULT setDefaultVRDEExtPack(const Utf8Str &aPath); 128 130 HRESULT setAutostartDatabasePath(const Utf8Str &aPath); 131 HRESULT setDefaultAdditionsISO(const Utf8Str &aPath); 129 132 130 133 VirtualBox * const mParent; -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r42569 r42748 103 103 /* IVirtualBox properties */ 104 104 STDMETHOD(COMGETTER(Version))(BSTR *aVersion); 105 STDMETHOD(COMGETTER(VersionNormalized))(BSTR *aVersionNormalized); 105 106 STDMETHOD(COMGETTER(Revision))(ULONG *aRevision); 106 107 STDMETHOD(COMGETTER(PackageType))(BSTR *aPackageType); … … 246 247 GuestOSType*& pGuestOSType); 247 248 248 const Guid &getGlobalRegistryId() const;249 const Guid &getGlobalRegistryId() const; 249 250 250 251 const ComObjPtr<Host>& host() const; … … 284 285 void markRegistryModified(const Guid &uuid); 285 286 void saveModifiedRegistries(); 287 288 static const Bstr &getVersionNormalized(); 286 289 287 290 static HRESULT ensureFilePathExists(const Utf8Str &strFileName, bool fCreate); … … 329 332 /* static variables (defined in VirtualBoxImpl.cpp) */ 330 333 static Bstr sVersion; 334 static Bstr sVersionNormalized; 331 335 static ULONG sRevision; 332 336 static Bstr sPackageType; -
trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp
r42391 r42748 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 951 951 } 952 952 953 STDMETHODIMP SystemProperties::COMGETTER(DefaultAdditionsISO)(BSTR *aDefaultAdditionsISO) 954 { 955 CheckComArgOutPointerValid(aDefaultAdditionsISO); 956 957 AutoCaller autoCaller(this); 958 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 959 960 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 961 962 if (m->strDefaultAdditionsISO.isEmpty()) 963 { 964 /* no guest additions, check if it showed up in the mean time */ 965 alock.release(); 966 { 967 AutoWriteLock wlock(this COMMA_LOCKVAL_SRC_POS); 968 ErrorInfoKeeper eik; 969 (void)setDefaultAdditionsISO(""); 970 } 971 alock.acquire(); 972 } 973 m->strDefaultAdditionsISO.cloneTo(aDefaultAdditionsISO); 974 975 return S_OK; 976 } 977 978 STDMETHODIMP SystemProperties::COMSETTER(DefaultAdditionsISO)(IN_BSTR aDefaultAdditionsISO) 979 { 980 AutoCaller autoCaller(this); 981 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 982 983 /** @todo not yet implemented, settings handling is missing */ 984 ReturnComNotImplemented(); 985 986 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 987 HRESULT rc = setDefaultAdditionsISO(aDefaultAdditionsISO); 988 alock.release(); 989 990 if (SUCCEEDED(rc)) 991 { 992 // VirtualBox::saveSettings() needs vbox write lock 993 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 994 rc = mParent->saveSettings(); 995 } 996 997 return rc; 998 } 999 953 1000 // public methods only for internal purposes 954 1001 ///////////////////////////////////////////////////////////////////////////// … … 982 1029 rc = setAutostartDatabasePath(data.strAutostartDatabasePath); 983 1030 if (FAILED(rc)) return rc; 1031 1032 { 1033 /* must ignore errors signalled here, because the guest additions 1034 * file may not exist, and in this case keep the empty string */ 1035 ErrorInfoKeeper eik; 1036 (void)setDefaultAdditionsISO(data.strDefaultAdditionsISO); 1037 } 984 1038 985 1039 return S_OK; … … 1190 1244 return rc; 1191 1245 } 1246 1247 HRESULT SystemProperties::setDefaultAdditionsISO(const Utf8Str &aPath) 1248 { 1249 Utf8Str path(aPath); 1250 if (path.isEmpty()) 1251 { 1252 char strTemp[RTPATH_MAX]; 1253 int vrc = RTPathAppPrivateNoArch(strTemp, sizeof(strTemp)); 1254 AssertRC(vrc); 1255 Utf8Str strSrc1 = Utf8Str(strTemp).append("/VBoxGuestAdditions.iso"); 1256 1257 vrc = RTPathExecDir(strTemp, sizeof(strTemp)); 1258 AssertRC(vrc); 1259 Utf8Str strSrc2 = Utf8Str(strTemp).append("/additions/VBoxGuestAdditions.iso"); 1260 1261 vrc = RTPathUserHome(strTemp, sizeof(strTemp)); 1262 AssertRC(vrc); 1263 Utf8Str strSrc3 = Utf8StrFmt("%s/VBoxGuestAdditions_%ls.iso", strTemp, VirtualBox::getVersionNormalized().raw()); 1264 1265 /* Check the standard image locations */ 1266 if (RTFileExists(strSrc1.c_str())) 1267 path = strSrc1; 1268 else if (RTFileExists(strSrc2.c_str())) 1269 path = strSrc2; 1270 else if (RTFileExists(strSrc3.c_str())) 1271 path = strSrc3; 1272 else 1273 return setError(E_FAIL, 1274 tr("Cannot determine default Guest Additions ISO location. Most likely they are not available")); 1275 } 1276 1277 if (!RTPathStartsWithRoot(path.c_str())) 1278 return setError(E_INVALIDARG, 1279 tr("Given default machine Guest Additions ISO file '%s' is not fully qualified"), 1280 path.c_str()); 1281 1282 if (!RTFileExists(path.c_str())) 1283 return setError(E_INVALIDARG, 1284 tr("Given default machine Guest Additions ISO file '%s' does not exist"), 1285 path.c_str()); 1286 1287 m->strDefaultAdditionsISO = path; 1288 1289 return S_OK; 1290 } -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r42569 r42748 40 40 #include <VBox/param.h> 41 41 #include <VBox/settings.h> 42 #include <VBox/version.h> 42 43 43 44 #include <package-generated.h> 44 #include <version-generated.h>45 45 46 46 #include <algorithm> … … 98 98 // static 99 99 Bstr VirtualBox::sVersion; 100 101 // static 102 Bstr VirtualBox::sVersionNormalized; 100 103 101 104 // static … … 371 374 if (sVersion.isEmpty()) 372 375 sVersion = RTBldCfgVersion(); 376 if (sVersionNormalized.isEmpty()) 377 { 378 Utf8Str tmp(RTBldCfgVersion()); 379 if (tmp.endsWith(VBOX_BUILD_PUBLISHER)) 380 tmp = tmp.substr(0, tmp.length() - strlen(VBOX_BUILD_PUBLISHER)); 381 sVersionNormalized = tmp; 382 } 373 383 sRevision = RTBldCfgRevision(); 374 384 if (sPackageType.isEmpty()) … … 857 867 858 868 sVersion.cloneTo(aVersion); 869 return S_OK; 870 } 871 872 STDMETHODIMP VirtualBox::COMGETTER(VersionNormalized)(BSTR *aVersionNormalized) 873 { 874 CheckComArgNotNull(aVersionNormalized); 875 876 AutoCaller autoCaller(this); 877 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 878 879 sVersionNormalized.cloneTo(aVersionNormalized); 859 880 return S_OK; 860 881 } … … 4466 4487 } 4467 4488 NOREF(rc); /* XXX */ 4489 } 4490 4491 4492 /* static */ 4493 const Bstr &VirtualBox::getVersionNormalized() 4494 { 4495 return sVersionNormalized; 4468 4496 } 4469 4497
Note:
See TracChangeset
for help on using the changeset viewer.