From e9d10933bedb8215ec50ca85db272d6647426b31 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 5 Mar 2020 19:48:12 -0500 Subject: Version extension ids. Partial fix for wixtoolset/issues#5933. --- src/ca/CloseApps.cpp | 28 ++++++------ src/ca/FormatFiles.cpp | 18 ++++---- src/ca/RemoveFoldersEx.cpp | 14 +++--- src/ca/RestartManager.cpp | 8 ++-- src/ca/TouchFile.cpp | 16 +++---- src/ca/XmlConfig.cpp | 40 ++++++++--------- src/ca/XmlFile.cpp | 40 +++++++++-------- src/ca/caDecor.h | 13 ++++++ src/ca/caSuffix.h | 11 ----- src/ca/netshortcuts.cpp | 16 +++---- src/ca/precomp.h | 2 +- src/ca/scamanifest.cpp | 76 +++++++++++++++---------------- src/ca/scaperf.cpp | 64 +++++++++++++-------------- src/ca/scaperfexec.cpp | 4 +- src/ca/scasched.cpp | 16 +++---- src/ca/scasmb.h | 2 +- src/ca/scasmbsched.cpp | 50 ++++++++++----------- src/ca/scauser.cpp | 108 ++++++++++++++++++++++----------------------- src/ca/secureobj.cpp | 22 ++++----- src/ca/serviceconfig.cpp | 10 ++--- src/ca/utilca.vcxproj | 2 +- 21 files changed, 281 insertions(+), 279 deletions(-) create mode 100644 src/ca/caDecor.h delete mode 100644 src/ca/caSuffix.h (limited to 'src/ca') diff --git a/src/ca/CloseApps.cpp b/src/ca/CloseApps.cpp index a3f28ed3..63be353c 100644 --- a/src/ca/CloseApps.cpp +++ b/src/ca/CloseApps.cpp @@ -4,10 +4,8 @@ #define DEFAULT_PROCESS_EXIT_WAIT_TIME 5000 -// WixCloseApplication Target Description Condition Attributes Sequence - // structs -LPCWSTR wzQUERY_CLOSEAPPS = L"SELECT `WixCloseApplication`, `Target`, `Description`, `Condition`, `Attributes`, `Property`, `TerminateExitCode`, `Timeout` FROM `WixCloseApplication` ORDER BY `Sequence`"; +LPCWSTR wzQUERY_CLOSEAPPS = L"SELECT `Wix4CloseApplication`, `Target`, `Description`, `Condition`, `Attributes`, `Property`, `TerminateExitCode`, `Timeout` FROM `Wix4CloseApplication` ORDER BY `Sequence`"; enum eQUERY_CLOSEAPPS { QCA_ID = 1, QCA_TARGET, QCA_DESCRIPTION, QCA_CONDITION, QCA_ATTRIBUTES, QCA_PROPERTY, QCA_TERMINATEEXITCODE, QCA_TIMEOUT }; // CloseApplication.Attributes @@ -294,14 +292,14 @@ extern "C" UINT __stdcall WixCloseApplications( // loop through all the objects to be secured // hr = WcaOpenExecuteView(wzQUERY_CLOSEAPPS, &hView); - ExitOnFailure(hr, "failed to open view on WixCloseApplication table"); + ExitOnFailure(hr, "failed to open view on Wix4CloseApplication table"); while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) { hr = WcaGetRecordString(hRec, QCA_ID, &pwzId); - ExitOnFailure(hr, "failed to get id from WixCloseApplication table"); + ExitOnFailure(hr, "failed to get id from Wix4CloseApplication table"); hr = WcaGetRecordString(hRec, QCA_CONDITION, &pwzCondition); - ExitOnFailure(hr, "failed to get condition from WixCloseApplication table"); + ExitOnFailure(hr, "failed to get condition from Wix4CloseApplication table"); if (pwzCondition && *pwzCondition) { @@ -309,7 +307,7 @@ extern "C" UINT __stdcall WixCloseApplications( if (MSICONDITION_ERROR == condition) { hr = E_INVALIDARG; - ExitOnFailure(hr, "failed to process condition for WixCloseApplication '%ls'", pwzId); + ExitOnFailure(hr, "failed to process condition for Wix4CloseApplication '%ls'", pwzId); } else if (MSICONDITION_FALSE == condition) { @@ -318,16 +316,16 @@ extern "C" UINT __stdcall WixCloseApplications( } hr = WcaGetRecordFormattedString(hRec, QCA_TARGET, &pwzTarget); - ExitOnFailure(hr, "failed to get target from WixCloseApplication table"); + ExitOnFailure(hr, "failed to get target from Wix4CloseApplication table"); hr = WcaGetRecordFormattedString(hRec, QCA_DESCRIPTION, &pwzDescription); - ExitOnFailure(hr, "failed to get description from WixCloseApplication table"); + ExitOnFailure(hr, "failed to get description from Wix4CloseApplication table"); hr = WcaGetRecordInteger(hRec, QCA_ATTRIBUTES, reinterpret_cast(&dwAttributes)); - ExitOnFailure(hr, "failed to get attributes from WixCloseApplication table"); + ExitOnFailure(hr, "failed to get attributes from Wix4CloseApplication table"); hr = WcaGetRecordFormattedString(hRec, QCA_PROPERTY, &pwzProperty); - ExitOnFailure(hr, "failed to get property from WixCloseApplication table"); + ExitOnFailure(hr, "failed to get property from Wix4CloseApplication table"); hr = WcaGetRecordInteger(hRec, QCA_TERMINATEEXITCODE, reinterpret_cast(&dwTerminateExitCode)); if (S_FALSE == hr) @@ -335,7 +333,7 @@ extern "C" UINT __stdcall WixCloseApplications( dwTerminateExitCode = 0; hr = S_OK; } - ExitOnFailure(hr, "failed to get timeout from WixCloseApplication table"); + ExitOnFailure(hr, "failed to get timeout from Wix4CloseApplication table"); hr = WcaGetRecordInteger(hRec, QCA_TIMEOUT, reinterpret_cast(&dwTimeout)); if (S_FALSE == hr) @@ -343,7 +341,7 @@ extern "C" UINT __stdcall WixCloseApplications( dwTimeout = DEFAULT_PROCESS_EXIT_WAIT_TIME; hr = S_OK; } - ExitOnFailure(hr, "failed to get timeout from WixCloseApplication table"); + ExitOnFailure(hr, "failed to get timeout from Wix4CloseApplication table"); // Before trying any changes to the machine, prompt if requested. if (dwAttributes & CLOSEAPP_ATTRIBUTE_PROMPTTOCONTINUE) @@ -433,8 +431,8 @@ extern "C" UINT __stdcall WixCloseApplications( { Assert(0 < cCloseApps); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"WixCloseApplicationsDeferred"), pwzCustomActionData, cCloseApps * COST_CLOSEAPP); - ExitOnFailure(hr, "failed to schedule WixCloseApplicationsDeferred action"); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"CloseApplicationsDeferred"), pwzCustomActionData, cCloseApps * COST_CLOSEAPP); + ExitOnFailure(hr, "failed to schedule CloseApplicationsDeferred action"); } LExit: diff --git a/src/ca/FormatFiles.cpp b/src/ca/FormatFiles.cpp index 6a816700..464b92d6 100644 --- a/src/ca/FormatFiles.cpp +++ b/src/ca/FormatFiles.cpp @@ -27,9 +27,9 @@ extern "C" UINT __stdcall WixSchedFormatFiles( PSCZ sczRollbackCustomActionData; LPCWSTR wzQuery = - L"SELECT `WixFormatFiles`.`Binary_`, `WixFormatFiles`.`File_`, `File`.`Component_` " - L"FROM `WixFormatFiles`, `File` " - L"WHERE `WixFormatFiles`.`File_` = `File`.`File`"; + L"SELECT `Wix4FormatFile`.`Binary_`, `Wix4FormatFile`.`File_`, `File`.`Component_` " + L"FROM `Wix4FormatFile`, `File` " + L"WHERE `Wix4FormatFile`.`File_` = `File`.`File`"; enum eQuery { eqBinaryKey = 1, eqFileKey, eqComponentKey }; // initialize @@ -38,7 +38,7 @@ extern "C" UINT __stdcall WixSchedFormatFiles( // query and loop through all the files hr = WcaOpenExecuteView(wzQuery, &hView); - ExitOnFailure(hr, "Failed to open view on WixFormatFiles table"); + ExitOnFailure(hr, "Failed to open view on Wix4FormatFile table"); DWORD cFiles = 0; while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) @@ -100,19 +100,19 @@ extern "C" UINT __stdcall WixSchedFormatFiles( { hr = S_OK; } - ExitOnFailure(hr, "Failure occurred while processing WixFormatFiles table"); + ExitOnFailure(hr, "Failure occurred while processing Wix4FormatFile table"); // schedule deferred CAs if there's anything to do if (sczRollbackCustomActionData && *sczRollbackCustomActionData) { - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"WixRollbackFormatFiles"), sczRollbackCustomActionData, cFiles * COST_FILEFORMATTING); - ExitOnFailure(hr, "Failed to schedule WixRollbackFormatFiles"); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RollbackFormatFiles"), sczRollbackCustomActionData, cFiles * COST_FILEFORMATTING); + ExitOnFailure(hr, "Failed to schedule RollbackFormatFiles"); } if (sczExecCustomActionData && *sczExecCustomActionData) { - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"WixExecFormatFiles"), sczExecCustomActionData, cFiles * COST_FILEFORMATTING); - ExitOnFailure(hr, "Failed to schedule WixExecFormatFiles"); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"ExecFormatFiles"), sczExecCustomActionData, cFiles * COST_FILEFORMATTING); + ExitOnFailure(hr, "Failed to schedule ExecFormatFiles"); } LExit: diff --git a/src/ca/RemoveFoldersEx.cpp b/src/ca/RemoveFoldersEx.cpp index 194c6662..ce64c2c2 100644 --- a/src/ca/RemoveFoldersEx.cpp +++ b/src/ca/RemoveFoldersEx.cpp @@ -2,7 +2,7 @@ #include "precomp.h" -LPCWSTR vcsRemoveFolderExQuery = L"SELECT `WixRemoveFolderEx`, `Component_`, `Property`, `InstallMode` FROM `WixRemoveFolderEx`"; +LPCWSTR vcsRemoveFolderExQuery = L"SELECT `Wix4RemoveFolderEx`, `Component_`, `Property`, `InstallMode` FROM `Wix4RemoveFolderEx`"; enum eRemoveFolderExQuery { rfqId = 1, rfqComponent, rfqProperty, feqMode }; static HRESULT RecursePath( @@ -81,10 +81,10 @@ static HRESULT RecursePath( // Add the row to remove any files and another row to remove the folder. hr = WcaAddTempRecord(phTable, phColumns, L"RemoveFile", NULL, 1, 5, L"RfxFiles", wzComponent, L"*.*", sczProperty, iMode); - ExitOnFailure(hr, "Failed to add row to remove all files for WixRemoveFolderEx row: %S under path:", wzId, wzPath); + ExitOnFailure(hr, "Failed to add row to remove all files for Wix4RemoveFolderEx row: %S under path:", wzId, wzPath); hr = WcaAddTempRecord(phTable, phColumns, L"RemoveFile", NULL, 1, 5, L"RfxFolder", wzComponent, NULL, sczProperty, iMode); - ExitOnFailure(hr, "Failed to add row to remove folder for WixRemoveFolderEx row: %S under path: %S", wzId, wzPath); + ExitOnFailure(hr, "Failed to add row to remove folder for Wix4RemoveFolderEx row: %S under path: %S", wzId, wzPath); LExit: if (INVALID_HANDLE_VALUE != hFind) @@ -122,15 +122,15 @@ extern "C" UINT WINAPI WixRemoveFoldersEx( ExitOnFailure(hr, "Failed to initialize WixRemoveFoldersEx."); // anything to do? - if (S_OK != WcaTableExists(L"WixRemoveFolderEx")) + if (S_OK != WcaTableExists(L"Wix4RemoveFolderEx")) { - WcaLog(LOGMSG_STANDARD, "WixRemoveFolderEx table doesn't exist, so there are no folders to remove."); + WcaLog(LOGMSG_STANDARD, "Wix4RemoveFolderEx table doesn't exist, so there are no folders to remove."); ExitFunction(); } // query and loop through all the remove folders exceptions hr = WcaOpenExecuteView(vcsRemoveFolderExQuery, &hView); - ExitOnFailure(hr, "Failed to open view on WixRemoveFolderEx table"); + ExitOnFailure(hr, "Failed to open view on Wix4RemoveFolderEx table"); while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) { @@ -173,7 +173,7 @@ extern "C" UINT WINAPI WixRemoveFoldersEx( { hr = S_OK; } - ExitOnFailure(hr, "Failure occured while processing WixRemoveFolderEx table"); + ExitOnFailure(hr, "Failure occured while processing Wix4RemoveFolderEx table"); LExit: if (hColumns) diff --git a/src/ca/RestartManager.cpp b/src/ca/RestartManager.cpp index 3cfc07ee..c31819c1 100644 --- a/src/ca/RestartManager.cpp +++ b/src/ca/RestartManager.cpp @@ -18,8 +18,8 @@ enum eRmuResourceType }; LPCWSTR vcsRestartResourceQuery = - L"SELECT `WixRestartResource`.`WixRestartResource`, `WixRestartResource`.`Component_`, `WixRestartResource`.`Resource`, `WixRestartResource`.`Attributes` " - L"FROM `WixRestartResource`"; + L"SELECT `Wix4RestartResource`.`Wix4RestartResource`, `Wix4RestartResource`.`Component_`, `Wix4RestartResource`.`Resource`, `Wix4RestartResource`.`Attributes` " + L"FROM `Wix4RestartResource`"; enum eRestartResourceQuery { rrqRestartResource = 1, rrqComponent, rrqResource, rrqAttributes }; /******************************************************************** @@ -58,9 +58,9 @@ extern "C" UINT __stdcall WixRegisterRestartResources( ExitOnFailure(hr, "Failed to initialize."); // Skip if the table doesn't exist. - if (S_OK != WcaTableExists(L"WixRestartResource")) + if (S_OK != WcaTableExists(L"Wix4RestartResource")) { - WcaLog(LOGMSG_STANDARD, "The RestartResource table does not exist; there are no resources to register with Restart Manager."); + WcaLog(LOGMSG_STANDARD, "The Wix4RestartResource table does not exist; there are no resources to register with Restart Manager."); ExitFunction(); } diff --git a/src/ca/TouchFile.cpp b/src/ca/TouchFile.cpp index 1c40a3eb..e704f922 100644 --- a/src/ca/TouchFile.cpp +++ b/src/ca/TouchFile.cpp @@ -2,7 +2,7 @@ #include "precomp.h" -LPCWSTR vcsTouchFileQuery = L"SELECT `WixTouchFile`, `Component_`, `Path`, `Attributes` FROM `WixTouchFile`"; +LPCWSTR vcsTouchFileQuery = L"SELECT `Wix4TouchFile`, `Component_`, `Path`, `Attributes` FROM `Wix4TouchFile`"; enum TOUCH_FILE_QUERY { tfqId = 1, tfqComponent, tfqPath, tfqTouchFileAttributes }; enum TOUCH_FILE_ATTRIBUTE @@ -134,7 +134,7 @@ static HRESULT ProcessTouchFileTable( LPWSTR sczRollbackData = NULL; LPWSTR sczExecuteData = NULL; - if (S_OK != WcaTableExists(L"WixTouchFile")) + if (S_OK != WcaTableExists(L"Wix4TouchFile")) { ExitFunction(); } @@ -142,7 +142,7 @@ static HRESULT ProcessTouchFileTable( ::GetSystemTimeAsFileTime(&ftModified); hr = WcaOpenExecuteView(vcsTouchFileQuery, &hView); - ExitOnFailure(hr, "Failed to open view on WixTouchFile table"); + ExitOnFailure(hr, "Failed to open view on Wix4TouchFile table"); while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) { @@ -181,18 +181,18 @@ static HRESULT ProcessTouchFileTable( { hr = S_OK; } - ExitOnFailure(hr, "Failure occured while processing WixTouchFile table"); + ExitOnFailure(hr, "Failure occured while processing Wix4TouchFile table"); if (sczRollbackData) { - hr = WcaDoDeferredAction(L"WixRollbackTouchFile", sczRollbackData, 0); - ExitOnFailure(hr, "Failed to schedule WixRollbackTouchFile"); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RollbackTouchFile"), sczRollbackData, 0); + ExitOnFailure(hr, "Failed to schedule RollbackTouchFile"); } if (sczExecuteData) { - hr = WcaDoDeferredAction(L"WixExecuteTouchFile", sczExecuteData, 0); - ExitOnFailure(hr, "Failed to schedule WixExecuteTouchFile"); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"ExecuteTouchFile"), sczExecuteData, 0); + ExitOnFailure(hr, "Failed to schedule ExecuteTouchFile"); } LExit: diff --git a/src/ca/XmlConfig.cpp b/src/ca/XmlConfig.cpp index c12b2bc2..8c60979d 100644 --- a/src/ca/XmlConfig.cpp +++ b/src/ca/XmlConfig.cpp @@ -30,9 +30,9 @@ enum eXmlPreserveDate }; LPCWSTR vcsXmlConfigQuery = - L"SELECT `XmlConfig`.`XmlConfig`, `XmlConfig`.`File`, `XmlConfig`.`ElementPath`, `XmlConfig`.`VerifyPath`, `XmlConfig`.`Name`, " - L"`XmlConfig`.`Value`, `XmlConfig`.`Flags`, `XmlConfig`.`Component_`, `Component`.`Attributes` " - L"FROM `XmlConfig`,`Component` WHERE `XmlConfig`.`Component_`=`Component`.`Component` ORDER BY `File`, `Sequence`"; + L"SELECT `Wix4XmlConfig`.`Wix4XmlConfig`, `Wix4XmlConfig`.`File`, `Wix4XmlConfig`.`ElementPath`, `Wix4XmlConfig`.`VerifyPath`, `Wix4XmlConfig`.`Name`, " + L"`Wix4XmlConfig`.`Value`, `Wix4XmlConfig`.`Flags`, `Wix4XmlConfig`.`Component_`, `Component`.`Attributes` " + L"FROM `Wix4XmlConfig`,`Component` WHERE `Wix4XmlConfig`.`Component_`=`Component`.`Component` ORDER BY `File`, `Sequence`"; enum eXmlConfigQuery { xfqXmlConfig = 1, xfqFile, xfqElementPath, xfqVerifyPath, xfqName, xfqValue, xfqXmlFlags, xfqComponent, xfqCompAttributes }; struct XML_CONFIG_CHANGE @@ -146,7 +146,7 @@ static HRESULT ReadXmlConfigTable( // loop through all the xml configurations hr = WcaOpenExecuteView(vcsXmlConfigQuery, &hView); - ExitOnFailure(hr, "failed to open view on XmlConfig table"); + ExitOnFailure(hr, "failed to open view on Wix4XmlConfig table"); while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) { @@ -155,13 +155,13 @@ static HRESULT ReadXmlConfigTable( // Get record Id hr = WcaGetRecordString(hRec, xfqXmlConfig, &pwzData); - ExitOnFailure(hr, "failed to get XmlConfig record Id"); + ExitOnFailure(hr, "failed to get Wix4XmlConfig record Id"); hr = StringCchCopyW((*ppxfcTail)->wzId, countof((*ppxfcTail)->wzId), pwzData); - ExitOnFailure(hr, "failed to copy XmlConfig record Id"); + ExitOnFailure(hr, "failed to copy Wix4XmlConfig record Id"); // Get component name hr = WcaGetRecordString(hRec, xfqComponent, &pwzData); - ExitOnFailure(hr, "failed to get component name for XmlConfig: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get component name for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); // Get the component's state if (0 < lstrlenW(pwzData)) @@ -175,45 +175,45 @@ static HRESULT ReadXmlConfigTable( // Get the xml file hr = WcaGetRecordFormattedString(hRec, xfqFile, &pwzData); - ExitOnFailure(hr, "failed to get xml file for XmlConfig: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get xml file for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); hr = StringCchCopyW((*ppxfcTail)->wzFile, countof((*ppxfcTail)->wzFile), pwzData); ExitOnFailure(hr, "failed to copy xml file path"); // Figure out if the file is already on the machine or if it's being installed hr = WcaGetRecordString(hRec, xfqFile, &pwzData); - ExitOnFailure(hr, "failed to get xml file for XmlConfig: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get xml file for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); if (NULL != wcsstr(pwzData, L"[!") || NULL != wcsstr(pwzData, L"[#")) { (*ppxfcTail)->fInstalledFile = TRUE; } - // Get the XmlConfig table flags + // Get the Wix4XmlConfig table flags hr = WcaGetRecordInteger(hRec, xfqXmlFlags, &(*ppxfcTail)->iXmlFlags); - ExitOnFailure(hr, "failed to get XmlConfig flags for XmlConfig: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get Wix4XmlConfig flags for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); // Get the Element Path hr = WcaGetRecordFormattedString(hRec, xfqElementPath, &(*ppxfcTail)->pwzElementPath); - ExitOnFailure(hr, "failed to get Element Path for XmlConfig: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get Element Path for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); // Get the Verify Path hr = WcaGetRecordFormattedString(hRec, xfqVerifyPath, &(*ppxfcTail)->pwzVerifyPath); - ExitOnFailure(hr, "failed to get Verify Path for XmlConfig: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get Verify Path for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); // Get the name hr = WcaGetRecordFormattedString(hRec, xfqName, &pwzData); - ExitOnFailure(hr, "failed to get Name for XmlConfig: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get Name for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); hr = StringCchCopyW((*ppxfcTail)->wzName, countof((*ppxfcTail)->wzName), pwzData); ExitOnFailure(hr, "failed to copy name of element"); // Get the value hr = WcaGetRecordFormattedString(hRec, xfqValue, &pwzData); - ExitOnFailure(hr, "failed to get Value for XmlConfig: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get Value for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); hr = StrAllocString(&(*ppxfcTail)->pwzValue, pwzData, 0); ExitOnFailure(hr, "failed to allocate buffer for value"); // Get the component attributes hr = WcaGetRecordInteger(hRec, xfqCompAttributes, &(*ppxfcTail)->iCompAttributes); - ExitOnFailure(hr, "failed to get component attributes for XmlConfig: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get component attributes for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); } // if we looped through all records all is well @@ -359,7 +359,7 @@ static HRESULT BeginChangeFile( hr = WcaWriteStreamToCaData(pbData, cbData, &pwzRollbackCustomActionData); ExitOnFailure(hr, "failed to write file contents to rollback custom action data."); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"ExecXmlConfigRollback"), pwzRollbackCustomActionData, COST_XMLFILE); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"ExecXmlConfigRollback"), pwzRollbackCustomActionData, COST_XMLFILE); ExitOnFailure(hr, "failed to schedule ExecXmlConfigRollback for file: %ls", pwzFile); ReleaseStr(pwzRollbackCustomActionData); @@ -459,10 +459,10 @@ extern "C" UINT __stdcall SchedXmlConfig( ExitOnFailure(hr, "failed to initialize"); hr = ReadXmlConfigTable(&pxfcHead, &pxfcTail); - MessageExitOnFailure(hr, msierrXmlConfigFailedRead, "failed to read XmlConfig table"); + MessageExitOnFailure(hr, msierrXmlConfigFailedRead, "failed to read Wix4XmlConfig table"); hr = ProcessChanges(&pxfcHead); - ExitOnFailure(hr, "failed to process XmlConfig changes"); + ExitOnFailure(hr, "failed to process Wix4XmlConfig changes"); // loop through all the xml configurations for (pxfc = pxfcHead; pxfc; pxfc = pxfc->pxfcNext) @@ -557,7 +557,7 @@ extern "C" UINT __stdcall SchedXmlConfig( { Assert(0 < cFiles); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"ExecXmlConfig"), pwzCustomActionData, cFiles * COST_XMLFILE); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"ExecXmlConfig"), pwzCustomActionData, cFiles * COST_XMLFILE); ExitOnFailure(hr, "failed to schedule ExecXmlConfig action"); } diff --git a/src/ca/XmlFile.cpp b/src/ca/XmlFile.cpp index fc6f519b..95449126 100644 --- a/src/ca/XmlFile.cpp +++ b/src/ca/XmlFile.cpp @@ -36,9 +36,9 @@ enum eXmlSelectionLanguage }; LPCWSTR vcsXmlFileQuery = - L"SELECT `XmlFile`.`XmlFile`, `XmlFile`.`File`, `XmlFile`.`ElementPath`, `XmlFile`.`Name`, `XmlFile`.`Value`, " - L"`XmlFile`.`Flags`, `XmlFile`.`Component_`, `Component`.`Attributes` " - L"FROM `XmlFile`,`Component` WHERE `XmlFile`.`Component_`=`Component`.`Component` ORDER BY `File`, `Sequence`"; + L"SELECT `Wix4XmlFile`.`Wix4XmlFile`, `Wix4XmlFile`.`File`, `Wix4XmlFile`.`ElementPath`, `Wix4XmlFile`.`Name`, `Wix4XmlFile`.`Value`, " + L"`Wix4XmlFile`.`Flags`, `Wix4XmlFile`.`Component_`, `Component`.`Attributes` " + L"FROM `Wix4XmlFile`,`Component` WHERE `Wix4XmlFile`.`Component_`=`Component`.`Component` ORDER BY `File`, `Sequence`"; enum eXmlFileQuery { xfqXmlFile = 1, xfqFile, xfqXPath, xfqName, xfqValue, xfqXmlFlags, xfqComponent, xfqCompAttributes }; struct XML_FILE_CHANGE @@ -130,12 +130,14 @@ static HRESULT ReadXmlFileTable( LPWSTR pwzData = NULL; // check to see if necessary tables are specified - if (S_FALSE == WcaTableExists(L"XmlFile")) + if (S_FALSE == WcaTableExists(L"Wix4XmlFile")) + { ExitFunction1(hr = S_FALSE); + } // loop through all the xml configurations hr = WcaOpenExecuteView(vcsXmlFileQuery, &hView); - ExitOnFailure(hr, "failed to open view on XmlFile table"); + ExitOnFailure(hr, "failed to open view on Wix4XmlFile table"); while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) { @@ -144,13 +146,13 @@ static HRESULT ReadXmlFileTable( // Get record Id hr = WcaGetRecordString(hRec, xfqXmlFile, &pwzData); - ExitOnFailure(hr, "failed to get XmlFile record Id"); + ExitOnFailure(hr, "failed to get Wix4XmlFile record Id"); hr = StringCchCopyW((*ppxfcTail)->wzId, countof((*ppxfcTail)->wzId), pwzData); - ExitOnFailure(hr, "failed to copy XmlFile record Id"); + ExitOnFailure(hr, "failed to copy Wix4XmlFile record Id"); // Get component name hr = WcaGetRecordString(hRec, xfqComponent, &pwzData); - ExitOnFailure(hr, "failed to get component name for XmlFile: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get component name for Wix4XmlFile: %ls", (*ppxfcTail)->wzId); // Get the component's state er = ::MsiGetComponentStateW(WcaGetInstallHandle(), pwzData, &(*ppxfcTail)->isInstalled, &(*ppxfcTail)->isAction); @@ -158,33 +160,33 @@ static HRESULT ReadXmlFileTable( // Get the xml file hr = WcaGetRecordFormattedString(hRec, xfqFile, &pwzData); - ExitOnFailure(hr, "failed to get xml file for XmlFile: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get xml file for Wix4XmlFile: %ls", (*ppxfcTail)->wzId); hr = StringCchCopyW((*ppxfcTail)->wzFile, countof((*ppxfcTail)->wzFile), pwzData); ExitOnFailure(hr, "failed to copy xml file path"); - // Get the XmlFile table flags + // Get the Wix4XmlFile table flags hr = WcaGetRecordInteger(hRec, xfqXmlFlags, &(*ppxfcTail)->iXmlFlags); - ExitOnFailure(hr, "failed to get XmlFile flags for XmlFile: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get Wix4XmlFile flags for Wix4XmlFile: %ls", (*ppxfcTail)->wzId); // Get the XPath hr = WcaGetRecordFormattedString(hRec, xfqXPath, &(*ppxfcTail)->pwzElementPath); - ExitOnFailure(hr, "failed to get XPath for XmlFile: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get XPath for Wix4XmlFile: %ls", (*ppxfcTail)->wzId); // Get the name hr = WcaGetRecordFormattedString(hRec, xfqName, &pwzData); - ExitOnFailure(hr, "failed to get Name for XmlFile: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get Name for Wix4XmlFile: %ls", (*ppxfcTail)->wzId); hr = StringCchCopyW((*ppxfcTail)->wzName, countof((*ppxfcTail)->wzName), pwzData); ExitOnFailure(hr, "failed to copy name of element"); // Get the value hr = WcaGetRecordFormattedString(hRec, xfqValue, &pwzData); - ExitOnFailure(hr, "failed to get Value for XmlFile: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get Value for Wix4XmlFile: %ls", (*ppxfcTail)->wzId); hr = StrAllocString(&(*ppxfcTail)->pwzValue, pwzData, 0); ExitOnFailure(hr, "failed to allocate buffer for value"); // Get the component attributes hr = WcaGetRecordInteger(hRec, xfqCompAttributes, &(*ppxfcTail)->iCompAttributes); - ExitOnFailure(hr, "failed to get component attributes for XmlFile: %ls", (*ppxfcTail)->wzId); + ExitOnFailure(hr, "failed to get component attributes for Wix4XmlFile: %ls", (*ppxfcTail)->wzId); } // if we looped through all records all is well @@ -254,7 +256,7 @@ static HRESULT BeginChangeFile( hr = WcaWriteStreamToCaData(pbData, cbData, &pwzRollbackCustomActionData); ExitOnFailure(hr, "failed to write file contents to rollback custom action data."); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"ExecXmlFileRollback"), pwzRollbackCustomActionData, COST_XMLFILE); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"ExecXmlFileRollback"), pwzRollbackCustomActionData, COST_XMLFILE); ExitOnFailure(hr, "failed to schedule ExecXmlFileRollback for file: %ls", pwzFile); ReleaseStr(pwzRollbackCustomActionData); @@ -325,11 +327,11 @@ extern "C" UINT __stdcall SchedXmlFile( hr = ReadXmlFileTable(&pxfcHead, &pxfcTail); if (S_FALSE == hr) { - WcaLog(LOGMSG_VERBOSE, "Skipping SchedXmlFile because XmlFile table not present"); + WcaLog(LOGMSG_VERBOSE, "Skipping SchedXmlFile because Wix4XmlFile table not present"); ExitFunction1(hr = S_OK); } - MessageExitOnFailure(hr, msierrXmlFileFailedRead, "failed to read XmlFile table"); + MessageExitOnFailure(hr, msierrXmlFileFailedRead, "failed to read Wix4XmlFile table"); // loop through all the xml configurations for (pxfc = pxfcHead; pxfc; pxfc = pxfc->pxfcNext) @@ -454,7 +456,7 @@ extern "C" UINT __stdcall SchedXmlFile( { Assert(0 < cFiles); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"ExecXmlFile"), pwzCustomActionData, cFiles * COST_XMLFILE); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"ExecXmlFile"), pwzCustomActionData, cFiles * COST_XMLFILE); ExitOnFailure(hr, "failed to schedule ExecXmlFile action"); } diff --git a/src/ca/caDecor.h b/src/ca/caDecor.h new file mode 100644 index 00000000..56cfb201 --- /dev/null +++ b/src/ca/caDecor.h @@ -0,0 +1,13 @@ +#pragma once +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + + +#if defined(_M_ARM64) +#define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_A64" +#elif defined(_M_AMD64) +#define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_X64" +#elif defined(_M_ARM) +#define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_ARM" +#else +#define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_X86" +#endif diff --git a/src/ca/caSuffix.h b/src/ca/caSuffix.h deleted file mode 100644 index 303a99e9..00000000 --- a/src/ca/caSuffix.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - - -#if defined _WIN64 -#define PLATFORM_DECORATION(f) f L"_64" -#elif defined ARM -#define PLATFORM_DECORATION(f) f L"_ARM" -#else -#define PLATFORM_DECORATION(f) f -#endif diff --git a/src/ca/netshortcuts.cpp b/src/ca/netshortcuts.cpp index 59ef838b..6ff129db 100644 --- a/src/ca/netshortcuts.cpp +++ b/src/ca/netshortcuts.cpp @@ -4,7 +4,7 @@ LPCWSTR vcsShortcutsQuery = L"SELECT `Component_`, `Directory_`, `Name`, `Target`, `Attributes`, `IconFile`, `IconIndex` " - L"FROM `WixInternetShortcut`"; + L"FROM `Wix4InternetShortcut`"; enum eShortcutsQuery { esqComponent = 1, esqDirectory, esqFilename, esqTarget, esqAttributes, esqIconFile, esqIconIndex }; enum eShortcutsAttributes { esaLink = 0, esaURL = 1 }; @@ -44,9 +44,9 @@ extern "C" UINT __stdcall WixSchedInternetShortcuts( ExitOnFailure(hr, "failed to initialize WixSchedInternetShortcuts."); // anything to do? - if (S_OK != WcaTableExists(L"WixInternetShortcut")) + if (S_OK != WcaTableExists(L"Wix4InternetShortcut")) { - WcaLog(LOGMSG_STANDARD, "WixInternetShortcut table doesn't exist, so there are no Internet shortcuts to process"); + WcaLog(LOGMSG_STANDARD, "Wix4InternetShortcut table doesn't exist, so there are no Internet shortcuts to process"); goto LExit; } @@ -71,7 +71,7 @@ extern "C" UINT __stdcall WixSchedInternetShortcuts( // query and loop through all the shortcuts hr = WcaOpenExecuteView(vcsShortcutsQuery, &hView); - ExitOnFailure(hr, "failed to open view on WixInternetShortcut table"); + ExitOnFailure(hr, "failed to open view on Wix4InternetShortcut table"); while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) { @@ -91,7 +91,7 @@ extern "C" UINT __stdcall WixSchedInternetShortcuts( hr = WcaGetRecordInteger(hRec, esqIconIndex, &iIconIndex); ExitOnFailure(hr, "failed to get shortcut icon index"); - // skip processing this WixInternetShortcut row if the component isn't being configured + // skip processing this Wix4InternetShortcut row if the component isn't being configured WCA_TODO todo = WcaGetComponentToDo(pwzComponent); if (WCA_TODO_UNKNOWN == todo) { @@ -144,7 +144,7 @@ extern "C" UINT __stdcall WixSchedInternetShortcuts( { hr = S_OK; } - ExitOnFailure(hr, "Failure occured while processing WixInternetShortcut table"); + ExitOnFailure(hr, "Failure occured while processing Wix4InternetShortcut table"); // if we have any shortcuts to install if (pwzCustomActionData && *pwzCustomActionData) @@ -154,9 +154,9 @@ extern "C" UINT __stdcall WixSchedInternetShortcuts( ExitOnFailure(hr, "failed to extend progress bar for InternetShortcuts"); // provide custom action data to deferred and rollback CAs - hr = WcaSetProperty(PLATFORM_DECORATION(L"WixRollbackInternetShortcuts"), pwzCustomActionData); + hr = WcaSetProperty(CUSTOM_ACTION_DECORATION(L"RollbackInternetShortcuts"), pwzCustomActionData); ExitOnFailure(hr, "failed to set WixRollbackInternetShortcuts rollback custom action data"); - hr = WcaSetProperty(PLATFORM_DECORATION(L"WixCreateInternetShortcuts"), pwzCustomActionData); + hr = WcaSetProperty(CUSTOM_ACTION_DECORATION(L"CreateInternetShortcuts"), pwzCustomActionData); ExitOnFailure(hr, "failed to set WixCreateInternetShortcuts custom action data"); } diff --git a/src/ca/precomp.h b/src/ca/precomp.h index 66e2f6b0..c5d6afe5 100644 --- a/src/ca/precomp.h +++ b/src/ca/precomp.h @@ -51,4 +51,4 @@ #include "scasmb.h" #include "scasmbexec.h" -#include "caSuffix.h" +#include "caDecor.h" diff --git a/src/ca/scamanifest.cpp b/src/ca/scamanifest.cpp index 58b4054d..adb8d3d3 100644 --- a/src/ca/scamanifest.cpp +++ b/src/ca/scamanifest.cpp @@ -2,8 +2,8 @@ #include "precomp.h" -LPCWSTR vcsPerfmonManifestQuery = L"SELECT `Component_`, `File`, `ResourceFileDirectory` FROM `PerfmonManifest`"; -LPCWSTR vcsEventManifestQuery = L"SELECT `Component_`, `File` FROM `EventManifest`"; +LPCWSTR vcsPerfmonManifestQuery = L"SELECT `Component_`, `File`, `ResourceFileDirectory` FROM `Wix4PerfmonManifest`"; +LPCWSTR vcsEventManifestQuery = L"SELECT `Component_`, `File` FROM `Wix4EventManifest`"; enum ePerfMonManifestQuery { pfmComponent = 1, pfmFile, pfmResourceFileDir }; enum eEventManifestQuery { emComponent = 1, emFile}; @@ -46,9 +46,9 @@ extern "C" UINT __stdcall ConfigurePerfmonManifestRegister( ExitFunction1(hr = S_FALSE); } // check to see if necessary tables are specified - if (S_OK != WcaTableExists(L"PerfmonManifest")) + if (S_OK != WcaTableExists(L"Wix4PerfmonManifest")) { - WcaLog(LOGMSG_VERBOSE, "Skipping ConfigurePerfmonManifestRegister() because PerfmonManifest table not present"); + WcaLog(LOGMSG_VERBOSE, "Skipping ConfigurePerfmonManifestRegister() because Wix4PerfmonManifest table not present"); ExitFunction1(hr = S_FALSE); } @@ -79,7 +79,7 @@ extern "C" UINT __stdcall ConfigurePerfmonManifestRegister( hr = StrAllocFormatted(&pwzCommand, L"\"unlodctr.exe\" /m:\"%s\"", pwzFile); ExitOnFailure(hr, "failed to copy string in PerfMonManifest"); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RollbackRegisterPerfmonManifest"), pwzCommand, COST_PERFMONMANIFEST_UNREGISTER); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RollbackRegisterPerfmonManifest"), pwzCommand, COST_PERFMONMANIFEST_UNREGISTER); ExitOnFailure(hr, "failed to schedule RollbackRegisterPerfmonManifest action"); if ( *pwzResourceFilePath ) @@ -95,7 +95,7 @@ extern "C" UINT __stdcall ConfigurePerfmonManifestRegister( WcaLog(LOGMSG_VERBOSE, "RegisterPerfmonManifest's CustomActionData: '%ls'", pwzCommand); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RegisterPerfmonManifest"), pwzCommand, COST_PERFMONMANIFEST_REGISTER); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RegisterPerfmonManifest"), pwzCommand, COST_PERFMONMANIFEST_REGISTER); ExitOnFailure(hr, "failed to schedule RegisterPerfmonManifest action"); } @@ -143,40 +143,40 @@ extern "C" UINT __stdcall ConfigurePerfmonManifestUnregister( ExitFunction1(hr = S_FALSE); } // check to see if necessary tables are specified - if (WcaTableExists(L"PerfmonManifest") != S_OK) + if (WcaTableExists(L"Wix4PerfmonManifest") != S_OK) { - WcaLog(LOGMSG_VERBOSE, "Skipping ConfigurePerfmonManifestUnregister() because PerfmonManifest table not present"); + WcaLog(LOGMSG_VERBOSE, "Skipping ConfigurePerfmonManifestUnregister() because Wix4PerfmonManifest table not present"); ExitFunction1(hr = S_FALSE); } hr = WcaOpenExecuteView(vcsPerfmonManifestQuery, &hView); - ExitOnFailure(hr, "failed to open view on PerfMonManifest table"); + ExitOnFailure(hr, "failed to open view on Wix4PerfmonManifest table"); while ((hr = WcaFetchRecord(hView, &hRec)) == S_OK) { // get component install state hr = WcaGetRecordString(hRec, pfmComponent, &pwzData); - ExitOnFailure(hr, "failed to get Component for PerfMonManifest"); + ExitOnFailure(hr, "failed to get Component for Wix4PerfmonManifest"); er = ::MsiGetComponentStateW(hInstall, pwzData, &isInstalled, &isAction); hr = HRESULT_FROM_WIN32(er); - ExitOnFailure(hr, "failed to get Component state for PerfMonManifest"); + ExitOnFailure(hr, "failed to get Component state for Wix4PerfmonManifest"); if (!WcaIsUninstalling(isInstalled, isAction)) { continue; } hr = WcaGetRecordFormattedString(hRec, pfmFile, &pwzFile); - ExitOnFailure(hr, "failed to get File for PerfMonManifest"); + ExitOnFailure(hr, "failed to get File for Wix4PerfmonManifest"); hr = WcaGetRecordFormattedString(hRec, pfmResourceFileDir, &pwzResourceFilePath); - ExitOnFailure(hr, "failed to get ApplicationIdentity for PerfMonManifest"); + ExitOnFailure(hr, "failed to get ApplicationIdentity for Wix4PerfmonManifest"); size_t iResourcePath = lstrlenW(pwzResourceFilePath); if ( iResourcePath > 0 && *(pwzResourceFilePath + iResourcePath -1) == L'\\') *(pwzResourceFilePath + iResourcePath -1) = 0; //remove the trailing '\' hr = StrAllocFormatted(&pwzCommand, L"\"lodctr.exe\" /m:\"%s\" \"%s\"", pwzFile, pwzResourceFilePath); - ExitOnFailure(hr, "failed to copy string in PerfMonManifest"); + ExitOnFailure(hr, "failed to copy string in Wix4PerfmonManifest"); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RollbackUnregisterPerfmonManifest"), pwzCommand, COST_PERFMONMANIFEST_REGISTER); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RollbackUnregisterPerfmonManifest"), pwzCommand, COST_PERFMONMANIFEST_REGISTER); ExitOnFailure(hr, "failed to schedule RollbackUnregisterPerfmonManifest action"); hr = StrAllocFormatted(&pwzCommand, L"\"unlodctr.exe\" /m:\"%s\"", pwzFile); @@ -184,7 +184,7 @@ extern "C" UINT __stdcall ConfigurePerfmonManifestUnregister( WcaLog(LOGMSG_VERBOSE, "UnRegisterPerfmonManifest's CustomActionData: '%ls'", pwzCommand); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"UnregisterPerfmonManifest"), pwzCommand, COST_PERFMONMANIFEST_UNREGISTER); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"UnregisterPerfmonManifest"), pwzCommand, COST_PERFMONMANIFEST_UNREGISTER); ExitOnFailure(hr, "failed to schedule UnregisterPerfmonManifest action"); } @@ -231,41 +231,41 @@ extern "C" UINT __stdcall ConfigureEventManifestRegister( ExitFunction1(hr = S_FALSE); } // check to see if necessary tables are specified - if (S_OK != WcaTableExists(L"EventManifest")) + if (S_OK != WcaTableExists(L"Wix4EventManifest")) { - WcaLog(LOGMSG_VERBOSE, "Skipping ConfigureEventManifestRegister() because EventManifest table not present"); + WcaLog(LOGMSG_VERBOSE, "Skipping ConfigureEventManifestRegister() because Wix4EventManifest table not present"); ExitFunction1(hr = S_FALSE); } hr = WcaOpenExecuteView(vcsEventManifestQuery, &hView); - ExitOnFailure(hr, "failed to open view on EventManifest table"); + ExitOnFailure(hr, "failed to open view on Wix4EventManifest table"); while ((hr = WcaFetchRecord(hView, &hRec)) == S_OK) { // get component install state hr = WcaGetRecordString(hRec, emComponent, &pwzData); - ExitOnFailure(hr, "failed to get Component for EventManifest"); + ExitOnFailure(hr, "failed to get Component for Wix4EventManifest"); er = ::MsiGetComponentStateW(hInstall, pwzData, &isInstalled, &isAction); hr = HRESULT_FROM_WIN32(er); - ExitOnFailure(hr, "failed to get Component state for EventManifest"); + ExitOnFailure(hr, "failed to get Component state for Wix4EventManifest"); if (!WcaIsInstalling(isInstalled, isAction)) { continue; } hr = WcaGetRecordFormattedString(hRec, emFile, &pwzFile); - ExitOnFailure(hr, "failed to get File for EventManifest"); + ExitOnFailure(hr, "failed to get File for Wix4EventManifest"); hr = StrAllocFormatted(&pwzCommand, L"\"wevtutil.exe\" um \"%s\"", pwzFile); - ExitOnFailure(hr, "failed to copy string in EventManifest"); + ExitOnFailure(hr, "failed to copy string in Wix4EventManifest"); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RollbackRegisterEventManifest"), pwzCommand, COST_PERFMONMANIFEST_UNREGISTER); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RollbackRegisterEventManifest"), pwzCommand, COST_PERFMONMANIFEST_UNREGISTER); ExitOnFailure(hr, "failed to schedule RollbackRegisterEventManifest action"); hr = StrAllocFormatted(&pwzCommand, L"\"wevtutil.exe\" im \"%s\"", pwzFile); - ExitOnFailure(hr, "failed to copy string in EventManifest"); + ExitOnFailure(hr, "failed to copy string in Wix4EventManifest"); WcaLog(LOGMSG_VERBOSE, "RegisterEventManifest's CustomActionData: '%ls'", pwzCommand); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RegisterEventManifest"), pwzCommand, COST_EVENTMANIFEST_REGISTER); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RegisterEventManifest"), pwzCommand, COST_EVENTMANIFEST_REGISTER); ExitOnFailure(hr, "failed to schedule RegisterEventManifest action"); } @@ -273,7 +273,7 @@ extern "C" UINT __stdcall ConfigureEventManifestRegister( { hr = S_OK; } - ExitOnFailure(hr, "Failure while processing EventManifest"); + ExitOnFailure(hr, "Failure while processing Wix4EventManifest"); hr = S_OK; @@ -313,22 +313,22 @@ extern "C" UINT __stdcall ConfigureEventManifestUnregister( ExitFunction1(hr = S_FALSE); } // check to see if necessary tables are specified - if (S_OK != WcaTableExists(L"EventManifest")) + if (S_OK != WcaTableExists(L"Wix4EventManifest")) { - WcaLog(LOGMSG_VERBOSE, "Skipping ConfigureEventManifestUnregister() because EventManifest table not present"); + WcaLog(LOGMSG_VERBOSE, "Skipping ConfigureEventManifestUnregister() because Wix4EventManifest table not present"); ExitFunction1(hr = S_FALSE); } hr = WcaOpenExecuteView(vcsEventManifestQuery, &hView); - ExitOnFailure(hr, "failed to open view on EventManifest table"); + ExitOnFailure(hr, "failed to open view on Wix4EventManifest table"); while ((hr = WcaFetchRecord(hView, &hRec)) == S_OK) { // get component install state hr = WcaGetRecordString(hRec, emComponent, &pwzData); - ExitOnFailure(hr, "failed to get Component for EventManifest"); + ExitOnFailure(hr, "failed to get Component for Wix4EventManifest"); er = ::MsiGetComponentStateW(hInstall, pwzData, &isInstalled, &isAction); hr = HRESULT_FROM_WIN32(er); - ExitOnFailure(hr, "failed to get Component state for EventManifest"); + ExitOnFailure(hr, "failed to get Component state for Wix4EventManifest"); // nothing to do on an install // schedule the rollback action when reinstalling to re-register pre-patch manifest @@ -338,22 +338,22 @@ extern "C" UINT __stdcall ConfigureEventManifestUnregister( } hr = WcaGetRecordFormattedString(hRec, emFile, &pwzFile); - ExitOnFailure(hr, "failed to get File for EventManifest"); + ExitOnFailure(hr, "failed to get File for Wix4EventManifest"); hr = StrAllocFormatted(&pwzCommand, L"\"wevtutil.exe\" im \"%s\"", pwzFile); - ExitOnFailure(hr, "failed to copy string in EventManifest"); + ExitOnFailure(hr, "failed to copy string in Wix4EventManifest"); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RollbackUnregisterEventManifest"), pwzCommand, COST_PERFMONMANIFEST_REGISTER); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RollbackUnregisterEventManifest"), pwzCommand, COST_PERFMONMANIFEST_REGISTER); ExitOnFailure(hr, "failed to schedule RollbackUnregisterEventManifest action"); // no need to uninstall on a repair/patch. Register action will re-register and update the manifest. if (!WcaIsReInstalling(isInstalled, isAction)) { hr = StrAllocFormatted(&pwzCommand, L"\"wevtutil.exe\" um \"%s\"", pwzFile); - ExitOnFailure(hr, "failed to copy string in EventManifest"); + ExitOnFailure(hr, "failed to copy string in Wix4EventManifest"); WcaLog(LOGMSG_VERBOSE, "UnregisterEventManifest's CustomActionData: '%ls'", pwzCommand); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"UnregisterEventManifest"), pwzCommand, COST_PERFMONMANIFEST_UNREGISTER); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"UnregisterEventManifest"), pwzCommand, COST_PERFMONMANIFEST_UNREGISTER); ExitOnFailure(hr, "failed to schedule UnregisterEventManifest action"); } } @@ -362,7 +362,7 @@ extern "C" UINT __stdcall ConfigureEventManifestUnregister( { hr = S_OK; } - ExitOnFailure(hr, "Failure while processing EventManifest"); + ExitOnFailure(hr, "Failure while processing Wix4EventManifest"); hr = S_OK; diff --git a/src/ca/scaperf.cpp b/src/ca/scaperf.cpp index 82f458af..fd301278 100644 --- a/src/ca/scaperf.cpp +++ b/src/ca/scaperf.cpp @@ -2,10 +2,10 @@ #include "precomp.h" -LPCWSTR vcsPerfCounterDataQuery = L"SELECT `PerformanceCategory`, `Component_`, `Name`, `IniData`, `ConstantData` FROM `PerformanceCategory`"; +LPCWSTR vcsPerfCounterDataQuery = L"SELECT `Wix4PerformanceCategory`, `Component_`, `Name`, `IniData`, `ConstantData` FROM `Wix4PerformanceCategory`"; enum ePerfCounterDataQuery { pcdqId = 1, pcdqComponent, pcdqName, pcdqIniData, pcdqConstantData }; -LPCWSTR vcsPerfMonQuery = L"SELECT `Component_`, `File`, `Name` FROM `Perfmon`"; +LPCWSTR vcsPerfMonQuery = L"SELECT `Component_`, `File`, `Name` FROM `Wix4Perfmon`"; enum ePerfMonQuery { pmqComponent = 1, pmqFile, pmqName }; @@ -32,7 +32,7 @@ extern "C" UINT __stdcall InstallPerfCounterData( ExitOnFailure(hr, "Failed to initialize InstallPerfCounterData."); hr = ProcessPerformanceCategory(hInstall, TRUE); - MessageExitOnFailure(hr, msierrInstallPerfCounterData, "Failed to process PerformanceCategory table."); + MessageExitOnFailure(hr, msierrInstallPerfCounterData, "Failed to process Wix4PerformanceCategory table."); LExit: er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; @@ -57,7 +57,7 @@ extern "C" UINT __stdcall UninstallPerfCounterData( ExitOnFailure(hr, "Failed to initialize UninstallPerfCounterData."); hr = ProcessPerformanceCategory(hInstall, FALSE); - MessageExitOnFailure(hr, msierrUninstallPerfCounterData, "Failed to process PerformanceCategory table."); + MessageExitOnFailure(hr, msierrUninstallPerfCounterData, "Failed to process Wix4PerformanceCategory table."); LExit: er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; @@ -85,9 +85,9 @@ extern "C" UINT __stdcall ConfigurePerfmonInstall( ExitOnFailure(hr, "Failed to initialize"); // check to see if necessary tables are specified - if (S_OK != WcaTableExists(L"Perfmon")) + if (S_OK != WcaTableExists(L"Wix4Perfmon")) { - WcaLog(LOGMSG_VERBOSE, "Skipping RegisterPerfmon() because Perfmon table not present"); + WcaLog(LOGMSG_VERBOSE, "Skipping RegisterPerfmon() because Wix4Perfmon table not present"); ExitFunction1(hr = S_FALSE); } @@ -113,9 +113,9 @@ extern "C" UINT __stdcall ConfigurePerfmonInstall( ExitOnFailure(hr, "failed to get File for PerfMon"); WcaLog(LOGMSG_VERBOSE, "ConfigurePerfmonInstall's CustomActionData: '%ls', '%ls'", pwzName, pwzFile); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RegisterPerfmon"), pwzFile, COST_PERFMON_REGISTER); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RegisterPerfmon"), pwzFile, COST_PERFMON_REGISTER); ExitOnFailure(hr, "failed to schedule RegisterPerfmon action"); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RollbackRegisterPerfmon"), pwzName, COST_PERFMON_UNREGISTER); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RollbackRegisterPerfmon"), pwzName, COST_PERFMON_UNREGISTER); ExitOnFailure(hr, "failed to schedule RollbackRegisterPerfmon action"); } @@ -158,9 +158,9 @@ extern "C" UINT __stdcall ConfigurePerfmonUninstall( ExitOnFailure(hr, "Failed to initialize"); // check to see if necessary tables are specified - if (WcaTableExists(L"Perfmon") != S_OK) + if (WcaTableExists(L"Wix4Perfmon") != S_OK) { - WcaLog(LOGMSG_VERBOSE, "Skipping UnregisterPerfmon() because Perfmon table not present"); + WcaLog(LOGMSG_VERBOSE, "Skipping UnregisterPerfmon() because Wix4Perfmon table not present"); ExitFunction1(hr = S_FALSE); } @@ -186,9 +186,9 @@ extern "C" UINT __stdcall ConfigurePerfmonUninstall( ExitOnFailure(hr, "failed to get File for PerfMon"); WcaLog(LOGMSG_VERBOSE, "ConfigurePerfmonUninstall's CustomActionData: '%ls', '%ls'", pwzName, pwzFile); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"UnregisterPerfmon"), pwzName, COST_PERFMON_UNREGISTER); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"UnregisterPerfmon"), pwzName, COST_PERFMON_UNREGISTER); ExitOnFailure(hr, "failed to schedule UnregisterPerfmon action"); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RollbackUnregisterPerfmon"), pwzFile, COST_PERFMON_REGISTER); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RollbackUnregisterPerfmon"), pwzFile, COST_PERFMON_REGISTER); ExitOnFailure(hr, "failed to schedule RollbackUnregisterPerfmon action"); } @@ -229,26 +229,26 @@ static HRESULT ProcessPerformanceCategory( LPWSTR pwzCustomActionData = NULL; // check to see if necessary tables are specified - if (S_OK != WcaTableExists(L"PerformanceCategory")) + if (S_OK != WcaTableExists(L"Wix4PerformanceCategory")) { ExitFunction1(hr = S_FALSE); } hr = WcaOpenExecuteView(vcsPerfCounterDataQuery, &hView); - ExitOnFailure(hr, "failed to open view on PerformanceCategory table"); + ExitOnFailure(hr, "failed to open view on Wix4PerformanceCategory table"); while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) { hr = WcaGetRecordString(hRec, pcdqId, &pwzId); - ExitOnFailure(hr, "Failed to get id for PerformanceCategory."); + ExitOnFailure(hr, "Failed to get id for Wix4PerformanceCategory."); // Check to see if the Component is being installed or uninstalled // when we are processing the same. hr = WcaGetRecordString(hRec, pcdqComponent, &pwzComponent); - ExitOnFailure(hr, "Failed to get Component for PerformanceCategory: %ls", pwzId); + ExitOnFailure(hr, "Failed to get Component for Wix4PerformanceCategory: %ls", pwzId); er = ::MsiGetComponentStateW(hInstall, pwzComponent, &isInstalled, &isAction); hr = HRESULT_FROM_WIN32(er); - ExitOnFailure(hr, "Failed to get Component state for PerformanceCategory: %ls", pwzId); + ExitOnFailure(hr, "Failed to get Component state for Wix4PerformanceCategory: %ls", pwzId); if ((fInstall && !WcaIsInstalling(isInstalled, isAction)) || (!fInstall && !WcaIsUninstalling(isInstalled, isAction))) @@ -257,45 +257,45 @@ static HRESULT ProcessPerformanceCategory( } hr = WcaGetRecordString(hRec, pcdqName, &pwzName); - ExitOnFailure(hr, "Failed to get Name for PerformanceCategory: %ls", pwzId); + ExitOnFailure(hr, "Failed to get Name for Wix4PerformanceCategory: %ls", pwzId); hr = WcaWriteStringToCaData(pwzName, &pwzCustomActionData); - ExitOnFailure(hr, "Failed to add Name to CustomActionData for PerformanceCategory: %ls", pwzId); + ExitOnFailure(hr, "Failed to add Name to CustomActionData for Wix4PerformanceCategory: %ls", pwzId); hr = WcaGetRecordString(hRec, pcdqIniData, &pwzData); - ExitOnFailure(hr, "Failed to get IniData for PerformanceCategory: %ls", pwzId); + ExitOnFailure(hr, "Failed to get IniData for Wix4PerformanceCategory: %ls", pwzId); hr = WcaWriteStringToCaData(pwzData, &pwzCustomActionData); - ExitOnFailure(hr, "Failed to add IniData to CustomActionData for PerformanceCategory: %ls", pwzId); + ExitOnFailure(hr, "Failed to add IniData to CustomActionData for Wix4PerformanceCategory: %ls", pwzId); hr = WcaGetRecordString(hRec, pcdqConstantData, &pwzData); - ExitOnFailure(hr, "Failed to get ConstantData for PerformanceCategory: %ls", pwzId); + ExitOnFailure(hr, "Failed to get ConstantData for Wix4PerformanceCategory: %ls", pwzId); hr = WcaWriteStringToCaData(pwzData, &pwzCustomActionData); - ExitOnFailure(hr, "Failed to add ConstantData to CustomActionData for PerformanceCategory: %ls", pwzId); + ExitOnFailure(hr, "Failed to add ConstantData to CustomActionData for Wix4PerformanceCategory: %ls", pwzId); } if (hr == E_NOMOREITEMS) { hr = S_OK; } - ExitOnFailure(hr, "Failure while processing PerformanceCategory table."); + ExitOnFailure(hr, "Failure while processing Wix4PerformanceCategory table."); // If there was any data built up, schedule it for execution. if (pwzCustomActionData) { if (fInstall) { - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RollbackRegisterPerfCounterData"), pwzCustomActionData, COST_PERFMON_UNREGISTER); - ExitOnFailure(hr, "Failed to schedule RollbackRegisterPerfCounterData action for PerformanceCategory: %ls", pwzId); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RollbackRegisterPerfCounterData"), pwzCustomActionData, COST_PERFMON_UNREGISTER); + ExitOnFailure(hr, "Failed to schedule RollbackRegisterPerfCounterData action for Wix4PerformanceCategory: %ls", pwzId); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RegisterPerfCounterData"), pwzCustomActionData, COST_PERFMON_REGISTER); - ExitOnFailure(hr, "Failed to schedule RegisterPerfCounterData action for PerformanceCategory: %ls", pwzId); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RegisterPerfCounterData"), pwzCustomActionData, COST_PERFMON_REGISTER); + ExitOnFailure(hr, "Failed to schedule RegisterPerfCounterData action for Wix4PerformanceCategory: %ls", pwzId); } else { - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RollbackUnregisterPerfCounterData"), pwzCustomActionData, COST_PERFMON_REGISTER); - ExitOnFailure(hr, "Failed to schedule RollbackUnregisterPerfCounterData action for PerformanceCategory: %ls", pwzId); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RollbackUnregisterPerfCounterData"), pwzCustomActionData, COST_PERFMON_REGISTER); + ExitOnFailure(hr, "Failed to schedule RollbackUnregisterPerfCounterData action for Wix4PerformanceCategory: %ls", pwzId); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"UnregisterPerfCounterData"), pwzCustomActionData, COST_PERFMON_UNREGISTER); - ExitOnFailure(hr, "Failed to schedule UnregisterPerfCounterData action for PerformanceCategory: %ls", pwzId); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"UnregisterPerfCounterData"), pwzCustomActionData, COST_PERFMON_UNREGISTER); + ExitOnFailure(hr, "Failed to schedule UnregisterPerfCounterData action for Wix4PerformanceCategory: %ls", pwzId); } } diff --git a/src/ca/scaperfexec.cpp b/src/ca/scaperfexec.cpp index bf58c8d0..04c0648a 100644 --- a/src/ca/scaperfexec.cpp +++ b/src/ca/scaperfexec.cpp @@ -35,7 +35,7 @@ extern "C" UINT __stdcall RegisterPerfCounterData( ExitOnFailure(hr, "Failed to initialize RegisterPerfCounterData."); hr = ExecutePerfCounterData(hInstall, TRUE); - MessageExitOnFailure(hr, msierrInstallPerfCounterData, "Failed to execute PerformanceCategory table."); + MessageExitOnFailure(hr, msierrInstallPerfCounterData, "Failed to execute Wix4PerformanceCategory table."); LExit: er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; @@ -61,7 +61,7 @@ extern "C" UINT __stdcall UnregisterPerfCounterData( ExitOnFailure(hr, "Failed to initialize UnregisterPerfCounterData."); hr = ExecutePerfCounterData(hInstall, FALSE); - MessageExitOnFailure(hr, msierrUninstallPerfCounterData, "Failed to execute PerformanceCategory table."); + MessageExitOnFailure(hr, msierrUninstallPerfCounterData, "Failed to execute Wix4PerformanceCategory table."); LExit: er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; diff --git a/src/ca/scasched.cpp b/src/ca/scasched.cpp index ba230a9e..d81b1f14 100644 --- a/src/ca/scasched.cpp +++ b/src/ca/scasched.cpp @@ -21,14 +21,14 @@ extern "C" UINT __stdcall ConfigureSmbInstall( ExitOnFailure(hr, "Failed to initialize"); // check to see if necessary tables are specified - if (WcaTableExists(L"FileShare") != S_OK) + if (WcaTableExists(L"Wix4FileShare") != S_OK) { - WcaLog(LOGMSG_VERBOSE, "Skipping SMB CustomAction, no FileShare table"); + WcaLog(LOGMSG_VERBOSE, "Skipping SMB CustomAction, no Wix4FileShare table"); ExitFunction1(hr = S_FALSE); } hr = ScaSmbRead(&pssList); - ExitOnFailure(hr, "failed to read FileShare table"); + ExitOnFailure(hr, "failed to read Wix4FileShare table"); hr = ScaSmbInstall(pssList); ExitOnFailure(hr, "failed to install FileShares"); @@ -43,7 +43,7 @@ LExit: /******************************************************************** -ConfigureSmb - CUSTOM ACTION ENTRY POINT for installing fileshare settings +ConfigureSmb - CUSTOM ACTION ENTRY POINT for uninstalling fileshare settings ********************************************************************/ extern "C" UINT __stdcall ConfigureSmbUninstall( @@ -60,14 +60,14 @@ extern "C" UINT __stdcall ConfigureSmbUninstall( ExitOnFailure(hr, "Failed to initialize"); // check to see if necessary tables are specified - if (WcaTableExists(L"FileShare") != S_OK) + if (WcaTableExists(L"Wix4FileShare") != S_OK) { - WcaLog(LOGMSG_VERBOSE, "Skipping SMB CustomAction, no FileShare table"); + WcaLog(LOGMSG_VERBOSE, "Skipping SMB CustomAction, no Wix4FileShare table"); ExitFunction1(hr = S_FALSE); } hr = ScaSmbRead(&pssList); - ExitOnFailure(hr, "failed to read FileShare table"); + ExitOnFailure(hr, "failed to read Wix4FileShare table"); hr = ScaSmbUninstall(pssList); ExitOnFailure(hr, "failed to uninstall FileShares"); @@ -106,7 +106,7 @@ extern "C" UINT __stdcall ConfigureUsers( fInitializedCom = TRUE; hr = ScaUserRead(&psuList); - ExitOnFailure(hr, "failed to read User table"); + ExitOnFailure(hr, "failed to read Wix4User table"); hr = ScaUserExecute(psuList); ExitOnFailure(hr, "failed to add/remove User actions"); diff --git a/src/ca/scasmb.h b/src/ca/scasmb.h index 7dbeb14d..f2a4b53c 100644 --- a/src/ca/scasmb.h +++ b/src/ca/scasmb.h @@ -5,7 +5,7 @@ #include "scauser.h" // structs -// Structure used to hold and extra user/permission pairs from the FileSharePermissions Table +// Structure used to hold and extra user/permission pairs from the Wix4FileSharePermissions Table struct SCA_SMB_EX_USER_PERMS { int nPermissions; diff --git a/src/ca/scasmbsched.cpp b/src/ca/scasmbsched.cpp index 72536d6d..e29f7f51 100644 --- a/src/ca/scasmbsched.cpp +++ b/src/ca/scasmbsched.cpp @@ -92,8 +92,8 @@ void ScaExUserPermsSmbFreeList(SCA_SMB_EX_USER_PERMS* pExUserPermsList) } // sql query constants -LPCWSTR vcsSmbQuery = L"SELECT `FileShare`, `ShareName`, `Description`, `Directory_`, " - L"`Component_`, `User_`, `Permissions` FROM `FileShare`"; +LPCWSTR vcsSmbQuery = L"SELECT `Wix4FileShare`, `ShareName`, `Description`, `Directory_`, " + L"`Component_`, `User_`, `Permissions` FROM `Wix4FileShare`"; enum eSmbQuery { ssqFileShare = 1, @@ -122,26 +122,26 @@ HRESULT ScaSmbRead(SCA_SMB** ppssList) SCA_SMB* pss = NULL; BOOL bUserPermissionsTableExists = FALSE; - if (S_OK != WcaTableExists(L"FileShare")) + if (S_OK != WcaTableExists(L"Wix4FileShare")) { - WcaLog(LOGMSG_VERBOSE, "Skipping ScaSmbCreateShare() - FileShare table not present"); + WcaLog(LOGMSG_VERBOSE, "Skipping ScaSmbCreateShare() - Wix4FileShare table not present"); ExitFunction1(hr = S_FALSE); } - if (S_OK == WcaTableExists(L"FileSharePermissions")) + if (S_OK == WcaTableExists(L"Wix4FileSharePermissions")) { bUserPermissionsTableExists = TRUE; } else { - WcaLog(LOGMSG_VERBOSE, "No Additional Permissions - FileSharePermissions table not present"); + WcaLog(LOGMSG_VERBOSE, "No Additional Permissions - Wix4FileSharePermissions table not present"); } WcaLog(LOGMSG_VERBOSE, "Reading File Share Tables"); // loop through all the fileshares hr = WcaOpenExecuteView(vcsSmbQuery, &hView); - ExitOnFailure(hr, "Failed to open view on FileShare table"); + ExitOnFailure(hr, "Failed to open view on Wix4FileShare table"); while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) { pss = NewSmb(); @@ -154,33 +154,33 @@ HRESULT ScaSmbRead(SCA_SMB** ppssList) ::ZeroMemory(pss, sizeof(*pss)); hr = WcaGetRecordString(hRec, ssqFileShare, &pwzData); - ExitOnFailure(hr, "Failed to get FileShare.FileShare"); + ExitOnFailure(hr, "Failed to get Wix4FileShare.Wix4FileShare"); hr = ::StringCchCopyW(pss->wzId, countof(pss->wzId), pwzData); ExitOnFailure(hr, "Failed to copy ID string to smb object"); hr = WcaGetRecordFormattedString(hRec, ssqShareName, &pwzData); - ExitOnFailure(hr, "Failed to get FileShare.ShareName"); + ExitOnFailure(hr, "Failed to get Wix4FileShare.ShareName"); hr = ::StringCchCopyW(pss->wzShareName, countof(pss->wzShareName), pwzData); ExitOnFailure(hr, "Failed to copy share name string to smb object"); hr = WcaGetRecordString(hRec, ssqComponent, &pwzData); - ExitOnFailure(hr, "Failed to get Component for FileShare: '%ls'", pss->wzShareName); + ExitOnFailure(hr, "Failed to get Component for Wix4FileShare: '%ls'", pss->wzShareName); hr = ::StringCchCopyW(pss->wzComponent, countof(pss->wzComponent), pwzData); ExitOnFailure(hr, "Failed to copy component string to smb object"); hr = WcaGetRecordFormattedString(hRec, ssqDescription, &pwzData); - ExitOnFailure(hr, "Failed to get Share Description for FileShare: '%ls'", pss->wzShareName); + ExitOnFailure(hr, "Failed to get Share Description for Wix4FileShare: '%ls'", pss->wzShareName); hr = ::StringCchCopyW(pss->wzDescription, countof(pss->wzDescription), pwzData); ExitOnFailure(hr, "Failed to copy description string to smb object"); // get user info from the user table hr = WcaGetRecordFormattedString(hRec, ssqUser, &pwzData); - ExitOnFailure(hr, "Failed to get User record for FileShare: '%ls'", pss->wzShareName); + ExitOnFailure(hr, "Failed to get Wix4User record for Wix4FileShare: '%ls'", pss->wzShareName); // get component install state er = ::MsiGetComponentStateW(WcaGetInstallHandle(), pss->wzComponent, &pss->isInstalled, &pss->isAction); hr = HRESULT_FROM_WIN32(er); - ExitOnFailure(hr, "Failed to get Component state for FileShare"); + ExitOnFailure(hr, "Failed to get Component state for Wix4FileShare"); // if a user was specified if (*pwzData) @@ -200,7 +200,7 @@ HRESULT ScaSmbRead(SCA_SMB** ppssList) // get the share's directory hr = WcaGetRecordString(hRec, ssqDirectory, &pwzData); - ExitOnFailure(hr, "Failed to get directory for FileShare: '%ls'", pss->wzShareName); + ExitOnFailure(hr, "Failed to get directory for Wix4FileShare: '%ls'", pss->wzShareName); WCHAR wzPath[MAX_PATH]; DWORD dwLen; @@ -236,7 +236,7 @@ HRESULT ScaSmbRead(SCA_SMB** ppssList) ExitOnFailure(hr, "Failed to copy directory string to smb object"); hr = WcaGetRecordInteger(hRec, ssqPermissions, &pss->nPermissions); - ExitOnFailure(hr, "Failed to get FileShare.Permissions"); + ExitOnFailure(hr, "Failed to get Wix4FileShare.Permissions"); // Check to see if additional user & permissions are specified for this share if (bUserPermissionsTableExists) @@ -253,7 +253,7 @@ HRESULT ScaSmbRead(SCA_SMB** ppssList) { hr = S_OK; } - ExitOnFailure(hr, "Failure occured while processing FileShare table"); + ExitOnFailure(hr, "Failure occured while processing Wix4FileShare table"); LExit: // if anything was left over after an error clean it all up @@ -420,10 +420,10 @@ HRESULT SchedCreateSmb(SCA_SMB* pss) } // Schedule the rollback first - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"CreateSmbRollback"), pwzRollbackCustomActionData, COST_SMB_DROPSMB); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"CreateSmbRollback"), pwzRollbackCustomActionData, COST_SMB_DROPSMB); ExitOnFailure(hr, "Failed to schedule DropSmb action"); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"CreateSmb"), pwzCustomActionData, COST_SMB_CREATESMB); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"CreateSmb"), pwzCustomActionData, COST_SMB_CREATESMB); ExitOnFailure(hr, "Failed to schedule CreateSmb action"); LExit: @@ -511,14 +511,14 @@ HRESULT SchedDropSmb(SCA_SMB* pss) ExitOnFailure(hr, "Failed to add permissions to CustomActionData"); } - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"DropSmbRollback"), pwzRollbackCustomActionData, COST_SMB_CREATESMB); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"DropSmbRollback"), pwzRollbackCustomActionData, COST_SMB_CREATESMB); ExitOnFailure(hr, "Failed to schedule DropSmbRollback action"); // DropSMB hr = WcaWriteStringToCaData(pss->wzShareName, &pwzCustomActionData); ExitOnFailure(hr, "failed to add ShareName to CustomActionData"); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"DropSmb"), pwzCustomActionData, COST_SMB_DROPSMB); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"DropSmb"), pwzCustomActionData, COST_SMB_DROPSMB); ExitOnFailure(hr, "Failed to schedule DropSmb action"); LExit: @@ -558,7 +558,7 @@ LExit: } LPCWSTR vcsSmbExUserPermsQuery = L"SELECT `FileShare_`,`User_`,`Permissions` " - L"FROM `FileSharePermissions` WHERE `FileShare_`=?"; + L"FROM `Wix4FileSharePermissions` WHERE `FileShare_`=?"; enum eSmbUserPermsQuery { ssupqFileShare = 1, @@ -588,9 +588,9 @@ HRESULT ScaSmbExPermsRead(SCA_SMB* pss) ExitOnFailure(hr, "Failed to look up FileShare"); hr = WcaOpenView(vcsSmbExUserPermsQuery, &hView); - ExitOnFailure(hr, "Failed to open view on FileSharePermissions table"); + ExitOnFailure(hr, "Failed to open view on Wix4FileSharePermissions table"); hr = WcaExecuteView(hView, hRec); - ExitOnFailure(hr, "Failed to execute view on FileSharePermissions table"); + ExitOnFailure(hr, "Failed to execute view on Wix4FileSharePermissions table"); // loop through all User/Permissions paris returned while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) @@ -605,12 +605,12 @@ HRESULT ScaSmbExPermsRead(SCA_SMB* pss) ::ZeroMemory(pExUserPerms, sizeof(*pExUserPerms)); hr = WcaGetRecordString(hRec, ssupqUser, &pwzData); - ExitOnFailure(hr, "Failed to get FileSharePermissions.User"); + ExitOnFailure(hr, "Failed to get Wix4FileSharePermissions.User"); hr = ScaGetUser(pwzData, &pExUserPerms->scau); ExitOnFailure(hr, "Failed to get user information for fileshare: '%ls'", pss->wzShareName); hr = WcaGetRecordInteger(hRec, ssupqPermissions, &pExUserPerms->nPermissions); - ExitOnFailure(hr, "Failed to get FileSharePermissions.Permissions"); + ExitOnFailure(hr, "Failed to get Wix4FileSharePermissions.Permissions"); pExUserPerms->accessMode = SET_ACCESS; // we only support SET_ACCESS here pExUserPermsList = AddExUserPermsSmbToList(pExUserPermsList, pExUserPerms); 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 @@ #include "precomp.h" -LPCWSTR vcsUserQuery = L"SELECT `User`, `Component_`, `Name`, `Domain`, `Password` FROM `User` WHERE `User`=?"; +LPCWSTR vcsUserQuery = L"SELECT `Wix4User`, `Component_`, `Name`, `Domain`, `Password` FROM `Wix4User` WHERE `Wix4User`=?"; enum eUserQuery { vuqUser = 1, vuqComponent, vuqName, vuqDomain, vuqPassword }; -LPCWSTR vcsGroupQuery = L"SELECT `Group`, `Component_`, `Name`, `Domain` FROM `Group` WHERE `Group`=?"; +LPCWSTR vcsGroupQuery = L"SELECT `Wix4Group`, `Component_`, `Name`, `Domain` FROM `Wix4Group` WHERE `Wix4Group`=?"; enum eGroupQuery { vgqGroup = 1, vgqComponent, vgqName, vgqDomain }; -LPCWSTR vcsUserGroupQuery = L"SELECT `User_`, `Group_` FROM `UserGroup` WHERE `User_`=?"; +LPCWSTR vcsUserGroupQuery = L"SELECT `Wix4User_`, `Wix4Group_` FROM `Wix4UserGroup` WHERE `Wix4User_`=?"; enum eUserGroupQuery { vugqUser = 1, vugqGroup }; -LPCWSTR vActionableQuery = L"SELECT `User`,`Component_`,`Name`,`Domain`,`Password`,`Attributes` FROM `User` WHERE `Component_` IS NOT NULL"; +LPCWSTR vActionableQuery = L"SELECT `Wix4User`,`Component_`,`Name`,`Domain`,`Password`,`Attributes` FROM `Wix4User` WHERE `Component_` IS NOT NULL"; enum eActionableQuery { vaqUser = 1, vaqComponent, vaqName, vaqDomain, vaqPassword, vaqAttributes }; @@ -51,46 +51,46 @@ HRESULT __stdcall ScaGetUser( ExitOnFailure(hr, "Failed to look up User"); hr = WcaOpenView(vcsUserQuery, &hView); - ExitOnFailure(hr, "Failed to open view on User table"); + ExitOnFailure(hr, "Failed to open view on Wix4User table"); hr = WcaExecuteView(hView, hRec); - ExitOnFailure(hr, "Failed to execute view on User table"); + ExitOnFailure(hr, "Failed to execute view on Wix4User table"); hr = WcaFetchSingleRecord(hView, &hRec); if (S_OK == hr) { hr = WcaGetRecordString(hRec, vuqUser, &pwzData); - ExitOnFailure(hr, "Failed to get User.User"); + ExitOnFailure(hr, "Failed to get Wix4User.User"); hr = ::StringCchCopyW(pscau->wzKey, countof(pscau->wzKey), pwzData); ExitOnFailure(hr, "Failed to copy key string to user object"); hr = WcaGetRecordString(hRec, vuqComponent, &pwzData); - ExitOnFailure(hr, "Failed to get User.Component_"); + ExitOnFailure(hr, "Failed to get Wix4User.Component_"); hr = ::StringCchCopyW(pscau->wzComponent, countof(pscau->wzComponent), pwzData); ExitOnFailure(hr, "Failed to copy component string to user object"); hr = WcaGetRecordFormattedString(hRec, vuqName, &pwzData); - ExitOnFailure(hr, "Failed to get User.Name"); + ExitOnFailure(hr, "Failed to get Wix4User.Name"); hr = ::StringCchCopyW(pscau->wzName, countof(pscau->wzName), pwzData); ExitOnFailure(hr, "Failed to copy name string to user object"); hr = WcaGetRecordFormattedString(hRec, vuqDomain, &pwzData); - ExitOnFailure(hr, "Failed to get User.Domain"); + ExitOnFailure(hr, "Failed to get Wix4User.Domain"); hr = ::StringCchCopyW(pscau->wzDomain, countof(pscau->wzDomain), pwzData); ExitOnFailure(hr, "Failed to copy domain string to user object"); hr = WcaGetRecordFormattedString(hRec, vuqPassword, &pwzData); - ExitOnFailure(hr, "Failed to get User.Password"); + ExitOnFailure(hr, "Failed to get Wix4User.Password"); hr = ::StringCchCopyW(pscau->wzPassword, countof(pscau->wzPassword), pwzData); ExitOnFailure(hr, "Failed to copy password string to user object"); } else if (E_NOMOREITEMS == hr) { - WcaLog(LOGMSG_STANDARD, "Error: Cannot locate User.User='%ls'", wzUser); + WcaLog(LOGMSG_STANDARD, "Error: Cannot locate Wix4User.User='%ls'", wzUser); hr = E_FAIL; } else { - ExitOnFailure(hr, "Error or found multiple matching User rows"); + ExitOnFailure(hr, "Error or found multiple matching Wix4User rows"); } LExit: @@ -131,42 +131,42 @@ HRESULT __stdcall ScaGetUserDeferred( hr = WcaFetchWrappedRecordWhereString(hUserQuery, vuqUser, wzUser, &hRecTest); if (S_OK == hr) { - AssertSz(FALSE, "Found multiple matching User rows"); + AssertSz(FALSE, "Found multiple matching Wix4User rows"); } hr = WcaGetRecordString(hRec, vuqUser, &pwzData); - ExitOnFailure(hr, "Failed to get User.User"); + ExitOnFailure(hr, "Failed to get Wix4User.User"); hr = ::StringCchCopyW(pscau->wzKey, countof(pscau->wzKey), pwzData); ExitOnFailure(hr, "Failed to copy key string to user object (in deferred CA)"); hr = WcaGetRecordString(hRec, vuqComponent, &pwzData); - ExitOnFailure(hr, "Failed to get User.Component_"); + ExitOnFailure(hr, "Failed to get Wix4User.Component_"); hr = ::StringCchCopyW(pscau->wzComponent, countof(pscau->wzComponent), pwzData); ExitOnFailure(hr, "Failed to copy component string to user object (in deferred CA)"); hr = WcaGetRecordString(hRec, vuqName, &pwzData); - ExitOnFailure(hr, "Failed to get User.Name"); + ExitOnFailure(hr, "Failed to get Wix4User.Name"); hr = ::StringCchCopyW(pscau->wzName, countof(pscau->wzName), pwzData); ExitOnFailure(hr, "Failed to copy name string to user object (in deferred CA)"); hr = WcaGetRecordString(hRec, vuqDomain, &pwzData); - ExitOnFailure(hr, "Failed to get User.Domain"); + ExitOnFailure(hr, "Failed to get Wix4User.Domain"); hr = ::StringCchCopyW(pscau->wzDomain, countof(pscau->wzDomain), pwzData); ExitOnFailure(hr, "Failed to copy domain string to user object (in deferred CA)"); hr = WcaGetRecordString(hRec, vuqPassword, &pwzData); - ExitOnFailure(hr, "Failed to get User.Password"); + ExitOnFailure(hr, "Failed to get Wix4User.Password"); hr = ::StringCchCopyW(pscau->wzPassword, countof(pscau->wzPassword), pwzData); ExitOnFailure(hr, "Failed to copy password string to user object (in deferred CA)"); } else if (E_NOMOREITEMS == hr) { - WcaLog(LOGMSG_STANDARD, "Error: Cannot locate User.User='%ls'", wzUser); + WcaLog(LOGMSG_STANDARD, "Error: Cannot locate Wix4User.User='%ls'", wzUser); hr = E_FAIL; } else { - ExitOnFailure(hr, "Error fetching single User row"); + ExitOnFailure(hr, "Error fetching single Wix4User row"); } LExit: @@ -196,41 +196,41 @@ HRESULT __stdcall ScaGetGroup( ExitOnFailure(hr, "Failed to look up Group"); hr = WcaOpenView(vcsGroupQuery, &hView); - ExitOnFailure(hr, "Failed to open view on Group table"); + ExitOnFailure(hr, "Failed to open view on Wix4Group table"); hr = WcaExecuteView(hView, hRec); - ExitOnFailure(hr, "Failed to execute view on Group table"); + ExitOnFailure(hr, "Failed to execute view on Wix4Group table"); hr = WcaFetchSingleRecord(hView, &hRec); if (S_OK == hr) { hr = WcaGetRecordString(hRec, vgqGroup, &pwzData); - ExitOnFailure(hr, "Failed to get Group.Group"); + ExitOnFailure(hr, "Failed to get Wix4Group.Wix4Group."); hr = ::StringCchCopyW(pscag->wzKey, countof(pscag->wzKey), pwzData); - ExitOnFailure(hr, "Failed to copy Group.Group."); + ExitOnFailure(hr, "Failed to copy Wix4Group.Wix4Group."); hr = WcaGetRecordString(hRec, vgqComponent, &pwzData); - ExitOnFailure(hr, "Failed to get Group.Component_"); + ExitOnFailure(hr, "Failed to get Wix4Group.Component_"); hr = ::StringCchCopyW(pscag->wzComponent, countof(pscag->wzComponent), pwzData); - ExitOnFailure(hr, "Failed to copy Group.Component_."); + ExitOnFailure(hr, "Failed to copy Wix4Group.Component_."); hr = WcaGetRecordFormattedString(hRec, vgqName, &pwzData); - ExitOnFailure(hr, "Failed to get Group.Name"); + ExitOnFailure(hr, "Failed to get Wix4Group.Name"); hr = ::StringCchCopyW(pscag->wzName, countof(pscag->wzName), pwzData); - ExitOnFailure(hr, "Failed to copy Group.Name."); + ExitOnFailure(hr, "Failed to copy Wix4Group.Name."); hr = WcaGetRecordFormattedString(hRec, vgqDomain, &pwzData); - ExitOnFailure(hr, "Failed to get Group.Domain"); + ExitOnFailure(hr, "Failed to get Wix4Group.Domain"); hr = ::StringCchCopyW(pscag->wzDomain, countof(pscag->wzDomain), pwzData); - ExitOnFailure(hr, "Failed to copy Group.Domain."); + ExitOnFailure(hr, "Failed to copy Wix4Group.Domain."); } else if (E_NOMOREITEMS == hr) { - WcaLog(LOGMSG_STANDARD, "Error: Cannot locate Group.Group='%ls'", wzGroup); + WcaLog(LOGMSG_STANDARD, "Error: Cannot locate Wix4Group.Wix4Group='%ls'", wzGroup); hr = E_FAIL; } else { - ExitOnFailure(hr, "Error or found multiple matching Group rows"); + ExitOnFailure(hr, "Error or found multiple matching Wix4Group rows"); } LExit: @@ -284,19 +284,19 @@ HRESULT ScaUserRead( LPWSTR pwzData = NULL; - BOOL fUserGroupExists = FALSE; + BOOL fUserGroupExists = FALSE; SCA_USER *psu = NULL; INSTALLSTATE isInstalled, isAction; - if (S_OK != WcaTableExists(L"User")) + if (S_OK != WcaTableExists(L"Wix4User")) { - WcaLog(LOGMSG_VERBOSE, "User Table does not exist, exiting"); + WcaLog(LOGMSG_VERBOSE, "Wix4User Table does not exist, exiting"); ExitFunction1(hr = S_FALSE); } - if (S_OK == WcaTableExists(L"UserGroup")) + if (S_OK == WcaTableExists(L"Wix4UserGroup")) { fUserGroupExists = TRUE; } @@ -305,15 +305,15 @@ HRESULT ScaUserRead( // loop through all the users // hr = WcaOpenExecuteView(vActionableQuery, &hView); - ExitOnFailure(hr, "failed to open view on User table"); + ExitOnFailure(hr, "failed to open view on Wix4User table"); while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) { hr = WcaGetRecordString(hRec, vaqComponent, &pwzData); - ExitOnFailure(hr, "failed to get User.Component"); + ExitOnFailure(hr, "failed to get Wix4User.Component"); er = ::MsiGetComponentStateW(WcaGetInstallHandle(), pwzData, &isInstalled, &isAction); hr = HRESULT_FROM_WIN32(er); - ExitOnFailure(hr, "failed to get Component state for User"); + ExitOnFailure(hr, "failed to get Component state for Wix4User"); // don't bother if we aren't installing or uninstalling this component if (WcaIsInstalling(isInstalled, isAction) || WcaIsUninstalling(isInstalled, isAction)) @@ -332,44 +332,44 @@ HRESULT ScaUserRead( ExitOnFailure(hr, "failed to copy component name: %ls", pwzData); hr = WcaGetRecordString(hRec, vaqUser, &pwzData); - ExitOnFailure(hr, "failed to get User.User"); + ExitOnFailure(hr, "failed to get Wix4User.User"); hr = ::StringCchCopyW(psu->wzKey, countof(psu->wzKey), pwzData); ExitOnFailure(hr, "failed to copy user key: %ls", pwzData); hr = WcaGetRecordFormattedString(hRec, vaqName, &pwzData); - ExitOnFailure(hr, "failed to get User.Name"); + ExitOnFailure(hr, "failed to get Wix4User.Name"); hr = ::StringCchCopyW(psu->wzName, countof(psu->wzName), pwzData); ExitOnFailure(hr, "failed to copy user name: %ls", pwzData); hr = WcaGetRecordFormattedString(hRec, vaqDomain, &pwzData); - ExitOnFailure(hr, "failed to get User.Domain"); + ExitOnFailure(hr, "failed to get Wix4User.Domain"); hr = ::StringCchCopyW(psu->wzDomain, countof(psu->wzDomain), pwzData); ExitOnFailure(hr, "failed to copy user domain: %ls", pwzData); hr = WcaGetRecordFormattedString(hRec, vaqPassword, &pwzData); - ExitOnFailure(hr, "failed to get User.Password"); + ExitOnFailure(hr, "failed to get Wix4User.Password"); hr = ::StringCchCopyW(psu->wzPassword, countof(psu->wzPassword), pwzData); ExitOnFailure(hr, "failed to copy user password"); hr = WcaGetRecordInteger(hRec, vaqAttributes, &psu->iAttributes); - ExitOnFailure(hr, "failed to get User.Attributes"); + ExitOnFailure(hr, "failed to get Wix4User.Attributes"); // Check if this user is to be added to any groups if (fUserGroupExists) { hUserRec = ::MsiCreateRecord(1); hr = WcaSetRecordString(hUserRec, 1, psu->wzKey); - ExitOnFailure(hr, "Failed to create user record for querying UserGroup table"); + ExitOnFailure(hr, "Failed to create user record for querying Wix4UserGroup table"); hr = WcaOpenView(vcsUserGroupQuery, &hUserGroupView); - ExitOnFailure(hr, "Failed to open view on UserGroup table for user %ls", psu->wzKey); + ExitOnFailure(hr, "Failed to open view on Wix4UserGroup table for user %ls", psu->wzKey); hr = WcaExecuteView(hUserGroupView, hUserRec); - ExitOnFailure(hr, "Failed to execute view on UserGroup table for user: %ls", psu->wzKey); + ExitOnFailure(hr, "Failed to execute view on Wix4UserGroup table for user: %ls", psu->wzKey); while (S_OK == (hr = WcaFetchRecord(hUserGroupView, &hRec))) { hr = WcaGetRecordString(hRec, vugqGroup, &pwzData); - ExitOnFailure(hr, "failed to get UserGroup.Group"); + ExitOnFailure(hr, "failed to get Wix4UserGroup.Group"); hr = AddGroupToList(&(psu->psgGroups)); ExitOnFailure(hr, "failed to add group to list"); @@ -382,7 +382,7 @@ HRESULT ScaUserRead( { hr = S_OK; } - ExitOnFailure(hr, "failed to enumerate selected rows from UserGroup table"); + ExitOnFailure(hr, "failed to enumerate selected rows from Wix4UserGroup table"); } } } @@ -391,7 +391,7 @@ HRESULT ScaUserRead( { hr = S_OK; } - ExitOnFailure(hr, "failed to enumerate selected rows from User table"); + ExitOnFailure(hr, "failed to enumerate selected rows from Wix4User table"); LExit: ReleaseStr(pwzData); @@ -581,7 +581,7 @@ HRESULT ScaUserExecute( ExitOnFailure(hr, "failed to add group information to rollback custom action data"); } - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"CreateUserRollback"), pwzRollbackData, COST_USER_DELETE); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"CreateUserRollback"), pwzRollbackData, COST_USER_DELETE); ExitOnFailure(hr, "failed to schedule CreateUserRollback"); } @@ -595,7 +595,7 @@ HRESULT ScaUserExecute( hr = WriteGroupInfo(psu->psgGroups, &pwzActionData); ExitOnFailure(hr, "failed to add group information to custom action data"); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"CreateUser"), pwzActionData, COST_USER_ADD); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"CreateUser"), pwzActionData, COST_USER_ADD); ExitOnFailure(hr, "failed to schedule CreateUser"); } 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( // // Note: We can't rollback the removal of a user which is why RemoveUser is a commit // CustomAction. - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RemoveUser"), pwzActionData, COST_USER_DELETE); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RemoveUser"), pwzActionData, COST_USER_DELETE); ExitOnFailure(hr, "failed to schedule RemoveUser"); } diff --git a/src/ca/secureobj.cpp b/src/ca/secureobj.cpp index f6d1406a..392945d9 100644 --- a/src/ca/secureobj.cpp +++ b/src/ca/secureobj.cpp @@ -3,9 +3,9 @@ #include "precomp.h" // structs -LPCWSTR wzQUERY_SECUREOBJECTS = L"SELECT `SecureObjects`.`SecureObject`, `SecureObjects`.`Table`, `SecureObjects`.`Domain`, `SecureObjects`.`User`, " - L"`SecureObjects`.`Permission`, `SecureObjects`.`Component_`, `Component`.`Attributes` FROM `SecureObjects`,`Component` WHERE " - L"`SecureObjects`.`Component_`=`Component`.`Component`"; +LPCWSTR wzQUERY_SECUREOBJECTS = L"SELECT `Wix4SecureObject`.`Wix4SecureObject`, `Wix4SecureObject`.`Table`, `Wix4SecureObject`.`Domain`, `Wix4SecureObject`.`User`, " + L"`Wix4SecureObject`.`Permission`, `Wix4SecureObject`.`Component_`, `Component`.`Attributes` FROM `Wix4SecureObject`,`Component` WHERE " + L"`Wix4SecureObject`.`Component_`=`Component`.`Component`"; enum eQUERY_SECUREOBJECTS { QSO_SECUREOBJECT = 1, QSO_TABLE, QSO_DOMAIN, QSO_USER, QSO_PERMISSION, QSO_COMPONENT, QSO_COMPATTRIBUTES }; LPCWSTR wzQUERY_REGISTRY = L"SELECT `Registry`.`Registry`, `Registry`.`Root`, `Registry`.`Key` FROM `Registry` WHERE `Registry`.`Registry`=?"; @@ -142,7 +142,7 @@ static HRESULT StoreACLRollbackInfo( ExitOnFailure(hr, "failed to add data to rollback CustomActionData"); } - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"ExecSecureObjectsRollback"), pwzCustomActionData, COST_SECUREOBJECT); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"ExecSecureObjectsRollback"), pwzCustomActionData, COST_SECUREOBJECT); ExitOnFailure(hr, "failed to schedule ExecSecureObjectsRollback for item: %ls of type: %ls", pwzObject, pwzTable); ReleaseStr(pwzCustomActionData); @@ -343,9 +343,9 @@ extern "C" UINT __stdcall SchedSecureObjects( ExitOnFailure(hr, "failed to initialize"); // anything to do? - if (S_OK != WcaTableExists(L"SecureObjects")) + if (S_OK != WcaTableExists(L"Wix4SecureObject")) { - WcaLog(LOGMSG_STANDARD, "SecureObjects table doesn't exist, so there are no objects to secure."); + WcaLog(LOGMSG_STANDARD, "Wix4SecureObject table doesn't exist, so there are no objects to secure."); ExitFunction(); } @@ -353,7 +353,7 @@ extern "C" UINT __stdcall SchedSecureObjects( // loop through all the objects to be secured // hr = WcaOpenExecuteView(wzQUERY_SECUREOBJECTS, &hView); - ExitOnFailure(hr, "failed to open view on SecureObjects table"); + ExitOnFailure(hr, "failed to open view on Wix4SecureObject table"); while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) { hr = WcaGetRecordString(hRec, QSO_TABLE, &pwzTable); @@ -372,7 +372,7 @@ extern "C" UINT __stdcall SchedSecureObjects( BOOL fIs64Bit = iCompAttributes & msidbComponentAttributes64bit; - // Only process entries in the SecureObjects table whose components match the bitness of this CA + // Only process entries in the Wix4SecureObject table whose components match the bitness of this CA #ifdef _WIN64 if (!fIs64Bit) { @@ -444,7 +444,7 @@ extern "C" UINT __stdcall SchedSecureObjects( { Assert(0 < cObjects); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"ExecSecureObjects"), pwzCustomActionData, cObjects * COST_SECUREOBJECT); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"ExecSecureObjects"), pwzCustomActionData, cObjects * COST_SECUREOBJECT); ExitOnFailure(hr, "failed to schedule ExecSecureObjects action"); } @@ -497,7 +497,7 @@ extern "C" UINT __stdcall SchedSecureObjectsRollback( // loop through all the objects to be secured // hr = WcaOpenExecuteView(wzQUERY_SECUREOBJECTS, &hView); - ExitOnFailure(hr, "failed to open view on SecureObjects table"); + ExitOnFailure(hr, "failed to open view on Wix4SecureObject table"); while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) { hr = WcaGetRecordString(hRec, QSO_TABLE, &pwzTable); @@ -516,7 +516,7 @@ extern "C" UINT __stdcall SchedSecureObjectsRollback( BOOL fIs64Bit = iCompAttributes & msidbComponentAttributes64bit; - // Only process entries in the SecureObjects table whose components match the bitness of this CA + // Only process entries in the Wix4SecureObject table whose components match the bitness of this CA #ifdef _WIN64 if (!fIs64Bit) { diff --git a/src/ca/serviceconfig.cpp b/src/ca/serviceconfig.cpp index c2b77035..04b25ffa 100644 --- a/src/ca/serviceconfig.cpp +++ b/src/ca/serviceconfig.cpp @@ -3,7 +3,7 @@ #include "precomp.h" // structs -LPCWSTR wzQUERY_SERVICECONFIG = L"SELECT `ServiceName`, `Component_`, `NewService`, `FirstFailureActionType`, `SecondFailureActionType`, `ThirdFailureActionType`, `ResetPeriodInDays`, `RestartServiceDelayInSeconds`, `ProgramCommandLine`, `RebootMessage` FROM `ServiceConfig`"; +LPCWSTR wzQUERY_SERVICECONFIG = L"SELECT `ServiceName`, `Component_`, `NewService`, `FirstFailureActionType`, `SecondFailureActionType`, `ThirdFailureActionType`, `ResetPeriodInDays`, `RestartServiceDelayInSeconds`, `ProgramCommandLine`, `RebootMessage` FROM `Wix4ServiceConfig`"; enum eQUERY_SERVICECONFIG { QSC_SERVICENAME = 1, QSC_COMPONENT, QSC_NEWSERVICE, QSC_FIRSTFAILUREACTIONTYPE, QSC_SECONDFAILUREACTIONTYPE, QSC_THIRDFAILUREACTIONTYPE, QSC_RESETPERIODINDAYS, QSC_RESTARTSERVICEDELAYINSECONDS, QSC_PROGRAMCOMMANDLINE, QSC_REBOOTMESSAGE }; // consts @@ -81,7 +81,7 @@ extern "C" UINT __stdcall SchedServiceConfig( // Loop through all the services to be configured. hr = WcaOpenExecuteView(wzQUERY_SERVICECONFIG, &hView); - ExitOnFailure(hr, "Failed to open view on ServiceConfig table."); + ExitOnFailure(hr, "Failed to open view on Wix4ServiceConfig table."); while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) { @@ -106,7 +106,7 @@ extern "C" UINT __stdcall SchedServiceConfig( ExitOnFailure(hr, "Failed to add name to CustomActionData."); hr = WcaGetRecordInteger(hRec, QSC_NEWSERVICE, &iData); - ExitOnFailure(hr, "Failed to get ServiceConfig.NewService."); + ExitOnFailure(hr, "Failed to get Wix4ServiceConfig.NewService."); hr = WcaWriteIntegerToCaData(0 != iData, &pwzCustomActionData); ExitOnFailure(hr, "Failed to add NewService data to CustomActionData"); @@ -167,10 +167,10 @@ extern "C" UINT __stdcall SchedServiceConfig( // setup CustomActionData and add to progress bar for download if (0 < cServices) { - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"RollbackServiceConfig"), pwzScriptKey, cServices * COST_SERVICECONFIG); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"RollbackServiceConfig"), pwzScriptKey, cServices * COST_SERVICECONFIG); ExitOnFailure(hr, "failed to schedule RollbackServiceConfig action"); - hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"ExecServiceConfig"), pwzCustomActionData, cServices * COST_SERVICECONFIG); + hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"ExecServiceConfig"), pwzCustomActionData, cServices * COST_SERVICECONFIG); ExitOnFailure(hr, "failed to schedule ExecServiceConfig action"); } diff --git a/src/ca/utilca.vcxproj b/src/ca/utilca.vcxproj index 2ec0c706..45a7f278 100644 --- a/src/ca/utilca.vcxproj +++ b/src/ca/utilca.vcxproj @@ -66,7 +66,7 @@ - + -- cgit v1.2.3-55-g6feb