diff --git a/tools/msvs/msi/custom_actions.c b/tools/msvs/msi/custom_actions.cc
similarity index 92%
rename from tools/msvs/msi/custom_actions.c
rename to tools/msvs/msi/custom_actions.cc
index bf36edc734ec1c..5c2a2b5d5245f9 100644
--- a/tools/msvs/msi/custom_actions.c
+++ b/tools/msvs/msi/custom_actions.cc
@@ -7,7 +7,7 @@
#define GUID_BUFFER_SIZE 39 // {8-4-4-4-12}\0
-UINT WINAPI SetInstallScope(MSIHANDLE hInstall) {
+extern "C" UINT WINAPI SetInstallScope(MSIHANDLE hInstall) {
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
TCHAR upgrade_code[GUID_BUFFER_SIZE];
@@ -56,7 +56,7 @@ UINT WINAPI SetInstallScope(MSIHANDLE hInstall) {
}
-UINT WINAPI BroadcastEnvironmentUpdate(MSIHANDLE hInstall) {
+extern "C" UINT WINAPI BroadcastEnvironmentUpdate(MSIHANDLE hInstall) {
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
@@ -77,7 +77,7 @@ UINT WINAPI BroadcastEnvironmentUpdate(MSIHANDLE hInstall) {
}
-BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason, VOID* dummy) {
+extern "C" BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason, VOID* dummy) {
switch (ulReason) {
case DLL_PROCESS_ATTACH:
WcaGlobalInitialize(hInst);
diff --git a/tools/msvs/msi/custom_actions.vcxproj b/tools/msvs/msi/custom_actions.vcxproj
index ae82905cd4b1f4..3716f07ff6de3d 100644
--- a/tools/msvs/msi/custom_actions.vcxproj
+++ b/tools/msvs/msi/custom_actions.vcxproj
@@ -169,7 +169,7 @@
-
+