Changeset 107948 in vbox for trunk/src/VBox/Installer/win/InstallHelper/VBoxCommon.cpp
- Timestamp:
- Jan 27, 2025 4:57:39 PM (3 months ago)
- svn:sync-xref-src-repo-rev:
- 167195
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/win/InstallHelper/VBoxCommon.cpp
r106321 r107948 146 146 } 147 147 148 /** 149 * Sets a MSI property. 150 * 151 * @returns UINT 152 * @param hMsi MSI handle to use. 153 * @param pwszName Name of property to set. 154 * @param pwszValue Value to set. 155 */ 148 156 UINT VBoxMsiSetProp(MSIHANDLE hMsi, const WCHAR *pwszName, const WCHAR *pwszValue) 149 157 { 150 158 return MsiSetPropertyW(hMsi, pwszName, pwszValue); 151 159 } 152 #endif 153 160 #endif /* TESTCASE */ 161 162 /** 163 * Sets a MSI property (in UTF-8). 164 * 165 * Convenience function for VBoxMsiSetProp(). 166 * 167 * @returns VBox status code. 168 * @param hMsi MSI handle to use. 169 * @param pszName Name of property to set. 170 * @param pszValue Value to set. 171 */ 172 int VBoxMsiSetPropUtf8(MSIHANDLE hMsi, const char *pszName, const char *pszValue) 173 { 174 AssertPtrReturn(pszName, VERR_INVALID_POINTER); 175 AssertPtrReturn(pszValue, VERR_INVALID_POINTER); 176 177 PRTUTF16 pwszName; 178 int rc = RTStrToUtf16(pszName, &pwszName); 179 if (RT_SUCCESS(rc)) 180 { 181 PRTUTF16 pwszValue; 182 rc = RTStrToUtf16(pszValue, &pwszValue); 183 if (RT_SUCCESS(rc)) 184 { 185 UINT const uRc = VBoxMsiSetProp(hMsi, pwszName, pwszValue); 186 if (uRc != ERROR_SUCCESS) 187 rc = RTErrConvertFromWin32(uRc); 188 RTUtf16Free(pwszValue); 189 } 190 191 RTUtf16Free(pwszName); 192 } 193 194 return rc; 195 } 196 197 /** 198 * Sets a MSI property (DWORD). 199 * 200 * Convenience function for VBoxMsiSetProp(). 201 * 202 * @returns UINT 203 * @param hMsi MSI handle to use. 204 * @param pwszName Name of property to set. 205 * @param dwVal Value to set. 206 */ 154 207 UINT VBoxMsiSetPropDWORD(MSIHANDLE hMsi, const WCHAR *pwszName, DWORD dwVal) 155 208 { … … 158 211 return VBoxMsiSetProp(hMsi, pwszName, wszTemp); 159 212 } 160
Note:
See TracChangeset
for help on using the changeset viewer.