diff options
Diffstat (limited to 'src/ca/scauser.cpp')
| -rw-r--r-- | src/ca/scauser.cpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/src/ca/scauser.cpp b/src/ca/scauser.cpp index 43317bdc..0d87301f 100644 --- a/src/ca/scauser.cpp +++ b/src/ca/scauser.cpp | |||
| @@ -2,16 +2,16 @@ | |||
| 2 | 2 | ||
| 3 | #include "precomp.h" | 3 | #include "precomp.h" |
| 4 | 4 | ||
| 5 | LPCWSTR vcsUserQuery = L"SELECT `User`, `Component_`, `Name`, `Domain`, `Password` FROM `User` WHERE `User`=?"; | 5 | LPCWSTR vcsUserQuery = L"SELECT `Wix4User`, `Component_`, `Name`, `Domain`, `Password` FROM `Wix4User` WHERE `Wix4User`=?"; |
| 6 | enum eUserQuery { vuqUser = 1, vuqComponent, vuqName, vuqDomain, vuqPassword }; | 6 | enum eUserQuery { vuqUser = 1, vuqComponent, vuqName, vuqDomain, vuqPassword }; |
| 7 | 7 | ||
| 8 | LPCWSTR vcsGroupQuery = L"SELECT `Group`, `Component_`, `Name`, `Domain` FROM `Group` WHERE `Group`=?"; | 8 | LPCWSTR vcsGroupQuery = L"SELECT `Wix4Group`, `Component_`, `Name`, `Domain` FROM `Wix4Group` WHERE `Wix4Group`=?"; |
| 9 | enum eGroupQuery { vgqGroup = 1, vgqComponent, vgqName, vgqDomain }; | 9 | enum eGroupQuery { vgqGroup = 1, vgqComponent, vgqName, vgqDomain }; |
| 10 | 10 | ||
| 11 | LPCWSTR vcsUserGroupQuery = L"SELECT `User_`, `Group_` FROM `UserGroup` WHERE `User_`=?"; | 11 | LPCWSTR vcsUserGroupQuery = L"SELECT `Wix4User_`, `Wix4Group_` FROM `Wix4UserGroup` WHERE `Wix4User_`=?"; |
| 12 | enum eUserGroupQuery { vugqUser = 1, vugqGroup }; | 12 | enum eUserGroupQuery { vugqUser = 1, vugqGroup }; |
| 13 | 13 | ||
| 14 | LPCWSTR vActionableQuery = L"SELECT `User`,`Component_`,`Name`,`Domain`,`Password`,`Attributes` FROM `User` WHERE `Component_` IS NOT NULL"; | 14 | LPCWSTR vActionableQuery = L"SELECT `Wix4User`,`Component_`,`Name`,`Domain`,`Password`,`Attributes` FROM `Wix4User` WHERE `Component_` IS NOT NULL"; |
| 15 | enum eActionableQuery { vaqUser = 1, vaqComponent, vaqName, vaqDomain, vaqPassword, vaqAttributes }; | 15 | enum eActionableQuery { vaqUser = 1, vaqComponent, vaqName, vaqDomain, vaqPassword, vaqAttributes }; |
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -51,46 +51,46 @@ HRESULT __stdcall ScaGetUser( | |||
| 51 | ExitOnFailure(hr, "Failed to look up User"); | 51 | ExitOnFailure(hr, "Failed to look up User"); |
| 52 | 52 | ||
| 53 | hr = WcaOpenView(vcsUserQuery, &hView); | 53 | hr = WcaOpenView(vcsUserQuery, &hView); |
| 54 | ExitOnFailure(hr, "Failed to open view on User table"); | 54 | ExitOnFailure(hr, "Failed to open view on Wix4User table"); |
| 55 | hr = WcaExecuteView(hView, hRec); | 55 | hr = WcaExecuteView(hView, hRec); |
| 56 | ExitOnFailure(hr, "Failed to execute view on User table"); | 56 | ExitOnFailure(hr, "Failed to execute view on Wix4User table"); |
| 57 | 57 | ||
| 58 | hr = WcaFetchSingleRecord(hView, &hRec); | 58 | hr = WcaFetchSingleRecord(hView, &hRec); |
| 59 | if (S_OK == hr) | 59 | if (S_OK == hr) |
| 60 | { | 60 | { |
| 61 | hr = WcaGetRecordString(hRec, vuqUser, &pwzData); | 61 | hr = WcaGetRecordString(hRec, vuqUser, &pwzData); |
| 62 | ExitOnFailure(hr, "Failed to get User.User"); | 62 | ExitOnFailure(hr, "Failed to get Wix4User.User"); |
| 63 | hr = ::StringCchCopyW(pscau->wzKey, countof(pscau->wzKey), pwzData); | 63 | hr = ::StringCchCopyW(pscau->wzKey, countof(pscau->wzKey), pwzData); |
| 64 | ExitOnFailure(hr, "Failed to copy key string to user object"); | 64 | ExitOnFailure(hr, "Failed to copy key string to user object"); |
| 65 | 65 | ||
| 66 | hr = WcaGetRecordString(hRec, vuqComponent, &pwzData); | 66 | hr = WcaGetRecordString(hRec, vuqComponent, &pwzData); |
| 67 | ExitOnFailure(hr, "Failed to get User.Component_"); | 67 | ExitOnFailure(hr, "Failed to get Wix4User.Component_"); |
| 68 | hr = ::StringCchCopyW(pscau->wzComponent, countof(pscau->wzComponent), pwzData); | 68 | hr = ::StringCchCopyW(pscau->wzComponent, countof(pscau->wzComponent), pwzData); |
| 69 | ExitOnFailure(hr, "Failed to copy component string to user object"); | 69 | ExitOnFailure(hr, "Failed to copy component string to user object"); |
| 70 | 70 | ||
| 71 | hr = WcaGetRecordFormattedString(hRec, vuqName, &pwzData); | 71 | hr = WcaGetRecordFormattedString(hRec, vuqName, &pwzData); |
| 72 | ExitOnFailure(hr, "Failed to get User.Name"); | 72 | ExitOnFailure(hr, "Failed to get Wix4User.Name"); |
| 73 | hr = ::StringCchCopyW(pscau->wzName, countof(pscau->wzName), pwzData); | 73 | hr = ::StringCchCopyW(pscau->wzName, countof(pscau->wzName), pwzData); |
| 74 | ExitOnFailure(hr, "Failed to copy name string to user object"); | 74 | ExitOnFailure(hr, "Failed to copy name string to user object"); |
| 75 | 75 | ||
| 76 | hr = WcaGetRecordFormattedString(hRec, vuqDomain, &pwzData); | 76 | hr = WcaGetRecordFormattedString(hRec, vuqDomain, &pwzData); |
| 77 | ExitOnFailure(hr, "Failed to get User.Domain"); | 77 | ExitOnFailure(hr, "Failed to get Wix4User.Domain"); |
| 78 | hr = ::StringCchCopyW(pscau->wzDomain, countof(pscau->wzDomain), pwzData); | 78 | hr = ::StringCchCopyW(pscau->wzDomain, countof(pscau->wzDomain), pwzData); |
| 79 | ExitOnFailure(hr, "Failed to copy domain string to user object"); | 79 | ExitOnFailure(hr, "Failed to copy domain string to user object"); |
| 80 | 80 | ||
| 81 | hr = WcaGetRecordFormattedString(hRec, vuqPassword, &pwzData); | 81 | hr = WcaGetRecordFormattedString(hRec, vuqPassword, &pwzData); |
| 82 | ExitOnFailure(hr, "Failed to get User.Password"); | 82 | ExitOnFailure(hr, "Failed to get Wix4User.Password"); |
| 83 | hr = ::StringCchCopyW(pscau->wzPassword, countof(pscau->wzPassword), pwzData); | 83 | hr = ::StringCchCopyW(pscau->wzPassword, countof(pscau->wzPassword), pwzData); |
| 84 | ExitOnFailure(hr, "Failed to copy password string to user object"); | 84 | ExitOnFailure(hr, "Failed to copy password string to user object"); |
| 85 | } | 85 | } |
| 86 | else if (E_NOMOREITEMS == hr) | 86 | else if (E_NOMOREITEMS == hr) |
| 87 | { | 87 | { |
| 88 | WcaLog(LOGMSG_STANDARD, "Error: Cannot locate User.User='%ls'", wzUser); | 88 | WcaLog(LOGMSG_STANDARD, "Error: Cannot locate Wix4User.User='%ls'", wzUser); |
| 89 | hr = E_FAIL; | 89 | hr = E_FAIL; |
| 90 | } | 90 | } |
| 91 | else | 91 | else |
| 92 | { | 92 | { |
| 93 | ExitOnFailure(hr, "Error or found multiple matching User rows"); | 93 | ExitOnFailure(hr, "Error or found multiple matching Wix4User rows"); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | LExit: | 96 | LExit: |
| @@ -131,42 +131,42 @@ HRESULT __stdcall ScaGetUserDeferred( | |||
| 131 | hr = WcaFetchWrappedRecordWhereString(hUserQuery, vuqUser, wzUser, &hRecTest); | 131 | hr = WcaFetchWrappedRecordWhereString(hUserQuery, vuqUser, wzUser, &hRecTest); |
| 132 | if (S_OK == hr) | 132 | if (S_OK == hr) |
| 133 | { | 133 | { |
| 134 | AssertSz(FALSE, "Found multiple matching User rows"); | 134 | AssertSz(FALSE, "Found multiple matching Wix4User rows"); |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | hr = WcaGetRecordString(hRec, vuqUser, &pwzData); | 137 | hr = WcaGetRecordString(hRec, vuqUser, &pwzData); |
| 138 | ExitOnFailure(hr, "Failed to get User.User"); | 138 | ExitOnFailure(hr, "Failed to get Wix4User.User"); |
| 139 | hr = ::StringCchCopyW(pscau->wzKey, countof(pscau->wzKey), pwzData); | 139 | hr = ::StringCchCopyW(pscau->wzKey, countof(pscau->wzKey), pwzData); |
| 140 | ExitOnFailure(hr, "Failed to copy key string to user object (in deferred CA)"); | 140 | ExitOnFailure(hr, "Failed to copy key string to user object (in deferred CA)"); |
| 141 | 141 | ||
| 142 | hr = WcaGetRecordString(hRec, vuqComponent, &pwzData); | 142 | hr = WcaGetRecordString(hRec, vuqComponent, &pwzData); |
| 143 | ExitOnFailure(hr, "Failed to get User.Component_"); | 143 | ExitOnFailure(hr, "Failed to get Wix4User.Component_"); |
| 144 | hr = ::StringCchCopyW(pscau->wzComponent, countof(pscau->wzComponent), pwzData); | 144 | hr = ::StringCchCopyW(pscau->wzComponent, countof(pscau->wzComponent), pwzData); |
| 145 | ExitOnFailure(hr, "Failed to copy component string to user object (in deferred CA)"); | 145 | ExitOnFailure(hr, "Failed to copy component string to user object (in deferred CA)"); |
| 146 | 146 | ||
| 147 | hr = WcaGetRecordString(hRec, vuqName, &pwzData); | 147 | hr = WcaGetRecordString(hRec, vuqName, &pwzData); |
| 148 | ExitOnFailure(hr, "Failed to get User.Name"); | 148 | ExitOnFailure(hr, "Failed to get Wix4User.Name"); |
| 149 | hr = ::StringCchCopyW(pscau->wzName, countof(pscau->wzName), pwzData); | 149 | hr = ::StringCchCopyW(pscau->wzName, countof(pscau->wzName), pwzData); |
| 150 | ExitOnFailure(hr, "Failed to copy name string to user object (in deferred CA)"); | 150 | ExitOnFailure(hr, "Failed to copy name string to user object (in deferred CA)"); |
| 151 | 151 | ||
| 152 | hr = WcaGetRecordString(hRec, vuqDomain, &pwzData); | 152 | hr = WcaGetRecordString(hRec, vuqDomain, &pwzData); |
| 153 | ExitOnFailure(hr, "Failed to get User.Domain"); | 153 | ExitOnFailure(hr, "Failed to get Wix4User.Domain"); |
| 154 | hr = ::StringCchCopyW(pscau->wzDomain, countof(pscau->wzDomain), pwzData); | 154 | hr = ::StringCchCopyW(pscau->wzDomain, countof(pscau->wzDomain), pwzData); |
| 155 | ExitOnFailure(hr, "Failed to copy domain string to user object (in deferred CA)"); | 155 | ExitOnFailure(hr, "Failed to copy domain string to user object (in deferred CA)"); |
| 156 | 156 | ||
| 157 | hr = WcaGetRecordString(hRec, vuqPassword, &pwzData); | 157 | hr = WcaGetRecordString(hRec, vuqPassword, &pwzData); |
| 158 | ExitOnFailure(hr, "Failed to get User.Password"); | 158 | ExitOnFailure(hr, "Failed to get Wix4User.Password"); |
| 159 | hr = ::StringCchCopyW(pscau->wzPassword, countof(pscau->wzPassword), pwzData); | 159 | hr = ::StringCchCopyW(pscau->wzPassword, countof(pscau->wzPassword), pwzData); |
| 160 | ExitOnFailure(hr, "Failed to copy password string to user object (in deferred CA)"); | 160 | ExitOnFailure(hr, "Failed to copy password string to user object (in deferred CA)"); |
| 161 | } | 161 | } |
| 162 | else if (E_NOMOREITEMS == hr) | 162 | else if (E_NOMOREITEMS == hr) |
| 163 | { | 163 | { |
| 164 | WcaLog(LOGMSG_STANDARD, "Error: Cannot locate User.User='%ls'", wzUser); | 164 | WcaLog(LOGMSG_STANDARD, "Error: Cannot locate Wix4User.User='%ls'", wzUser); |
| 165 | hr = E_FAIL; | 165 | hr = E_FAIL; |
| 166 | } | 166 | } |
| 167 | else | 167 | else |
| 168 | { | 168 | { |
| 169 | ExitOnFailure(hr, "Error fetching single User row"); | 169 | ExitOnFailure(hr, "Error fetching single Wix4User row"); |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | LExit: | 172 | LExit: |
| @@ -196,41 +196,41 @@ HRESULT __stdcall ScaGetGroup( | |||
| 196 | ExitOnFailure(hr, "Failed to look up Group"); | 196 | ExitOnFailure(hr, "Failed to look up Group"); |
| 197 | 197 | ||
| 198 | hr = WcaOpenView(vcsGroupQuery, &hView); | 198 | hr = WcaOpenView(vcsGroupQuery, &hView); |
| 199 | ExitOnFailure(hr, "Failed to open view on Group table"); | 199 | ExitOnFailure(hr, "Failed to open view on Wix4Group table"); |
| 200 | hr = WcaExecuteView(hView, hRec); | 200 | hr = WcaExecuteView(hView, hRec); |
| 201 | ExitOnFailure(hr, "Failed to execute view on Group table"); | 201 | ExitOnFailure(hr, "Failed to execute view on Wix4Group table"); |
| 202 | 202 | ||
| 203 | hr = WcaFetchSingleRecord(hView, &hRec); | 203 | hr = WcaFetchSingleRecord(hView, &hRec); |
| 204 | if (S_OK == hr) | 204 | if (S_OK == hr) |
| 205 | { | 205 | { |
| 206 | hr = WcaGetRecordString(hRec, vgqGroup, &pwzData); | 206 | hr = WcaGetRecordString(hRec, vgqGroup, &pwzData); |
| 207 | ExitOnFailure(hr, "Failed to get Group.Group"); | 207 | ExitOnFailure(hr, "Failed to get Wix4Group.Wix4Group."); |
| 208 | hr = ::StringCchCopyW(pscag->wzKey, countof(pscag->wzKey), pwzData); | 208 | hr = ::StringCchCopyW(pscag->wzKey, countof(pscag->wzKey), pwzData); |
| 209 | ExitOnFailure(hr, "Failed to copy Group.Group."); | 209 | ExitOnFailure(hr, "Failed to copy Wix4Group.Wix4Group."); |
| 210 | 210 | ||
| 211 | hr = WcaGetRecordString(hRec, vgqComponent, &pwzData); | 211 | hr = WcaGetRecordString(hRec, vgqComponent, &pwzData); |
| 212 | ExitOnFailure(hr, "Failed to get Group.Component_"); | 212 | ExitOnFailure(hr, "Failed to get Wix4Group.Component_"); |
| 213 | hr = ::StringCchCopyW(pscag->wzComponent, countof(pscag->wzComponent), pwzData); | 213 | hr = ::StringCchCopyW(pscag->wzComponent, countof(pscag->wzComponent), pwzData); |
| 214 | ExitOnFailure(hr, "Failed to copy Group.Component_."); | 214 | ExitOnFailure(hr, "Failed to copy Wix4Group.Component_."); |
| 215 | 215 | ||
| 216 | hr = WcaGetRecordFormattedString(hRec, vgqName, &pwzData); | 216 | hr = WcaGetRecordFormattedString(hRec, vgqName, &pwzData); |
| 217 | ExitOnFailure(hr, "Failed to get Group.Name"); | 217 | ExitOnFailure(hr, "Failed to get Wix4Group.Name"); |
| 218 | hr = ::StringCchCopyW(pscag->wzName, countof(pscag->wzName), pwzData); | 218 | hr = ::StringCchCopyW(pscag->wzName, countof(pscag->wzName), pwzData); |
| 219 | ExitOnFailure(hr, "Failed to copy Group.Name."); | 219 | ExitOnFailure(hr, "Failed to copy Wix4Group.Name."); |
| 220 | 220 | ||
| 221 | hr = WcaGetRecordFormattedString(hRec, vgqDomain, &pwzData); | 221 | hr = WcaGetRecordFormattedString(hRec, vgqDomain, &pwzData); |
| 222 | ExitOnFailure(hr, "Failed to get Group.Domain"); | 222 | ExitOnFailure(hr, "Failed to get Wix4Group.Domain"); |
| 223 | hr = ::StringCchCopyW(pscag->wzDomain, countof(pscag->wzDomain), pwzData); | 223 | hr = ::StringCchCopyW(pscag->wzDomain, countof(pscag->wzDomain), pwzData); |
| 224 | ExitOnFailure(hr, "Failed to copy Group.Domain."); | 224 | ExitOnFailure(hr, "Failed to copy Wix4Group.Domain."); |
| 225 | } | 225 | } |
| 226 | else if (E_NOMOREITEMS == hr) | 226 | else if (E_NOMOREITEMS == hr) |
| 227 | { | 227 | { |
| 228 | WcaLog(LOGMSG_STANDARD, "Error: Cannot locate Group.Group='%ls'", wzGroup); | 228 | WcaLog(LOGMSG_STANDARD, "Error: Cannot locate Wix4Group.Wix4Group='%ls'", wzGroup); |
| 229 | hr = E_FAIL; | 229 | hr = E_FAIL; |
| 230 | } | 230 | } |
| 231 | else | 231 | else |
| 232 | { | 232 | { |
| 233 | ExitOnFailure(hr, "Error or found multiple matching Group rows"); | 233 | ExitOnFailure(hr, "Error or found multiple matching Wix4Group rows"); |
| 234 | } | 234 | } |
| 235 | 235 | ||
| 236 | LExit: | 236 | LExit: |
| @@ -284,19 +284,19 @@ HRESULT ScaUserRead( | |||
| 284 | 284 | ||
| 285 | LPWSTR pwzData = NULL; | 285 | LPWSTR pwzData = NULL; |
| 286 | 286 | ||
| 287 | BOOL fUserGroupExists = FALSE; | 287 | BOOL fUserGroupExists = FALSE; |
| 288 | 288 | ||
| 289 | SCA_USER *psu = NULL; | 289 | SCA_USER *psu = NULL; |
| 290 | 290 | ||
| 291 | INSTALLSTATE isInstalled, isAction; | 291 | INSTALLSTATE isInstalled, isAction; |
| 292 | 292 | ||
| 293 | if (S_OK != WcaTableExists(L"User")) | 293 | if (S_OK != WcaTableExists(L"Wix4User")) |
| 294 | { | 294 | { |
| 295 | WcaLog(LOGMSG_VERBOSE, "User Table does not exist, exiting"); | 295 | WcaLog(LOGMSG_VERBOSE, "Wix4User Table does not exist, exiting"); |
| 296 | ExitFunction1(hr = S_FALSE); | 296 | ExitFunction1(hr = S_FALSE); |
| 297 | } | 297 | } |
| 298 | 298 | ||
| 299 | if (S_OK == WcaTableExists(L"UserGroup")) | 299 | if (S_OK == WcaTableExists(L"Wix4UserGroup")) |
| 300 | { | 300 | { |
| 301 | fUserGroupExists = TRUE; | 301 | fUserGroupExists = TRUE; |
| 302 | } | 302 | } |
| @@ -305,15 +305,15 @@ HRESULT ScaUserRead( | |||
| 305 | // loop through all the users | 305 | // loop through all the users |
| 306 | // | 306 | // |
| 307 | hr = WcaOpenExecuteView(vActionableQuery, &hView); | 307 | hr = WcaOpenExecuteView(vActionableQuery, &hView); |
| 308 | ExitOnFailure(hr, "failed to open view on User table"); | 308 | ExitOnFailure(hr, "failed to open view on Wix4User table"); |
| 309 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) | 309 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) |
| 310 | { | 310 | { |
| 311 | hr = WcaGetRecordString(hRec, vaqComponent, &pwzData); | 311 | hr = WcaGetRecordString(hRec, vaqComponent, &pwzData); |
| 312 | ExitOnFailure(hr, "failed to get User.Component"); | 312 | ExitOnFailure(hr, "failed to get Wix4User.Component"); |
| 313 | 313 | ||
| 314 | er = ::MsiGetComponentStateW(WcaGetInstallHandle(), pwzData, &isInstalled, &isAction); | 314 | er = ::MsiGetComponentStateW(WcaGetInstallHandle(), pwzData, &isInstalled, &isAction); |
| 315 | hr = HRESULT_FROM_WIN32(er); | 315 | hr = HRESULT_FROM_WIN32(er); |
| 316 | ExitOnFailure(hr, "failed to get Component state for User"); | 316 | ExitOnFailure(hr, "failed to get Component state for Wix4User"); |
| 317 | 317 | ||
| 318 | // don't bother if we aren't installing or uninstalling this component | 318 | // don't bother if we aren't installing or uninstalling this component |
| 319 | if (WcaIsInstalling(isInstalled, isAction) || WcaIsUninstalling(isInstalled, isAction)) | 319 | if (WcaIsInstalling(isInstalled, isAction) || WcaIsUninstalling(isInstalled, isAction)) |
| @@ -332,44 +332,44 @@ HRESULT ScaUserRead( | |||
| 332 | ExitOnFailure(hr, "failed to copy component name: %ls", pwzData); | 332 | ExitOnFailure(hr, "failed to copy component name: %ls", pwzData); |
| 333 | 333 | ||
| 334 | hr = WcaGetRecordString(hRec, vaqUser, &pwzData); | 334 | hr = WcaGetRecordString(hRec, vaqUser, &pwzData); |
| 335 | ExitOnFailure(hr, "failed to get User.User"); | 335 | ExitOnFailure(hr, "failed to get Wix4User.User"); |
| 336 | hr = ::StringCchCopyW(psu->wzKey, countof(psu->wzKey), pwzData); | 336 | hr = ::StringCchCopyW(psu->wzKey, countof(psu->wzKey), pwzData); |
| 337 | ExitOnFailure(hr, "failed to copy user key: %ls", pwzData); | 337 | ExitOnFailure(hr, "failed to copy user key: %ls", pwzData); |
| 338 | 338 | ||
| 339 | hr = WcaGetRecordFormattedString(hRec, vaqName, &pwzData); | 339 | hr = WcaGetRecordFormattedString(hRec, vaqName, &pwzData); |
| 340 | ExitOnFailure(hr, "failed to get User.Name"); | 340 | ExitOnFailure(hr, "failed to get Wix4User.Name"); |
| 341 | hr = ::StringCchCopyW(psu->wzName, countof(psu->wzName), pwzData); | 341 | hr = ::StringCchCopyW(psu->wzName, countof(psu->wzName), pwzData); |
| 342 | ExitOnFailure(hr, "failed to copy user name: %ls", pwzData); | 342 | ExitOnFailure(hr, "failed to copy user name: %ls", pwzData); |
| 343 | 343 | ||
| 344 | hr = WcaGetRecordFormattedString(hRec, vaqDomain, &pwzData); | 344 | hr = WcaGetRecordFormattedString(hRec, vaqDomain, &pwzData); |
| 345 | ExitOnFailure(hr, "failed to get User.Domain"); | 345 | ExitOnFailure(hr, "failed to get Wix4User.Domain"); |
| 346 | hr = ::StringCchCopyW(psu->wzDomain, countof(psu->wzDomain), pwzData); | 346 | hr = ::StringCchCopyW(psu->wzDomain, countof(psu->wzDomain), pwzData); |
| 347 | ExitOnFailure(hr, "failed to copy user domain: %ls", pwzData); | 347 | ExitOnFailure(hr, "failed to copy user domain: %ls", pwzData); |
| 348 | 348 | ||
| 349 | hr = WcaGetRecordFormattedString(hRec, vaqPassword, &pwzData); | 349 | hr = WcaGetRecordFormattedString(hRec, vaqPassword, &pwzData); |
| 350 | ExitOnFailure(hr, "failed to get User.Password"); | 350 | ExitOnFailure(hr, "failed to get Wix4User.Password"); |
| 351 | hr = ::StringCchCopyW(psu->wzPassword, countof(psu->wzPassword), pwzData); | 351 | hr = ::StringCchCopyW(psu->wzPassword, countof(psu->wzPassword), pwzData); |
| 352 | ExitOnFailure(hr, "failed to copy user password"); | 352 | ExitOnFailure(hr, "failed to copy user password"); |
| 353 | 353 | ||
| 354 | hr = WcaGetRecordInteger(hRec, vaqAttributes, &psu->iAttributes); | 354 | hr = WcaGetRecordInteger(hRec, vaqAttributes, &psu->iAttributes); |
| 355 | ExitOnFailure(hr, "failed to get User.Attributes"); | 355 | ExitOnFailure(hr, "failed to get Wix4User.Attributes"); |
| 356 | 356 | ||
| 357 | // Check if this user is to be added to any groups | 357 | // Check if this user is to be added to any groups |
| 358 | if (fUserGroupExists) | 358 | if (fUserGroupExists) |
| 359 | { | 359 | { |
| 360 | hUserRec = ::MsiCreateRecord(1); | 360 | hUserRec = ::MsiCreateRecord(1); |
| 361 | hr = WcaSetRecordString(hUserRec, 1, psu->wzKey); | 361 | hr = WcaSetRecordString(hUserRec, 1, psu->wzKey); |
| 362 | ExitOnFailure(hr, "Failed to create user record for querying UserGroup table"); | 362 | ExitOnFailure(hr, "Failed to create user record for querying Wix4UserGroup table"); |
| 363 | 363 | ||
| 364 | hr = WcaOpenView(vcsUserGroupQuery, &hUserGroupView); | 364 | hr = WcaOpenView(vcsUserGroupQuery, &hUserGroupView); |
| 365 | ExitOnFailure(hr, "Failed to open view on UserGroup table for user %ls", psu->wzKey); | 365 | ExitOnFailure(hr, "Failed to open view on Wix4UserGroup table for user %ls", psu->wzKey); |
| 366 | hr = WcaExecuteView(hUserGroupView, hUserRec); | 366 | hr = WcaExecuteView(hUserGroupView, hUserRec); |
| 367 | ExitOnFailure(hr, "Failed to execute view on UserGroup table for user: %ls", psu->wzKey); | 367 | ExitOnFailure(hr, "Failed to execute view on Wix4UserGroup table for user: %ls", psu->wzKey); |
| 368 | 368 | ||
| 369 | while (S_OK == (hr = WcaFetchRecord(hUserGroupView, &hRec))) | 369 | while (S_OK == (hr = WcaFetchRecord(hUserGroupView, &hRec))) |
| 370 | { | 370 | { |
| 371 | hr = WcaGetRecordString(hRec, vugqGroup, &pwzData); | 371 | hr = WcaGetRecordString(hRec, vugqGroup, &pwzData); |
| 372 | ExitOnFailure(hr, "failed to get UserGroup.Group"); | 372 | ExitOnFailure(hr, "failed to get Wix4UserGroup.Group"); |
| 373 | 373 | ||
| 374 | hr = AddGroupToList(&(psu->psgGroups)); | 374 | hr = AddGroupToList(&(psu->psgGroups)); |
| 375 | ExitOnFailure(hr, "failed to add group to list"); | 375 | ExitOnFailure(hr, "failed to add group to list"); |
| @@ -382,7 +382,7 @@ HRESULT ScaUserRead( | |||
| 382 | { | 382 | { |
| 383 | hr = S_OK; | 383 | hr = S_OK; |
| 384 | } | 384 | } |
| 385 | ExitOnFailure(hr, "failed to enumerate selected rows from UserGroup table"); | 385 | ExitOnFailure(hr, "failed to enumerate selected rows from Wix4UserGroup table"); |
| 386 | } | 386 | } |
| 387 | } | 387 | } |
| 388 | } | 388 | } |
| @@ -391,7 +391,7 @@ HRESULT ScaUserRead( | |||
| 391 | { | 391 | { |
| 392 | hr = S_OK; | 392 | hr = S_OK; |
| 393 | } | 393 | } |
| 394 | ExitOnFailure(hr, "failed to enumerate selected rows from User table"); | 394 | ExitOnFailure(hr, "failed to enumerate selected rows from Wix4User table"); |
| 395 | 395 | ||
| 396 | LExit: | 396 | LExit: |
| 397 | ReleaseStr(pwzData); | 397 | ReleaseStr(pwzData); |
| @@ -581,7 +581,7 @@ HRESULT ScaUserExecute( | |||
| 581 | ExitOnFailure(hr, "failed to add group information to rollback custom action data"); | 581 | ExitOnFailure(hr, "failed to add group information to rollback custom action data"); |
| 582 | } | 582 | } |
| 583 | 583 | ||
| 584 | hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"CreateUserRollback"), pwzRollbackData, COST_USER_DELETE); | 584 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"CreateUserRollback"), pwzRollbackData, COST_USER_DELETE); |
| 585 | ExitOnFailure(hr, "failed to schedule CreateUserRollback"); | 585 | ExitOnFailure(hr, "failed to schedule CreateUserRollback"); |
| 586 | } | 586 | } |
| 587 | 587 | ||
| @@ -595,7 +595,7 @@ HRESULT ScaUserExecute( | |||
| 595 | hr = WriteGroupInfo(psu->psgGroups, &pwzActionData); | 595 | hr = WriteGroupInfo(psu->psgGroups, &pwzActionData); |
| 596 | ExitOnFailure(hr, "failed to add group information to custom action data"); | 596 | ExitOnFailure(hr, "failed to add group information to custom action data"); |
| 597 | 597 | ||
| 598 | hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"CreateUser"), pwzActionData, COST_USER_ADD); | 598 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"CreateUser"), pwzActionData, COST_USER_ADD); |
| 599 | ExitOnFailure(hr, "failed to schedule CreateUser"); | 599 | ExitOnFailure(hr, "failed to schedule CreateUser"); |
| 600 | } | 600 | } |
| 601 | else if (((USER_EXISTS_YES == ueUserExists) || (USER_EXISTS_INDETERMINATE == ueUserExists)) && WcaIsUninstalling(psu->isInstalled, psu->isAction) && !(psu->iAttributes & SCAU_DONT_REMOVE_ON_UNINSTALL)) | 601 | else if (((USER_EXISTS_YES == ueUserExists) || (USER_EXISTS_INDETERMINATE == ueUserExists)) && WcaIsUninstalling(psu->isInstalled, psu->isAction) && !(psu->iAttributes & SCAU_DONT_REMOVE_ON_UNINSTALL)) |
| @@ -610,7 +610,7 @@ HRESULT ScaUserExecute( | |||
| 610 | // | 610 | // |
| 611 | // Note: We can't rollback the removal of a user which is why RemoveUser is a commit | 611 | // Note: We can't rollback the removal of a user which is why RemoveUser is a commit |
| 612 | // CustomAction. | 612 | // CustomAction. |
| 613 | hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RemoveUser"), pwzActionData, COST_USER_DELETE); | 613 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RemoveUser"), pwzActionData, COST_USER_DELETE); |
| 614 | ExitOnFailure(hr, "failed to schedule RemoveUser"); | 614 | ExitOnFailure(hr, "failed to schedule RemoveUser"); |
| 615 | } | 615 | } |
| 616 | 616 | ||
