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 +- .../TestData/CloseApplication/Package.en-us.wxl | 11 + .../TestData/CloseApplication/Package.wxs | 24 + .../CloseApplication/PackageComponents.wxs | 11 + .../TestData/CloseApplication/example.txt | 1 + .../TestData/EventManifest/Package.en-us.wxl | 11 + .../TestData/EventManifest/Package.wxs | 22 + .../TestData/EventManifest/PackageComponents.wxs | 13 + .../TestData/EventManifest/example.txt | 1 + .../TestData/InternetShortcut/Package.en-us.wxl | 11 + .../TestData/InternetShortcut/Package.wxs | 22 + .../InternetShortcut/PackageComponents.wxs | 12 + .../TestData/InternetShortcut/example.txt | 1 + .../TestData/PermissionEx/Package.en-us.wxl | 11 + .../TestData/PermissionEx/Package.wxs | 22 + .../TestData/PermissionEx/PackageComponents.wxs | 14 + .../TestData/PermissionEx/example.txt | 1 + .../WixToolsetTest.Util/UtilExtensionFixture.cs | 127 ++++- .../WixToolsetTest.Util/WixToolsetTest.Util.csproj | 16 + src/wixext/Tuples/EventManifestTuple.cs | 10 +- src/wixext/Tuples/FileSharePermissionsTuple.cs | 20 +- src/wixext/Tuples/FileShareTuple.cs | 44 +- src/wixext/Tuples/GroupTuple.cs | 10 +- src/wixext/Tuples/PerfmonManifestTuple.cs | 10 +- src/wixext/Tuples/PerfmonTuple.cs | 10 +- src/wixext/Tuples/PerformanceCategoryTuple.cs | 18 +- src/wixext/Tuples/SecureObjectsTuple.cs | 18 +- src/wixext/Tuples/ServiceConfigTuple.cs | 10 +- src/wixext/Tuples/UserGroupTuple.cs | 20 +- src/wixext/Tuples/UserTuple.cs | 18 +- src/wixext/Tuples/WixCloseApplicationTuple.cs | 8 - src/wixext/Tuples/WixFormatFilesTuple.cs | 20 +- src/wixext/Tuples/WixInternetShortcutTuple.cs | 28 +- src/wixext/Tuples/WixRemoveFolderExTuple.cs | 18 +- src/wixext/Tuples/WixRestartResourceTuple.cs | 18 +- src/wixext/Tuples/WixTouchFileTuple.cs | 18 +- src/wixext/Tuples/XmlConfigTuple.cs | 18 +- src/wixext/Tuples/XmlFileTuple.cs | 18 +- src/wixext/UtilCompiler.cs | 599 +++++++++------------ src/wixext/UtilWindowsInstallerBackendExtension.cs | 7 + src/wixext/WixToolset.Util.wixext.csproj | 1 + src/wixext/tables.xml | 86 ++- src/wixlib/UtilExtension.wxs | 181 +++---- src/wixlib/UtilExtension_Platform.wxi | 179 +++--- src/wixlib/caDecor.wxi | 40 ++ src/wixlib/caSuffix.wxi | 28 - src/wixlib/util.wixproj | 2 +- 67 files changed, 1240 insertions(+), 1108 deletions(-) create mode 100644 src/ca/caDecor.h delete mode 100644 src/ca/caSuffix.h create mode 100644 src/test/WixToolsetTest.Util/TestData/CloseApplication/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.Util/TestData/CloseApplication/Package.wxs create mode 100644 src/test/WixToolsetTest.Util/TestData/CloseApplication/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.Util/TestData/CloseApplication/example.txt create mode 100644 src/test/WixToolsetTest.Util/TestData/EventManifest/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.Util/TestData/EventManifest/Package.wxs create mode 100644 src/test/WixToolsetTest.Util/TestData/EventManifest/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.Util/TestData/EventManifest/example.txt create mode 100644 src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.wxs create mode 100644 src/test/WixToolsetTest.Util/TestData/InternetShortcut/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.Util/TestData/InternetShortcut/example.txt create mode 100644 src/test/WixToolsetTest.Util/TestData/PermissionEx/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.Util/TestData/PermissionEx/Package.wxs create mode 100644 src/test/WixToolsetTest.Util/TestData/PermissionEx/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.Util/TestData/PermissionEx/example.txt create mode 100644 src/wixlib/caDecor.wxi delete mode 100644 src/wixlib/caSuffix.wxi 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 @@ - + diff --git a/src/test/WixToolsetTest.Util/TestData/CloseApplication/Package.en-us.wxl b/src/test/WixToolsetTest.Util/TestData/CloseApplication/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/CloseApplication/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.Util/TestData/CloseApplication/Package.wxs b/src/test/WixToolsetTest.Util/TestData/CloseApplication/Package.wxs new file mode 100644 index 00000000..688ce39d --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/CloseApplication/Package.wxs @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Util/TestData/CloseApplication/PackageComponents.wxs b/src/test/WixToolsetTest.Util/TestData/CloseApplication/PackageComponents.wxs new file mode 100644 index 00000000..4f9e6a9d --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/CloseApplication/PackageComponents.wxs @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Util/TestData/CloseApplication/example.txt b/src/test/WixToolsetTest.Util/TestData/CloseApplication/example.txt new file mode 100644 index 00000000..1b4ffe8a --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/CloseApplication/example.txt @@ -0,0 +1 @@ +This is example.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Util/TestData/EventManifest/Package.en-us.wxl b/src/test/WixToolsetTest.Util/TestData/EventManifest/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/EventManifest/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.Util/TestData/EventManifest/Package.wxs b/src/test/WixToolsetTest.Util/TestData/EventManifest/Package.wxs new file mode 100644 index 00000000..fc1018ae --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/EventManifest/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Util/TestData/EventManifest/PackageComponents.wxs b/src/test/WixToolsetTest.Util/TestData/EventManifest/PackageComponents.wxs new file mode 100644 index 00000000..75af3f59 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/EventManifest/PackageComponents.wxs @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Util/TestData/EventManifest/example.txt b/src/test/WixToolsetTest.Util/TestData/EventManifest/example.txt new file mode 100644 index 00000000..1b4ffe8a --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/EventManifest/example.txt @@ -0,0 +1 @@ +This is example.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.en-us.wxl b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.wxs b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.wxs new file mode 100644 index 00000000..fc1018ae --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Util/TestData/InternetShortcut/PackageComponents.wxs b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/PackageComponents.wxs new file mode 100644 index 00000000..23b172f8 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/PackageComponents.wxs @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Util/TestData/InternetShortcut/example.txt b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/example.txt new file mode 100644 index 00000000..1b4ffe8a --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/example.txt @@ -0,0 +1 @@ +This is example.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Util/TestData/PermissionEx/Package.en-us.wxl b/src/test/WixToolsetTest.Util/TestData/PermissionEx/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/PermissionEx/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.Util/TestData/PermissionEx/Package.wxs b/src/test/WixToolsetTest.Util/TestData/PermissionEx/Package.wxs new file mode 100644 index 00000000..fc1018ae --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/PermissionEx/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Util/TestData/PermissionEx/PackageComponents.wxs b/src/test/WixToolsetTest.Util/TestData/PermissionEx/PackageComponents.wxs new file mode 100644 index 00000000..22438a2b --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/PermissionEx/PackageComponents.wxs @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Util/TestData/PermissionEx/example.txt b/src/test/WixToolsetTest.Util/TestData/PermissionEx/example.txt new file mode 100644 index 00000000..1b4ffe8a --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/PermissionEx/example.txt @@ -0,0 +1 @@ +This is example.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs index f2f06af8..750098d6 100644 --- a/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs +++ b/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs @@ -19,11 +19,118 @@ namespace WixToolsetTest.Util var folder = TestData.Get(@"TestData\UsingFileShare"); var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); - var results = build.BuildAndQuery(Build, "FileShare", "FileSharePermissions"); + var results = build.BuildAndQuery(Build, "Binary", "CustomAction", "Wix4FileShare", "Wix4FileSharePermissions"); Assert.Equal(new[] { - "FileShare:ExampleFileShare\texample\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tAn example file share\tINSTALLFOLDER\t\t", - "FileSharePermissions:ExampleFileShare\tEveryone\t1", + "Binary:Wix4UtilCA_X86\t[Binary data]", + "CustomAction:Wix4ConfigureSmbInstall_X86\t1\tWix4UtilCA_X86\tConfigureSmbInstall\t", + "CustomAction:Wix4ConfigureSmbUninstall_X86\t1\tWix4UtilCA_X86\tConfigureSmbUninstall\t", + "CustomAction:Wix4CreateSmb_X86\t11265\tWix4UtilCA_X86\tCreateSmb\t", + "CustomAction:Wix4CreateSmbRollback_X86\t11585\tWix4UtilCA_X86\tDropSmb\t", + "CustomAction:Wix4DropSmb_X86\t11265\tWix4UtilCA_X86\tDropSmb\t", + "CustomAction:Wix4DropSmbRollback_X86\t11585\tWix4UtilCA_X86\tCreateSmb\t", + "Wix4FileShare:ExampleFileShare\texample\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tAn example file share\tINSTALLFOLDER", + "Wix4FileSharePermissions:ExampleFileShare\tEveryone\t1", + }, results.OrderBy(s => s).ToArray()); + } + + [Fact] + public void CanBuildUsingFileShareX64() + { + var folder = TestData.Get(@"TestData\UsingFileShare"); + var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); + + var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "Wix4FileShare", "Wix4FileSharePermissions"); + Assert.Equal(new[] + { + "Binary:Wix4UtilCA_X86\t[Binary data]", + "CustomAction:Wix4ConfigureSmbInstall_X86\t1\tWix4UtilCA_X86\tConfigureSmbInstall\t", + "CustomAction:Wix4ConfigureSmbUninstall_X86\t1\tWix4UtilCA_X86\tConfigureSmbUninstall\t", + "CustomAction:Wix4CreateSmb_X86\t11265\tWix4UtilCA_X86\tCreateSmb\t", + "CustomAction:Wix4CreateSmbRollback_X86\t11585\tWix4UtilCA_X86\tDropSmb\t", + "CustomAction:Wix4DropSmb_X86\t11265\tWix4UtilCA_X86\tDropSmb\t", + "CustomAction:Wix4DropSmbRollback_X86\t11585\tWix4UtilCA_X86\tCreateSmb\t", + "Wix4FileShare:ExampleFileShare\texample\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tAn example file share\tINSTALLFOLDER", + "Wix4FileSharePermissions:ExampleFileShare\tEveryone\t1", + }, results.OrderBy(s => s).ToArray()); + } + + [Fact] + public void CanBuildCloseApplication() + { + var folder = TestData.Get(@"TestData\CloseApplication"); + var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); + + var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "Wix4CloseApplication"); + Assert.Equal(new[] + { + "Binary:Wix4UtilCA_X86\t[Binary data]", + "CustomAction:Wix4CheckRebootRequired_X86\t65\tWix4UtilCA_X86\tWixCheckRebootRequired\t", + "CustomAction:Wix4CloseApplications_X86\t1\tWix4UtilCA_X86\tWixCloseApplications\t", + "CustomAction:Wix4CloseApplicationsDeferred_X86\t3073\tWix4UtilCA_X86\tWixCloseApplicationsDeferred\t", + "Wix4CloseApplication:CloseMyApp\texplorer.exe\t\t\t3\t\tMYAPPISRUNNING\t\t", + }, results.OrderBy(s => s).ToArray()); + } + + [Fact] + public void CanBuildInternetShortcut() + { + var folder = TestData.Get(@"TestData\InternetShortcut"); + var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); + + var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "RemoveFile", "Wix4InternetShortcut"); + Assert.Equal(new[] + { + "Binary:Wix4UtilCA_X86\t[Binary data]", + "CustomAction:Wix4CreateInternetShortcuts_X86\t3073\tWix4UtilCA_X86\tWixCreateInternetShortcuts\t", + "CustomAction:Wix4RollbackInternetShortcuts_X86\t3329\tWix4UtilCA_X86\tWixRollbackInternetShortcuts\t", + "CustomAction:Wix4SchedInternetShortcuts_X86\t1\tWix4UtilCA_X86\tWixSchedInternetShortcuts\t", + "RemoveFile:wixshortcut\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tvtpzs3bw.lnk|WiX Toolset.lnk\tINSTALLFOLDER\t2", + "Wix4InternetShortcut:wixshortcut\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tINSTALLFOLDER\tWiX Toolset.lnk\thttps://wixtoolset.org\t0\t\t0", + }, results.OrderBy(s => s).ToArray()); + } + + [Fact] + public void CanBuildWithPermissionEx() + { + var folder = TestData.Get(@"TestData\PermissionEx"); + var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); + + var results = build.BuildAndQuery(BuildX64, "Binary", "CreateFolder", "CustomAction", "Wix4SecureObject"); + Assert.Equal(new[] + { + "Binary:Wix4UtilCA_X64\t[Binary data]", + "CreateFolder:INSTALLFOLDER\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo", + "CustomAction:Wix4ExecSecureObjects_X64\t11265\tWix4UtilCA_X64\tExecSecureObjects\t", + "CustomAction:Wix4ExecSecureObjectsRollback_X64\t11521\tWix4UtilCA_X64\tExecSecureObjectsRollback\t", + "CustomAction:Wix4SchedSecureObjects_X64\t1\tWix4UtilCA_X64\tSchedSecureObjects\t", + "CustomAction:Wix4SchedSecureObjectsRollback_X64\t1\tWix4UtilCA_X64\tSchedSecureObjectsRollback\t", + "Wix4SecureObject:INSTALLFOLDER\tCreateFolder\t\tEveryone\t268435456\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo", + }, results.OrderBy(s => s).ToArray()); + } + + [Fact] + public void CanBuildWithEventManifest() + { + var folder = TestData.Get(@"TestData\EventManifest"); + var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }); + + var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "Wix4EventManifest", "Wix4XmlFile"); + Assert.Equal(new[] + { + "Binary:Wix4UtilCA_X86\t[Binary data]", + "CustomAction:Wix4ConfigureEventManifestRegister_X86\t1\tWix4UtilCA_X86\tConfigureEventManifestRegister\t", + "CustomAction:Wix4ConfigureEventManifestUnregister_X86\t1\tWix4UtilCA_X86\tConfigureEventManifestUnregister\t", + "CustomAction:Wix4ExecXmlFile_X86\t11265\tWix4UtilCA_X86\tExecXmlFile\t", + "CustomAction:Wix4ExecXmlFileRollback_X86\t11521\tWix4UtilCA_X86\tExecXmlFileRollback\t", + "CustomAction:Wix4RegisterEventManifest_X86\t3073\tWix4UtilCA_X86\tCAQuietExec\t", + "CustomAction:Wix4RollbackRegisterEventManifest_X86\t3393\tWix4UtilCA_X86\tCAQuietExec\t", + "CustomAction:Wix4RollbackUnregisterEventManifest_X86\t3329\tWix4UtilCA_X86\tCAQuietExec\t", + "CustomAction:Wix4SchedXmlFile_X86\t1\tWix4UtilCA_X86\tSchedXmlFile\t", + "CustomAction:Wix4UnregisterEventManifest_X86\t3137\tWix4UtilCA_X86\tCAQuietExec\t", + "Wix4EventManifest:Manifest.dll\t[#Manifest.dll]", + "Wix4XmlFile:Config_Manifest.dllMessageFile\t[#Manifest.dll]\t/*/*/*/*[\\[]@messageFileName[\\]]\tmessageFileName\t[Manifest.dll]\t4100\tManifest.dll\t", + "Wix4XmlFile:Config_Manifest.dllResourceFile\t[#Manifest.dll]\t/*/*/*/*[\\[]@resourceFileName[\\]]\tresourceFileName\t[Manifest.dll]\t4100\tManifest.dll\t", }, results.OrderBy(s => s).ToArray()); } @@ -93,8 +200,18 @@ namespace WixToolsetTest.Util private static void Build(string[] args) { - var result = WixRunner.Execute(args) - .AssertSuccess(); + var result = WixRunner.Execute(args); + result.AssertSuccess(); + } + + private static void BuildX64(string[] args) + { + var newArgs = args.ToList(); + newArgs.Add("-platform"); + newArgs.Add("x64"); + + var result = WixRunner.Execute(newArgs.ToArray()); + result.AssertSuccess(); } } } diff --git a/src/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj b/src/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj index 6cf001a2..1635287d 100644 --- a/src/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj +++ b/src/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj @@ -23,6 +23,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/wixext/Tuples/EventManifestTuple.cs b/src/wixext/Tuples/EventManifestTuple.cs index b74d2d59..364604be 100644 --- a/src/wixext/Tuples/EventManifestTuple.cs +++ b/src/wixext/Tuples/EventManifestTuple.cs @@ -11,7 +11,7 @@ namespace WixToolset.Util UtilTupleDefinitionType.EventManifest.ToString(), new[] { - new IntermediateFieldDefinition(nameof(EventManifestTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(EventManifestTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(EventManifestTupleFields.File), IntermediateFieldType.String), }, typeof(EventManifestTuple)); @@ -24,7 +24,7 @@ namespace WixToolset.Util.Tuples public enum EventManifestTupleFields { - Component_, + ComponentRef, File, } @@ -40,10 +40,10 @@ namespace WixToolset.Util.Tuples public IntermediateField this[EventManifestTupleFields index] => this.Fields[(int)index]; - public string Component_ + public string ComponentRef { - get => this.Fields[(int)EventManifestTupleFields.Component_].AsString(); - set => this.Set((int)EventManifestTupleFields.Component_, value); + get => this.Fields[(int)EventManifestTupleFields.ComponentRef].AsString(); + set => this.Set((int)EventManifestTupleFields.ComponentRef, value); } public string File diff --git a/src/wixext/Tuples/FileSharePermissionsTuple.cs b/src/wixext/Tuples/FileSharePermissionsTuple.cs index 3f037e0e..1db01b98 100644 --- a/src/wixext/Tuples/FileSharePermissionsTuple.cs +++ b/src/wixext/Tuples/FileSharePermissionsTuple.cs @@ -11,8 +11,8 @@ namespace WixToolset.Util UtilTupleDefinitionType.FileSharePermissions.ToString(), new[] { - new IntermediateFieldDefinition(nameof(FileSharePermissionsTupleFields.FileShare_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(FileSharePermissionsTupleFields.User_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(FileSharePermissionsTupleFields.FileShareRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(FileSharePermissionsTupleFields.UserRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(FileSharePermissionsTupleFields.Permissions), IntermediateFieldType.Number), }, typeof(FileSharePermissionsTuple)); @@ -25,8 +25,8 @@ namespace WixToolset.Util.Tuples public enum FileSharePermissionsTupleFields { - FileShare_, - User_, + FileShareRef, + UserRef, Permissions, } @@ -42,16 +42,16 @@ namespace WixToolset.Util.Tuples public IntermediateField this[FileSharePermissionsTupleFields index] => this.Fields[(int)index]; - public string FileShare_ + public string FileShareRef { - get => this.Fields[(int)FileSharePermissionsTupleFields.FileShare_].AsString(); - set => this.Set((int)FileSharePermissionsTupleFields.FileShare_, value); + get => this.Fields[(int)FileSharePermissionsTupleFields.FileShareRef].AsString(); + set => this.Set((int)FileSharePermissionsTupleFields.FileShareRef, value); } - public string User_ + public string UserRef { - get => this.Fields[(int)FileSharePermissionsTupleFields.User_].AsString(); - set => this.Set((int)FileSharePermissionsTupleFields.User_, value); + get => this.Fields[(int)FileSharePermissionsTupleFields.UserRef].AsString(); + set => this.Set((int)FileSharePermissionsTupleFields.UserRef, value); } public int Permissions diff --git a/src/wixext/Tuples/FileShareTuple.cs b/src/wixext/Tuples/FileShareTuple.cs index 5a31b6fa..6a04f6af 100644 --- a/src/wixext/Tuples/FileShareTuple.cs +++ b/src/wixext/Tuples/FileShareTuple.cs @@ -11,13 +11,10 @@ namespace WixToolset.Util UtilTupleDefinitionType.FileShare.ToString(), new[] { - new IntermediateFieldDefinition(nameof(FileShareTupleFields.FileShare), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(FileShareTupleFields.ShareName), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(FileShareTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(FileShareTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(FileShareTupleFields.Description), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(FileShareTupleFields.Directory_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(FileShareTupleFields.User_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(FileShareTupleFields.Permissions), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(FileShareTupleFields.DirectoryRef), IntermediateFieldType.String), }, typeof(FileShareTuple)); } @@ -29,13 +26,10 @@ namespace WixToolset.Util.Tuples public enum FileShareTupleFields { - FileShare, ShareName, - Component_, + ComponentRef, Description, - Directory_, - User_, - Permissions, + DirectoryRef, } public class FileShareTuple : IntermediateTuple @@ -50,22 +44,16 @@ namespace WixToolset.Util.Tuples public IntermediateField this[FileShareTupleFields index] => this.Fields[(int)index]; - public string FileShare - { - get => this.Fields[(int)FileShareTupleFields.FileShare].AsString(); - set => this.Set((int)FileShareTupleFields.FileShare, value); - } - public string ShareName { get => this.Fields[(int)FileShareTupleFields.ShareName].AsString(); set => this.Set((int)FileShareTupleFields.ShareName, value); } - public string Component_ + public string ComponentRef { - get => this.Fields[(int)FileShareTupleFields.Component_].AsString(); - set => this.Set((int)FileShareTupleFields.Component_, value); + get => this.Fields[(int)FileShareTupleFields.ComponentRef].AsString(); + set => this.Set((int)FileShareTupleFields.ComponentRef, value); } public string Description @@ -74,22 +62,10 @@ namespace WixToolset.Util.Tuples set => this.Set((int)FileShareTupleFields.Description, value); } - public string Directory_ - { - get => this.Fields[(int)FileShareTupleFields.Directory_].AsString(); - set => this.Set((int)FileShareTupleFields.Directory_, value); - } - - public string User_ - { - get => this.Fields[(int)FileShareTupleFields.User_].AsString(); - set => this.Set((int)FileShareTupleFields.User_, value); - } - - public int? Permissions + public string DirectoryRef { - get => this.Fields[(int)FileShareTupleFields.Permissions].AsNullableNumber(); - set => this.Set((int)FileShareTupleFields.Permissions, value); + get => this.Fields[(int)FileShareTupleFields.DirectoryRef].AsString(); + set => this.Set((int)FileShareTupleFields.DirectoryRef, value); } } } \ No newline at end of file diff --git a/src/wixext/Tuples/GroupTuple.cs b/src/wixext/Tuples/GroupTuple.cs index 97335714..6061b1f4 100644 --- a/src/wixext/Tuples/GroupTuple.cs +++ b/src/wixext/Tuples/GroupTuple.cs @@ -12,7 +12,7 @@ namespace WixToolset.Util new[] { new IntermediateFieldDefinition(nameof(GroupTupleFields.Group), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(GroupTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(GroupTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(GroupTupleFields.Name), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(GroupTupleFields.Domain), IntermediateFieldType.String), }, @@ -27,7 +27,7 @@ namespace WixToolset.Util.Tuples public enum GroupTupleFields { Group, - Component_, + ComponentRef, Name, Domain, } @@ -50,10 +50,10 @@ namespace WixToolset.Util.Tuples set => this.Set((int)GroupTupleFields.Group, value); } - public string Component_ + public string ComponentRef { - get => this.Fields[(int)GroupTupleFields.Component_].AsString(); - set => this.Set((int)GroupTupleFields.Component_, value); + get => this.Fields[(int)GroupTupleFields.ComponentRef].AsString(); + set => this.Set((int)GroupTupleFields.ComponentRef, value); } public string Name diff --git a/src/wixext/Tuples/PerfmonManifestTuple.cs b/src/wixext/Tuples/PerfmonManifestTuple.cs index 3f6cb8cc..9520105a 100644 --- a/src/wixext/Tuples/PerfmonManifestTuple.cs +++ b/src/wixext/Tuples/PerfmonManifestTuple.cs @@ -11,7 +11,7 @@ namespace WixToolset.Util UtilTupleDefinitionType.PerfmonManifest.ToString(), new[] { - new IntermediateFieldDefinition(nameof(PerfmonManifestTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(PerfmonManifestTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(PerfmonManifestTupleFields.File), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(PerfmonManifestTupleFields.ResourceFileDirectory), IntermediateFieldType.String), }, @@ -25,7 +25,7 @@ namespace WixToolset.Util.Tuples public enum PerfmonManifestTupleFields { - Component_, + ComponentRef, File, ResourceFileDirectory, } @@ -42,10 +42,10 @@ namespace WixToolset.Util.Tuples public IntermediateField this[PerfmonManifestTupleFields index] => this.Fields[(int)index]; - public string Component_ + public string ComponentRef { - get => this.Fields[(int)PerfmonManifestTupleFields.Component_].AsString(); - set => this.Set((int)PerfmonManifestTupleFields.Component_, value); + get => this.Fields[(int)PerfmonManifestTupleFields.ComponentRef].AsString(); + set => this.Set((int)PerfmonManifestTupleFields.ComponentRef, value); } public string File diff --git a/src/wixext/Tuples/PerfmonTuple.cs b/src/wixext/Tuples/PerfmonTuple.cs index 00ea818b..1fb6ef6b 100644 --- a/src/wixext/Tuples/PerfmonTuple.cs +++ b/src/wixext/Tuples/PerfmonTuple.cs @@ -11,7 +11,7 @@ namespace WixToolset.Util UtilTupleDefinitionType.Perfmon.ToString(), new[] { - new IntermediateFieldDefinition(nameof(PerfmonTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(PerfmonTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(PerfmonTupleFields.File), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(PerfmonTupleFields.Name), IntermediateFieldType.String), }, @@ -25,7 +25,7 @@ namespace WixToolset.Util.Tuples public enum PerfmonTupleFields { - Component_, + ComponentRef, File, Name, } @@ -42,10 +42,10 @@ namespace WixToolset.Util.Tuples public IntermediateField this[PerfmonTupleFields index] => this.Fields[(int)index]; - public string Component_ + public string ComponentRef { - get => this.Fields[(int)PerfmonTupleFields.Component_].AsString(); - set => this.Set((int)PerfmonTupleFields.Component_, value); + get => this.Fields[(int)PerfmonTupleFields.ComponentRef].AsString(); + set => this.Set((int)PerfmonTupleFields.ComponentRef, value); } public string File diff --git a/src/wixext/Tuples/PerformanceCategoryTuple.cs b/src/wixext/Tuples/PerformanceCategoryTuple.cs index ec2ba73d..16705466 100644 --- a/src/wixext/Tuples/PerformanceCategoryTuple.cs +++ b/src/wixext/Tuples/PerformanceCategoryTuple.cs @@ -11,8 +11,7 @@ namespace WixToolset.Util UtilTupleDefinitionType.PerformanceCategory.ToString(), new[] { - new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.PerformanceCategory), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.Name), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.IniData), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(PerformanceCategoryTupleFields.ConstantData), IntermediateFieldType.String), @@ -27,8 +26,7 @@ namespace WixToolset.Util.Tuples public enum PerformanceCategoryTupleFields { - PerformanceCategory, - Component_, + ComponentRef, Name, IniData, ConstantData, @@ -46,16 +44,10 @@ namespace WixToolset.Util.Tuples public IntermediateField this[PerformanceCategoryTupleFields index] => this.Fields[(int)index]; - public string PerformanceCategory + public string ComponentRef { - get => this.Fields[(int)PerformanceCategoryTupleFields.PerformanceCategory].AsString(); - set => this.Set((int)PerformanceCategoryTupleFields.PerformanceCategory, value); - } - - public string Component_ - { - get => this.Fields[(int)PerformanceCategoryTupleFields.Component_].AsString(); - set => this.Set((int)PerformanceCategoryTupleFields.Component_, value); + get => this.Fields[(int)PerformanceCategoryTupleFields.ComponentRef].AsString(); + set => this.Set((int)PerformanceCategoryTupleFields.ComponentRef, value); } public string Name diff --git a/src/wixext/Tuples/SecureObjectsTuple.cs b/src/wixext/Tuples/SecureObjectsTuple.cs index f54b23d8..920fe7b3 100644 --- a/src/wixext/Tuples/SecureObjectsTuple.cs +++ b/src/wixext/Tuples/SecureObjectsTuple.cs @@ -11,12 +11,11 @@ namespace WixToolset.Util UtilTupleDefinitionType.SecureObjects.ToString(), new[] { - new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.SecureObject), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.Table), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.Domain), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.User), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.Permission), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(SecureObjectsTupleFields.ComponentRef), IntermediateFieldType.String), }, typeof(SecureObjectsTuple)); } @@ -28,12 +27,11 @@ namespace WixToolset.Util.Tuples public enum SecureObjectsTupleFields { - SecureObject, Table, Domain, User, Permission, - Component_, + ComponentRef, } public class SecureObjectsTuple : IntermediateTuple @@ -48,12 +46,6 @@ namespace WixToolset.Util.Tuples public IntermediateField this[SecureObjectsTupleFields index] => this.Fields[(int)index]; - public string SecureObject - { - get => this.Fields[(int)SecureObjectsTupleFields.SecureObject].AsString(); - set => this.Set((int)SecureObjectsTupleFields.SecureObject, value); - } - public string Table { get => this.Fields[(int)SecureObjectsTupleFields.Table].AsString(); @@ -78,10 +70,10 @@ namespace WixToolset.Util.Tuples set => this.Set((int)SecureObjectsTupleFields.Permission, value); } - public string Component_ + public string ComponentRef { - get => this.Fields[(int)SecureObjectsTupleFields.Component_].AsString(); - set => this.Set((int)SecureObjectsTupleFields.Component_, value); + get => this.Fields[(int)SecureObjectsTupleFields.ComponentRef].AsString(); + set => this.Set((int)SecureObjectsTupleFields.ComponentRef, value); } } } \ No newline at end of file diff --git a/src/wixext/Tuples/ServiceConfigTuple.cs b/src/wixext/Tuples/ServiceConfigTuple.cs index 74d96bca..e5fc3992 100644 --- a/src/wixext/Tuples/ServiceConfigTuple.cs +++ b/src/wixext/Tuples/ServiceConfigTuple.cs @@ -12,7 +12,7 @@ namespace WixToolset.Util new[] { new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ServiceName), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.NewService), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.FirstFailureActionType), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.SecondFailureActionType), IntermediateFieldType.String), @@ -33,7 +33,7 @@ namespace WixToolset.Util.Tuples public enum ServiceConfigTupleFields { ServiceName, - Component_, + ComponentRef, NewService, FirstFailureActionType, SecondFailureActionType, @@ -62,10 +62,10 @@ namespace WixToolset.Util.Tuples set => this.Set((int)ServiceConfigTupleFields.ServiceName, value); } - public string Component_ + public string ComponentRef { - get => this.Fields[(int)ServiceConfigTupleFields.Component_].AsString(); - set => this.Set((int)ServiceConfigTupleFields.Component_, value); + get => this.Fields[(int)ServiceConfigTupleFields.ComponentRef].AsString(); + set => this.Set((int)ServiceConfigTupleFields.ComponentRef, value); } public int NewService diff --git a/src/wixext/Tuples/UserGroupTuple.cs b/src/wixext/Tuples/UserGroupTuple.cs index 0386a26e..30c5e9ff 100644 --- a/src/wixext/Tuples/UserGroupTuple.cs +++ b/src/wixext/Tuples/UserGroupTuple.cs @@ -11,8 +11,8 @@ namespace WixToolset.Util UtilTupleDefinitionType.UserGroup.ToString(), new[] { - new IntermediateFieldDefinition(nameof(UserGroupTupleFields.User_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(UserGroupTupleFields.Group_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(UserGroupTupleFields.UserRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(UserGroupTupleFields.GroupRef), IntermediateFieldType.String), }, typeof(UserGroupTuple)); } @@ -24,8 +24,8 @@ namespace WixToolset.Util.Tuples public enum UserGroupTupleFields { - User_, - Group_, + UserRef, + GroupRef, } public class UserGroupTuple : IntermediateTuple @@ -40,16 +40,16 @@ namespace WixToolset.Util.Tuples public IntermediateField this[UserGroupTupleFields index] => this.Fields[(int)index]; - public string User_ + public string UserRef { - get => this.Fields[(int)UserGroupTupleFields.User_].AsString(); - set => this.Set((int)UserGroupTupleFields.User_, value); + get => this.Fields[(int)UserGroupTupleFields.UserRef].AsString(); + set => this.Set((int)UserGroupTupleFields.UserRef, value); } - public string Group_ + public string GroupRef { - get => this.Fields[(int)UserGroupTupleFields.Group_].AsString(); - set => this.Set((int)UserGroupTupleFields.Group_, value); + get => this.Fields[(int)UserGroupTupleFields.GroupRef].AsString(); + set => this.Set((int)UserGroupTupleFields.GroupRef, value); } } } \ No newline at end of file diff --git a/src/wixext/Tuples/UserTuple.cs b/src/wixext/Tuples/UserTuple.cs index e8c5315c..f11ed78b 100644 --- a/src/wixext/Tuples/UserTuple.cs +++ b/src/wixext/Tuples/UserTuple.cs @@ -11,8 +11,7 @@ namespace WixToolset.Util UtilTupleDefinitionType.User.ToString(), new[] { - new IntermediateFieldDefinition(nameof(UserTupleFields.User), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(UserTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(UserTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(UserTupleFields.Name), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(UserTupleFields.Domain), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(UserTupleFields.Password), IntermediateFieldType.String), @@ -28,8 +27,7 @@ namespace WixToolset.Util.Tuples public enum UserTupleFields { - User, - Component_, + ComponentRef, Name, Domain, Password, @@ -48,16 +46,10 @@ namespace WixToolset.Util.Tuples public IntermediateField this[UserTupleFields index] => this.Fields[(int)index]; - public string User + public string ComponentRef { - get => this.Fields[(int)UserTupleFields.User].AsString(); - set => this.Set((int)UserTupleFields.User, value); - } - - public string Component_ - { - get => this.Fields[(int)UserTupleFields.Component_].AsString(); - set => this.Set((int)UserTupleFields.Component_, value); + get => this.Fields[(int)UserTupleFields.ComponentRef].AsString(); + set => this.Set((int)UserTupleFields.ComponentRef, value); } public string Name diff --git a/src/wixext/Tuples/WixCloseApplicationTuple.cs b/src/wixext/Tuples/WixCloseApplicationTuple.cs index c2095d93..cc91c326 100644 --- a/src/wixext/Tuples/WixCloseApplicationTuple.cs +++ b/src/wixext/Tuples/WixCloseApplicationTuple.cs @@ -11,7 +11,6 @@ namespace WixToolset.Util UtilTupleDefinitionType.WixCloseApplication.ToString(), new[] { - new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.WixCloseApplication), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Target), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Description), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixCloseApplicationTupleFields.Condition), IntermediateFieldType.String), @@ -31,7 +30,6 @@ namespace WixToolset.Util.Tuples public enum WixCloseApplicationTupleFields { - WixCloseApplication, Target, Description, Condition, @@ -54,12 +52,6 @@ namespace WixToolset.Util.Tuples public IntermediateField this[WixCloseApplicationTupleFields index] => this.Fields[(int)index]; - public string WixCloseApplication - { - get => this.Fields[(int)WixCloseApplicationTupleFields.WixCloseApplication].AsString(); - set => this.Set((int)WixCloseApplicationTupleFields.WixCloseApplication, value); - } - public string Target { get => this.Fields[(int)WixCloseApplicationTupleFields.Target].AsString(); diff --git a/src/wixext/Tuples/WixFormatFilesTuple.cs b/src/wixext/Tuples/WixFormatFilesTuple.cs index 7fc092b0..8e7db0c6 100644 --- a/src/wixext/Tuples/WixFormatFilesTuple.cs +++ b/src/wixext/Tuples/WixFormatFilesTuple.cs @@ -11,8 +11,8 @@ namespace WixToolset.Util UtilTupleDefinitionType.WixFormatFiles.ToString(), new[] { - new IntermediateFieldDefinition(nameof(WixFormatFilesTupleFields.Binary_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixFormatFilesTupleFields.File_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixFormatFilesTupleFields.BinaryRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixFormatFilesTupleFields.FileRef), IntermediateFieldType.String), }, typeof(WixFormatFilesTuple)); } @@ -24,8 +24,8 @@ namespace WixToolset.Util.Tuples public enum WixFormatFilesTupleFields { - Binary_, - File_, + BinaryRef, + FileRef, } public class WixFormatFilesTuple : IntermediateTuple @@ -40,16 +40,16 @@ namespace WixToolset.Util.Tuples public IntermediateField this[WixFormatFilesTupleFields index] => this.Fields[(int)index]; - public string Binary_ + public string BinaryRef { - get => this.Fields[(int)WixFormatFilesTupleFields.Binary_].AsString(); - set => this.Set((int)WixFormatFilesTupleFields.Binary_, value); + get => this.Fields[(int)WixFormatFilesTupleFields.BinaryRef].AsString(); + set => this.Set((int)WixFormatFilesTupleFields.BinaryRef, value); } - public string File_ + public string FileRef { - get => this.Fields[(int)WixFormatFilesTupleFields.File_].AsString(); - set => this.Set((int)WixFormatFilesTupleFields.File_, value); + get => this.Fields[(int)WixFormatFilesTupleFields.FileRef].AsString(); + set => this.Set((int)WixFormatFilesTupleFields.FileRef, value); } } } \ No newline at end of file diff --git a/src/wixext/Tuples/WixInternetShortcutTuple.cs b/src/wixext/Tuples/WixInternetShortcutTuple.cs index 5c29cda6..935d9462 100644 --- a/src/wixext/Tuples/WixInternetShortcutTuple.cs +++ b/src/wixext/Tuples/WixInternetShortcutTuple.cs @@ -11,9 +11,8 @@ namespace WixToolset.Util UtilTupleDefinitionType.WixInternetShortcut.ToString(), new[] { - new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.WixInternetShortcut), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Component_), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Directory_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.ComponentRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.DirectoryRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Name), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Target), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixInternetShortcutTupleFields.Attributes), IntermediateFieldType.Number), @@ -30,9 +29,8 @@ namespace WixToolset.Util.Tuples public enum WixInternetShortcutTupleFields { - WixInternetShortcut, - Component_, - Directory_, + ComponentRef, + DirectoryRef, Name, Target, Attributes, @@ -52,22 +50,16 @@ namespace WixToolset.Util.Tuples public IntermediateField this[WixInternetShortcutTupleFields index] => this.Fields[(int)index]; - public string WixInternetShortcut + public string ComponentRef { - get => this.Fields[(int)WixInternetShortcutTupleFields.WixInternetShortcut].AsString(); - set => this.Set((int)WixInternetShortcutTupleFields.WixInternetShortcut, value); + get => this.Fields[(int)WixInternetShortcutTupleFields.ComponentRef].AsString(); + set => this.Set((int)WixInternetShortcutTupleFields.ComponentRef, value); } - public string Component_ + public string DirectoryRef { - get => this.Fields[(int)WixInternetShortcutTupleFields.Component_].AsString(); - set => this.Set((int)WixInternetShortcutTupleFields.Component_, value); - } - - public string Directory_ - { - get => this.Fields[(int)WixInternetShortcutTupleFields.Directory_].AsString(); - set => this.Set((int)WixInternetShortcutTupleFields.Directory_, value); + get => this.Fields[(int)WixInternetShortcutTupleFields.DirectoryRef].AsString(); + set => this.Set((int)WixInternetShortcutTupleFields.DirectoryRef, value); } public string Name diff --git a/src/wixext/Tuples/WixRemoveFolderExTuple.cs b/src/wixext/Tuples/WixRemoveFolderExTuple.cs index 35e22e2d..d43c59c3 100644 --- a/src/wixext/Tuples/WixRemoveFolderExTuple.cs +++ b/src/wixext/Tuples/WixRemoveFolderExTuple.cs @@ -11,8 +11,7 @@ namespace WixToolset.Util UtilTupleDefinitionType.WixRemoveFolderEx.ToString(), new[] { - new IntermediateFieldDefinition(nameof(WixRemoveFolderExTupleFields.WixRemoveFolderEx), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixRemoveFolderExTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixRemoveFolderExTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixRemoveFolderExTupleFields.Property), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixRemoveFolderExTupleFields.InstallMode), IntermediateFieldType.Number), }, @@ -26,8 +25,7 @@ namespace WixToolset.Util.Tuples public enum WixRemoveFolderExTupleFields { - WixRemoveFolderEx, - Component_, + ComponentRef, Property, InstallMode, } @@ -44,16 +42,10 @@ namespace WixToolset.Util.Tuples public IntermediateField this[WixRemoveFolderExTupleFields index] => this.Fields[(int)index]; - public string WixRemoveFolderEx + public string ComponentRef { - get => this.Fields[(int)WixRemoveFolderExTupleFields.WixRemoveFolderEx].AsString(); - set => this.Set((int)WixRemoveFolderExTupleFields.WixRemoveFolderEx, value); - } - - public string Component_ - { - get => this.Fields[(int)WixRemoveFolderExTupleFields.Component_].AsString(); - set => this.Set((int)WixRemoveFolderExTupleFields.Component_, value); + get => this.Fields[(int)WixRemoveFolderExTupleFields.ComponentRef].AsString(); + set => this.Set((int)WixRemoveFolderExTupleFields.ComponentRef, value); } public string Property diff --git a/src/wixext/Tuples/WixRestartResourceTuple.cs b/src/wixext/Tuples/WixRestartResourceTuple.cs index 828d9d15..92091c3d 100644 --- a/src/wixext/Tuples/WixRestartResourceTuple.cs +++ b/src/wixext/Tuples/WixRestartResourceTuple.cs @@ -11,8 +11,7 @@ namespace WixToolset.Util UtilTupleDefinitionType.WixRestartResource.ToString(), new[] { - new IntermediateFieldDefinition(nameof(WixRestartResourceTupleFields.WixRestartResource), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixRestartResourceTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixRestartResourceTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixRestartResourceTupleFields.Resource), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixRestartResourceTupleFields.Attributes), IntermediateFieldType.Number), }, @@ -26,8 +25,7 @@ namespace WixToolset.Util.Tuples public enum WixRestartResourceTupleFields { - WixRestartResource, - Component_, + ComponentRef, Resource, Attributes, } @@ -44,16 +42,10 @@ namespace WixToolset.Util.Tuples public IntermediateField this[WixRestartResourceTupleFields index] => this.Fields[(int)index]; - public string WixRestartResource + public string ComponentRef { - get => this.Fields[(int)WixRestartResourceTupleFields.WixRestartResource].AsString(); - set => this.Set((int)WixRestartResourceTupleFields.WixRestartResource, value); - } - - public string Component_ - { - get => this.Fields[(int)WixRestartResourceTupleFields.Component_].AsString(); - set => this.Set((int)WixRestartResourceTupleFields.Component_, value); + get => this.Fields[(int)WixRestartResourceTupleFields.ComponentRef].AsString(); + set => this.Set((int)WixRestartResourceTupleFields.ComponentRef, value); } public string Resource diff --git a/src/wixext/Tuples/WixTouchFileTuple.cs b/src/wixext/Tuples/WixTouchFileTuple.cs index f87f396e..0a152dec 100644 --- a/src/wixext/Tuples/WixTouchFileTuple.cs +++ b/src/wixext/Tuples/WixTouchFileTuple.cs @@ -11,8 +11,7 @@ namespace WixToolset.Util UtilTupleDefinitionType.WixTouchFile.ToString(), new[] { - new IntermediateFieldDefinition(nameof(WixTouchFileTupleFields.WixTouchFile), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixTouchFileTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixTouchFileTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixTouchFileTupleFields.Path), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixTouchFileTupleFields.Attributes), IntermediateFieldType.Number), }, @@ -26,8 +25,7 @@ namespace WixToolset.Util.Tuples public enum WixTouchFileTupleFields { - WixTouchFile, - Component_, + ComponentRef, Path, Attributes, } @@ -44,16 +42,10 @@ namespace WixToolset.Util.Tuples public IntermediateField this[WixTouchFileTupleFields index] => this.Fields[(int)index]; - public string WixTouchFile + public string ComponentRef { - get => this.Fields[(int)WixTouchFileTupleFields.WixTouchFile].AsString(); - set => this.Set((int)WixTouchFileTupleFields.WixTouchFile, value); - } - - public string Component_ - { - get => this.Fields[(int)WixTouchFileTupleFields.Component_].AsString(); - set => this.Set((int)WixTouchFileTupleFields.Component_, value); + get => this.Fields[(int)WixTouchFileTupleFields.ComponentRef].AsString(); + set => this.Set((int)WixTouchFileTupleFields.ComponentRef, value); } public string Path diff --git a/src/wixext/Tuples/XmlConfigTuple.cs b/src/wixext/Tuples/XmlConfigTuple.cs index 093299b2..0eb49cac 100644 --- a/src/wixext/Tuples/XmlConfigTuple.cs +++ b/src/wixext/Tuples/XmlConfigTuple.cs @@ -11,14 +11,13 @@ namespace WixToolset.Util UtilTupleDefinitionType.XmlConfig.ToString(), new[] { - new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.XmlConfig), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.File), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.ElementPath), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.VerifyPath), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Name), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Value), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Flags), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(XmlConfigTupleFields.Sequence), IntermediateFieldType.Number), }, typeof(XmlConfigTuple)); @@ -31,14 +30,13 @@ namespace WixToolset.Util.Tuples public enum XmlConfigTupleFields { - XmlConfig, File, ElementPath, VerifyPath, Name, Value, Flags, - Component_, + ComponentRef, Sequence, } @@ -54,12 +52,6 @@ namespace WixToolset.Util.Tuples public IntermediateField this[XmlConfigTupleFields index] => this.Fields[(int)index]; - public string XmlConfig - { - get => this.Fields[(int)XmlConfigTupleFields.XmlConfig].AsString(); - set => this.Set((int)XmlConfigTupleFields.XmlConfig, value); - } - public string File { get => this.Fields[(int)XmlConfigTupleFields.File].AsString(); @@ -96,10 +88,10 @@ namespace WixToolset.Util.Tuples set => this.Set((int)XmlConfigTupleFields.Flags, value); } - public string Component_ + public string ComponentRef { - get => this.Fields[(int)XmlConfigTupleFields.Component_].AsString(); - set => this.Set((int)XmlConfigTupleFields.Component_, value); + get => this.Fields[(int)XmlConfigTupleFields.ComponentRef].AsString(); + set => this.Set((int)XmlConfigTupleFields.ComponentRef, value); } public int Sequence diff --git a/src/wixext/Tuples/XmlFileTuple.cs b/src/wixext/Tuples/XmlFileTuple.cs index 27ea7119..e0b3bbd7 100644 --- a/src/wixext/Tuples/XmlFileTuple.cs +++ b/src/wixext/Tuples/XmlFileTuple.cs @@ -11,13 +11,12 @@ namespace WixToolset.Util UtilTupleDefinitionType.XmlFile.ToString(), new[] { - new IntermediateFieldDefinition(nameof(XmlFileTupleFields.XmlFile), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(XmlFileTupleFields.File), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(XmlFileTupleFields.ElementPath), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Name), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Value), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Flags), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Component_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(XmlFileTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(XmlFileTupleFields.Sequence), IntermediateFieldType.Number), }, typeof(XmlFileTuple)); @@ -30,13 +29,12 @@ namespace WixToolset.Util.Tuples public enum XmlFileTupleFields { - XmlFile, File, ElementPath, Name, Value, Flags, - Component_, + ComponentRef, Sequence, } @@ -52,12 +50,6 @@ namespace WixToolset.Util.Tuples public IntermediateField this[XmlFileTupleFields index] => this.Fields[(int)index]; - public string XmlFile - { - get => this.Fields[(int)XmlFileTupleFields.XmlFile].AsString(); - set => this.Set((int)XmlFileTupleFields.XmlFile, value); - } - public string File { get => this.Fields[(int)XmlFileTupleFields.File].AsString(); @@ -88,10 +80,10 @@ namespace WixToolset.Util.Tuples set => this.Set((int)XmlFileTupleFields.Flags, value); } - public string Component_ + public string ComponentRef { - get => this.Fields[(int)XmlFileTupleFields.Component_].AsString(); - set => this.Set((int)XmlFileTupleFields.Component_, value); + get => this.Fields[(int)XmlFileTupleFields.ComponentRef].AsString(); + set => this.Set((int)XmlFileTupleFields.ComponentRef, value); } public int Sequence diff --git a/src/wixext/UtilCompiler.cs b/src/wixext/UtilCompiler.cs index 19f4af06..a8d59ca3 100644 --- a/src/wixext/UtilCompiler.cs +++ b/src/wixext/UtilCompiler.cs @@ -14,6 +14,7 @@ namespace WixToolset.Util using WixToolset.Data.Tuples; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; + using WixToolset.Util.Tuples; /// /// The compiler for the WiX Toolset Utility Extension. @@ -790,38 +791,32 @@ namespace WixToolset.Util this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); - // Reference CustomAction since nothing will happen without it - if (this.Context.Platform == Platform.ARM) - { - // Ensure ARM version of the CA is referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixCloseApplications_ARM"); - } - else - { - // All other supported platforms use x86 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixCloseApplications"); - } + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "CloseApplications", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixCloseApplication", id); - row.Set(1, target); - row.Set(2, description); - row.Set(3, condition); - row.Set(4, attributes); + var tuple = new WixCloseApplicationTuple(sourceLineNumbers, id) + { + Target = target, + Description = description, + Condition = condition, + Attributes = attributes, + Property = property, + }; if (CompilerConstants.IntegerNotSet != sequence) { - row.Set(5, sequence); + tuple.Sequence = sequence; } - row.Set(6, property); if (CompilerConstants.IntegerNotSet != terminateExitCode) { - row.Set(7, terminateExitCode); + tuple.TerminateExitCode = terminateExitCode; } if (CompilerConstants.IntegerNotSet != timeout) { - row.Set(8, timeout * 1000); // make the timeout milliseconds in the table. + tuple.Timeout = timeout * 1000; // make the timeout milliseconds in the table. } + + section.Tuples.Add(tuple); } } @@ -1096,7 +1091,7 @@ namespace WixToolset.Util SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); string description = null; string name = null; - string id = null; + Identifier id = null; foreach (XAttribute attrib in element.Attributes()) { @@ -1105,7 +1100,7 @@ namespace WixToolset.Util switch (attrib.Name.LocalName) { case "Id": - id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); break; case "Name": name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); @@ -1159,28 +1154,20 @@ namespace WixToolset.Util } } - // Reference ConfigureSmbInstall and ConfigureSmbUninstall since nothing will happen without it - if (this.Context.Platform == Platform.ARM) - { - // Ensure ARM version of the CA is referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbInstall_ARM"); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbUninstall_ARM"); - } - else - { - // All other supported platforms use x86 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbInstall"); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbUninstall"); - } + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigureSmbInstall", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigureSmbUninstall", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "FileShare"); - row.Set(0, id); - row.Set(1, name); - row.Set(2, componentId); - row.Set(3, description); - row.Set(4, directoryId); + var tuple = new FileShareTuple(sourceLineNumbers, id) + { + ShareName = name, + ComponentRef = componentId, + Description = description, + DirectoryRef = directoryId, + }; + + section.Tuples.Add(tuple); } } @@ -1189,7 +1176,7 @@ namespace WixToolset.Util /// /// Element to parse. /// The identifier of the parent FileShare element. - private void ParseFileSharePermissionElement(Intermediate intermediate, IntermediateSection section, XElement element, string fileShareId) + private void ParseFileSharePermissionElement(Intermediate intermediate, IntermediateSection section, XElement element, Identifier fileShareId) { SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); BitArray bits = new BitArray(32); @@ -1244,10 +1231,14 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "FileSharePermissions"); - row.Set(0, fileShareId); - row.Set(1, user); - row.Set(2, permission); + var tuple = new FileSharePermissionsTuple(sourceLineNumbers) + { + FileShareRef = fileShareId.Id, + UserRef = user, + Permissions = permission, + }; + + section.Tuples.Add(tuple); } } @@ -1259,7 +1250,7 @@ namespace WixToolset.Util private void ParseGroupElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) { SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); - string id = null; + Identifier id = null; string domain = null; string name = null; @@ -1270,7 +1261,7 @@ namespace WixToolset.Util switch (attrib.Name.LocalName) { case "Id": - id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); break; case "Name": name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); @@ -1298,11 +1289,14 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "Group"); - row.Set(0, id); - row.Set(1, componentId); - row.Set(2, name); - row.Set(3, domain); + var tuple = new GroupTuple(sourceLineNumbers, id) + { + ComponentRef = componentId, + Name = name, + Domain = domain, + }; + + section.Tuples.Add(tuple); } } @@ -1341,9 +1335,13 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "UserGroup"); - row.Set(0, userId); - row.Set(1, groupId); + var tuple = new UserGroupTuple(sourceLineNumbers) + { + UserRef = userId, + GroupRef = groupId, + }; + + section.Tuples.Add(tuple); } } @@ -1356,7 +1354,7 @@ namespace WixToolset.Util private void ParseInternetShortcutElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string defaultTarget) { SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); - string id = null; + Identifier id = null; string name = null; string target = null; string directoryId = null; @@ -1374,7 +1372,7 @@ namespace WixToolset.Util directoryId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); break; case "Id": - id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); break; case "Name": name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); @@ -1457,43 +1455,40 @@ namespace WixToolset.Util /// Identifier of shortcut. /// Name of shortcut without extension. /// Target URL of shortcut. - private void CreateWixInternetShortcut(IntermediateSection section, SourceLineNumber sourceLineNumbers, string componentId, string directoryId, string shortcutId, string name, string target, InternetShortcutType type, string iconFile, int iconIndex) + private void CreateWixInternetShortcut(IntermediateSection section, SourceLineNumber sourceLineNumbers, string componentId, string directoryId, Identifier shortcutId, string name, string target, InternetShortcutType type, string iconFile, int iconIndex) { // add the appropriate extension based on type of shortcut name = String.Concat(name, InternetShortcutType.Url == type ? ".url" : ".lnk"); - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixInternetShortcut"); - row.Set(0, shortcutId); - row.Set(1, componentId); - row.Set(2, directoryId); - row.Set(3, name); - row.Set(4, target); - row.Set(5, (int)type); - row.Set(6, iconFile); - row.Set(7, iconIndex); - - // Reference custom action because nothing will happen without it - if (this.Context.Platform == Platform.ARM) - { - // Ensure ARM version of the CA is referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedInternetShortcuts_ARM"); - } - else + var tuple = new WixInternetShortcutTuple(sourceLineNumbers, shortcutId) { - // All other supported platforms use x86 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedInternetShortcuts"); - } + ComponentRef = componentId, + DirectoryRef = directoryId, + Name = name, + Target = target, + Attributes = (int)type, + IconFile = iconFile, + IconIndex = iconIndex, + }; + + section.Tuples.Add(tuple); + + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedInternetShortcuts", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); // make sure we have a CreateFolder table so that the immediate CA can add temporary rows to handle installation and uninstallation this.ParseHelper.EnsureTable(section, sourceLineNumbers, "CreateFolder"); // use built-in MSI functionality to remove the shortcuts rather than doing so via CA - row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "RemoveFile"); - row.Set(0, shortcutId); - row.Set(1, componentId); - row.Set(2, this.ParseHelper.IsValidShortFilename(name, false) ? name : String.Concat(this.ParseHelper.CreateShortName(name, true, false, directoryId, name), "|", name)); - row.Set(3, directoryId); - row.Set(4, 2); // msidbRemoveFileInstallModeOnRemove + var removeFileTuple = new RemoveFileTuple(sourceLineNumbers, shortcutId) + { + ComponentRef = componentId, + DirProperty = directoryId, + OnUninstall = true, + // TODO: A better way? + FileName = this.ParseHelper.IsValidShortFilename(name, false) ? name : String.Concat(this.ParseHelper.CreateShortName(name, true, false, directoryId, name), "|", name), + }; + + section.Tuples.Add(removeFileTuple); } /// @@ -1504,7 +1499,7 @@ namespace WixToolset.Util private void ParsePerformanceCategoryElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) { SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); - string id = null; + Identifier id = null; string name = null; string help = null; YesNoType multiInstance = YesNoType.No; @@ -1537,7 +1532,7 @@ namespace WixToolset.Util help = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); break; case "Id": - id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); break; case "Library": library = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); @@ -1569,7 +1564,7 @@ namespace WixToolset.Util if (null == name) { - name = id; + name = id?.Id; } // Process the child counter elements. @@ -1641,12 +1636,15 @@ namespace WixToolset.Util sbSymbolicConstants.AppendFormat("#define LAST_{0}_COUNTER_OFFSET {1}\r\n", objectName, symbolConstantsCounter); // Add the calculated INI and H strings to the PerformanceCategory table. - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "PerformanceCategory"); - row.Set(0, id); - row.Set(1, componentId); - row.Set(2, name); - row.Set(3, sbIniData.ToString()); - row.Set(4, sbSymbolicConstants.ToString()); + var tuple = new PerformanceCategoryTuple(sourceLineNumbers, id) + { + ComponentRef = componentId, + Name = name, + IniData = sbIniData.ToString(), + ConstantData = sbSymbolicConstants.ToString(), + }; + + section.Tuples.Add(tuple); // Set up the application's performance key. string escapedName = UtilCompiler.FindPropertyBrackets.Replace(name, this.EscapeProperties); @@ -1664,19 +1662,8 @@ namespace WixToolset.Util this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Counter Types", sbCounterTypes.ToString(), componentId, false); } - // Reference InstallPerfCounterData and UninstallPerfCounterData since nothing will happen without them - if (this.Context.Platform == Platform.ARM) - { - // Ensure ARM version of the CAs are referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "InstallPerfCounterData_ARM"); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "UninstallPerfCounterData_ARM"); - } - else - { - // All other supported platforms use x86 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "InstallPerfCounterData"); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "UninstallPerfCounterData"); - } + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "InstallPerfCounterData", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "UninstallPerfCounterData", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); } /// @@ -2146,25 +2133,18 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "Perfmon"); - row.Set(0, componentId); - row.Set(1, $"[#{fileId}]"); - row.Set(2, name); - } + var tuple = new PerfmonTuple(sourceLineNumbers) + { + ComponentRef = componentId, + File = $"[#{fileId}]", + Name = name, + }; - // Reference ConfigurePerfmonInstall and ConfigurePerfmonUninstall since nothing will happen without them - if (this.Context.Platform == Platform.ARM) - { - // Ensure ARM version of the CAs are referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonInstall_ARM"); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonUninstall_ARM"); - } - else - { - // All other supported platforms use x86 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonInstall"); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonUninstall"); + section.Tuples.Add(tuple); } + + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonInstall", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonUninstall", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); } @@ -2203,24 +2183,18 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "PerfmonManifest"); - row.Set(0, componentId); - row.Set(1, $"[#{fileId}]"); - row.Set(2, resourceFileDirectory); - } + var tuple = new PerfmonManifestTuple(sourceLineNumbers) + { + ComponentRef = componentId, + File = $"[#{fileId}]", + ResourceFileDirectory = resourceFileDirectory, + }; - if (this.Context.Platform == Platform.ARM) - { - // Ensure ARM version of the CAs are referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestRegister_ARM"); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestUnregister_ARM"); - } - else - { - // All other supported platforms use x86 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestRegister"); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestUnregister"); + section.Tuples.Add(tuple); } + + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonManifestRegister", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonManifestUnregister", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); } /// @@ -2263,23 +2237,15 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - switch (this.Context.Platform) + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedFormatFiles", this.Context.Platform, CustomActionPlatforms.X64 | CustomActionPlatforms.X86); + + var tuple = new WixFormatFilesTuple(sourceLineNumbers) { - case Platform.X86: - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedFormatFiles"); - break; - case Platform.X64: - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedFormatFiles_x64"); - break; - case Platform.IA64: - case Platform.ARM: - this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, this.Context.Platform.ToString(), element.Name.LocalName)); - break; - } + BinaryRef = binaryId, + FileRef = fileId, + }; - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixFormatFiles"); - row.Set(0, binaryId); - row.Set(1, fileId); + section.Tuples.Add(tuple); this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Binary", binaryId); } @@ -2328,71 +2294,62 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "EventManifest"); - row.Set(0, componentId); - row.Set(1, $"[#{fileId}]"); + var tuple = new EventManifestTuple(sourceLineNumbers) + { + ComponentRef = componentId, + File = $"[#{fileId}]", + }; + + section.Tuples.Add(tuple); if (null != messageFile) { - var messageRow = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlFile"); - messageRow.Set(0, String.Concat("Config_", fileId, "MessageFile")); - messageRow.Set(1, $"[#{fileId}]"); - messageRow.Set(2, "/*/*/*/*[\\[]@messageFileName[\\]]"); - messageRow.Set(3, "messageFileName"); - messageRow.Set(4, messageFile); - messageRow.Set(5, 4 | 0x00001000); //bulk write | preserve modified date - messageRow.Set(6, componentId); + var xmlTuple = new XmlFileTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, $"Config_{fileId}MessageFile")) + { + File = $"[#{fileId}]", + ElementPath = "/*/*/*/*[\\[]@messageFileName[\\]]", + Name = "messageFileName", + Value = messageFile, + Flags = 4 | 0x00001000, //bulk write | preserve modified date + ComponentRef = componentId, + }; + section.Tuples.Add(xmlTuple); } if (null != parameterFile) { - var resourceRow = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlFile"); - resourceRow.Set(0, String.Concat("Config_", fileId, "ParameterFile")); - resourceRow.Set(1, $"[#{fileId}]"); - resourceRow.Set(2, "/*/*/*/*[\\[]@parameterFileName[\\]]"); - resourceRow.Set(3, "parameterFileName"); - resourceRow.Set(4, parameterFile); - resourceRow.Set(5, 4 | 0x00001000); //bulk write | preserve modified date - resourceRow.Set(6, componentId); + var xmlTuple = new XmlFileTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, $"Config_{fileId}ParameterFile")) + { + File = $"[#{fileId}]", + ElementPath = "/*/*/*/*[\\[]@parameterFileName[\\]]", + Name = "parameterFileName", + Value = parameterFile, + Flags = 4 | 0x00001000, //bulk write | preserve modified date + ComponentRef = componentId, + }; + section.Tuples.Add(xmlTuple); } if (null != resourceFile) { - var resourceRow = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlFile"); - resourceRow.Set(0, String.Concat("Config_", fileId, "ResourceFile")); - resourceRow.Set(1, $"[#{fileId}]"); - resourceRow.Set(2, "/*/*/*/*[\\[]@resourceFileName[\\]]"); - resourceRow.Set(3, "resourceFileName"); - resourceRow.Set(4, resourceFile); - resourceRow.Set(5, 4 | 0x00001000); //bulk write | preserve modified date - resourceRow.Set(6, componentId); + var xmlTuple = new XmlFileTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, $"Config_{fileId}ResourceFile")) + { + File = $"[#{fileId}]", + ElementPath = "/*/*/*/*[\\[]@resourceFileName[\\]]", + Name = "resourceFileName", + Value = resourceFile, + Flags = 4 | 0x00001000, //bulk write | preserve modified date + ComponentRef = componentId, + }; + section.Tuples.Add(xmlTuple); } } - if (this.Context.Platform == Platform.ARM) - { - // Ensure ARM version of the CA is referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestRegister_ARM"); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestUnregister_ARM"); - } - else - { - // All other supported platforms use x86 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestRegister"); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestUnregister"); - } + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigureEventManifestRegister", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigureEventManifestUnregister", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); if (null != messageFile || null != parameterFile || null != resourceFile) { - if (this.Context.Platform == Platform.ARM) - { - // Ensure ARM version of the CA is referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile_ARM"); - } - else - { - // All other supported platforms use x86 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile"); - } + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlFile", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); } } @@ -2493,36 +2450,18 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - if (win64) - { - if (this.Context.Platform == Platform.IA64) - { - this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, "ia64", element.Name.LocalName)); - } - else - { - // Ensure SchedSecureObjects (x64) is referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedSecureObjects_x64"); - } - } - else if (this.Context.Platform == Platform.ARM) - { - // Ensure SchedSecureObjects (arm) is referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedSecureObjects_ARM"); - } - else + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedSecureObjects", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X64 | CustomActionPlatforms.X86); + + var tuple = new SecureObjectsTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, objectId)) { - // Ensure SchedSecureObjects (x86) is referenced, to handle this x86 component member - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedSecureObjects"); - } + Table = tableName, + Domain = domain, + User = user, + Permission = permission, + ComponentRef = componentId, + }; - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "SecureObjects"); - row.Set(0, objectId); - row.Set(1, tableName); - row.Set(2, domain); - row.Set(3, user); - row.Set(4, permission); - row.Set(5, componentId); + section.Tuples.Add(tuple); } } @@ -2881,13 +2820,18 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixRemoveFolderEx", id); - row.Set(1, componentId); - row.Set(2, property); - row.Set(3, on); + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "RemoveFoldersEx", this.Context.Platform, CustomActionPlatforms.X86); + + var tuple = new WixRemoveFolderExTuple(sourceLineNumbers) + { + ComponentRef = componentId, + Property = property, + InstallMode = (int)on, + }; + + section.Tuples.Add(tuple); this.ParseHelper.EnsureTable(section, sourceLineNumbers, "RemoveFile"); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixRemoveFoldersEx"); } } @@ -2954,22 +2898,16 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - // Add a reference to the WixRegisterRestartResources custom action since nothing will happen without it. - if (this.Context.Platform == Platform.ARM) - { - // Ensure ARM version of the CA is referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixRegisterRestartResources_ARM"); - } - else + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "RegisterRestartResources", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); + + var tuple = new WixRestartResourceTuple(sourceLineNumbers) { - // All other supported platforms use x86 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixRegisterRestartResources"); - } + ComponentRef = componentId, + Resource = resource, + Attributes = attributes, + }; - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixRestartResource", id); - row.Set(1, componentId); - row.Set(2, resource); - row.Set(3, attributes); + section.Tuples.Add(tuple); } } @@ -3052,38 +2990,25 @@ namespace WixToolset.Util this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); - // Reference SchedServiceConfig since nothing will happen without it - if (this.Context.Platform == Platform.ARM) - { - // Ensure ARM version of the CA is referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedServiceConfig_ARM"); - } - else - { - // All other supported platforms use x86 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedServiceConfig"); - } - if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "ServiceConfig"); - row.Set(0, serviceName); - row.Set(1, componentId); - row.Set(2, (newService ? 1 : 0)); - row.Set(3, firstFailureActionType); - row.Set(4, secondFailureActionType); - row.Set(5, thirdFailureActionType); - if (CompilerConstants.IntegerNotSet != resetPeriod) - { - row.Set(6, resetPeriod); - } + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedServiceConfig", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); - if (CompilerConstants.IntegerNotSet != restartServiceDelay) + var tuple = new ServiceConfigTuple(sourceLineNumbers) { - row.Set(7, restartServiceDelay); - } - row.Set(8, programCommandLine); - row.Set(9, rebootMessage); + ServiceName = serviceName, + ComponentRef = componentId, + NewService = newService ? 1 : 0, + FirstFailureActionType = firstFailureActionType, + SecondFailureActionType = secondFailureActionType, + ThirdFailureActionType = thirdFailureActionType, + ResetPeriodInDays = resetPeriod, + RestartServiceDelayInSeconds = restartServiceDelay, + ProgramCommandLine = programCommandLine, + RebootMessage = rebootMessage, + }; + + section.Tuples.Add(tuple); } } @@ -3166,12 +3091,16 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixTouchFile", id); - row.Set(1, componentId); - row.Set(2, path); - row.Set(3, attributes); + var tuple = new WixTouchFileTuple(sourceLineNumbers) + { + ComponentRef = componentId, + Path = path, + Attributes = attributes, + }; + + section.Tuples.Add(tuple); - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixTouchFileDuringInstall"); + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "TouchFileDuringInstall", this.Context.Platform, CustomActionPlatforms.X86); } } @@ -3375,27 +3304,21 @@ namespace WixToolset.Util if (null != componentId) { - // Reference ConfigureIIs since nothing will happen without it - if (this.Context.Platform == Platform.ARM) - { - // Ensure ARM version of the CA is referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureUsers_ARM"); - } - else - { - // All other supported platforms use x86 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureUsers"); - } + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigureUsers", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); } if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "User", id); - row.Set(1, componentId); - row.Set(2, name); - row.Set(3, domain); - row.Set(4, password); - row.Set(5, attributes); + var tuple = new UserTuple(sourceLineNumbers, id) + { + ComponentRef = componentId, + Name = name, + Domain = domain, + Password = password, + Attributes = attributes, + }; + + section.Tuples.Add(tuple); } } @@ -3407,7 +3330,7 @@ namespace WixToolset.Util private void ParseXmlFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) { SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); - string id = null; + Identifier id = null; string file = null; string elementPath = null; string name = null; @@ -3458,7 +3381,7 @@ namespace WixToolset.Util } break; case "Id": - id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); break; case "File": file = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); @@ -3522,31 +3445,23 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlFile"); - row.Set(0, id); - row.Set(1, file); - row.Set(2, elementPath); - row.Set(3, name); - row.Set(4, value); - row.Set(5, flags); - row.Set(6, componentId); + var tuple = new XmlFileTuple(sourceLineNumbers, id) + { + File = file, + ElementPath = elementPath, + Name = name, + Value = value, + Flags = flags, + ComponentRef = componentId, + }; if (-1 != sequence) { - row.Set(7, sequence); + tuple.Sequence = sequence; } + section.Tuples.Add(tuple); } - // Reference SchedXmlFile since nothing will happen without it - if (this.Context.Platform == Platform.ARM) - { - // Ensure ARM version of the CA is referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile_ARM"); - } - else - { - // All other supported platforms use x86 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile"); - } + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlFile", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); } /// @@ -3558,7 +3473,7 @@ namespace WixToolset.Util private void ParseXmlConfigElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, bool nested) { SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); - string id = null; + Identifier id = null; string elementId = null; string elementPath = null; int flags = 0; @@ -3575,7 +3490,7 @@ namespace WixToolset.Util switch (attrib.Name.LocalName) { case "Id": - id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); break; case "Action": if (nested) @@ -3760,32 +3675,24 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlConfig"); - row.Set(0, id); - row.Set(1, file); - row.Set(2, elementId ?? elementPath); - row.Set(3, verifyPath); - row.Set(4, name); - row.Set(5, value); - row.Set(6, flags); - row.Set(7, componentId); + var tuple = new XmlConfigTuple(sourceLineNumbers, id) + { + File=file, + ElementPath=elementId ??elementPath, + VerifyPath=verifyPath, + Name=name, + Value=value, + Flags=flags, + ComponentRef=componentId, + }; if (CompilerConstants.IntegerNotSet != sequence) { - row.Set(8, sequence); + tuple.Sequence = sequence; } + section.Tuples.Add(tuple); } - // Reference SchedXmlConfig since nothing will happen without it - if (this.Context.Platform == Platform.ARM) - { - // Ensure ARM version of the CA is referenced - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlConfig_ARM"); - } - else - { - // All other supported platforms use x86 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlConfig"); - } + this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlConfig", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); } /// diff --git a/src/wixext/UtilWindowsInstallerBackendExtension.cs b/src/wixext/UtilWindowsInstallerBackendExtension.cs index 2365ed01..8648cb17 100644 --- a/src/wixext/UtilWindowsInstallerBackendExtension.cs +++ b/src/wixext/UtilWindowsInstallerBackendExtension.cs @@ -5,6 +5,7 @@ namespace WixToolset.Util using System.Collections.Generic; using System.Linq; using System.Xml; + using WixToolset.Data; using WixToolset.Data.WindowsInstaller; using WixToolset.Extensibility; @@ -14,6 +15,12 @@ namespace WixToolset.Util public override IEnumerable TableDefinitions { get => Tables; } + public override bool TryAddTupleToOutput(IntermediateTuple tuple, WindowsInstallerData output) + { + var columnZeroIsId = tuple.Id != null; + return this.BackendHelper.TryAddTupleToOutputMatchingTableDefinitions(tuple, output, this.TableDefinitions, columnZeroIsId); + } + private static TableDefinition[] LoadTables() { using (var resourceStream = typeof(UtilWindowsInstallerBackendBinderExtension).Assembly.GetManifestResourceStream("WixToolset.Util.tables.xml")) diff --git a/src/wixext/WixToolset.Util.wixext.csproj b/src/wixext/WixToolset.Util.wixext.csproj index ed5a6a0f..3cd7b115 100644 --- a/src/wixext/WixToolset.Util.wixext.csproj +++ b/src/wixext/WixToolset.Util.wixext.csproj @@ -19,6 +19,7 @@ + diff --git a/src/wixext/tables.xml b/src/wixext/tables.xml index 9f491e56..b8d4246c 100644 --- a/src/wixext/tables.xml +++ b/src/wixext/tables.xml @@ -3,8 +3,8 @@ - - + @@ -23,8 +23,8 @@ - - + @@ -33,8 +33,8 @@ - - + @@ -43,8 +43,8 @@ - - + @@ -54,21 +54,17 @@ category="text" description="Description string displayed for the file share"/> - - - - + - + - - + @@ -77,8 +73,8 @@ - - + @@ -95,8 +91,8 @@ - - + @@ -107,7 +103,7 @@ - + - + - + - - + + category="text" description="User name half of user account to secure"/> - + - - + + - - + @@ -189,14 +185,14 @@ - - - + + + - - + @@ -213,13 +209,13 @@ - - + + category="formatted" description="The XPATH query for an element to modify or add children to. Can also be a foreign key reference to another Wix4XmlConfig row if no attributes are set and the row referenced is a create element row."/> - + + @@ -63,368 +64,358 @@ - + - WIXFAILWHENDEFERRED=1 AND VersionNT > 400 + WIXFAILWHENDEFERRED=1 AND VersionNT > 400 - + - + - + - + - + - NEWERVERSIONDETECTED AND VersionNT > 400 + NEWERVERSIONDETECTED AND VersionNT > 400 - + - + - + - + - + - + - + - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) - + - + - + - + - + - + - + - + - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) - + - + - + - + - - - - - - - - - - - + - + - + - + - + diff --git a/src/wixlib/UtilExtension_Platform.wxi b/src/wixlib/UtilExtension_Platform.wxi index 4f76c687..0d7fed09 100644 --- a/src/wixlib/UtilExtension_Platform.wxi +++ b/src/wixlib/UtilExtension_Platform.wxi @@ -3,8 +3,7 @@ - - + - NOT REMOVE~="ALL" AND VersionNT > 400 + NOT REMOVE~="ALL" AND VersionNT > 400 - - - + + + - VersionNT > 400 + VersionNT > 400 - + - + - - - + + + - + - VersionNT > 400 + VersionNT > 400 - - - - - - + + + + + + - VersionNT > 400 - VersionNT > 400 + VersionNT > 400 + VersionNT > 400 - - - - - - + + + + + + - VersionNT > 400 - VersionNT > 400 + VersionNT > 400 + VersionNT > 400 - - - - - - + + + + + + - VersionNT > 400 - VersionNT > 400 + VersionNT > 400 + VersionNT > 400 - - - - - - + + + + + + - VersionNT > 400 - VersionNT > 400 + VersionNT > 400 + VersionNT > 400 - - - - - - + + + + + + - VersionNT > 400 - VersionNT > 400 + VersionNT > 400 + VersionNT > 400 - - - + + + - NOT REMOVE~="ALL" AND VersionNT > 400 + NOT REMOVE~="ALL" AND VersionNT > 400 - - - - + + + + - - + + - - - + + + - VersionNT > 400 + VersionNT > 400 - - - + + + - VersionNT > 400 + VersionNT > 400 - - - + + + - VersionNT > 400 - VersionNT > 400 - VersionNT > 400 + VersionNT > 400 + VersionNT > 400 + VersionNT > 400 @@ -196,29 +195,29 @@ - - - - + + + + - NOT REMOVE~="ALL" AND VersionNT > 400 - VersionNT > 400 + NOT REMOVE~="ALL" AND VersionNT > 400 + VersionNT > 400 - - - + + + - + - + diff --git a/src/wixlib/caDecor.wxi b/src/wixlib/caDecor.wxi new file mode 100644 index 00000000..1d00df8f --- /dev/null +++ b/src/wixlib/caDecor.wxi @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wixlib/caSuffix.wxi b/src/wixlib/caSuffix.wxi deleted file mode 100644 index a56a2393..00000000 --- a/src/wixlib/caSuffix.wxi +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/wixlib/util.wixproj b/src/wixlib/util.wixproj index f9dbabb8..21d96832 100644 --- a/src/wixlib/util.wixproj +++ b/src/wixlib/util.wixproj @@ -33,7 +33,7 @@ - + -- cgit v1.2.3-55-g6feb