Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8454999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:10:23+00:00 2026-06-10T12:10:23+00:00

I have a C++ Custom Action Project. I have two functions, RegProductName and GetProductName

  • 0

I have a C++ Custom Action Project. I have two functions, RegProductName and GetProductName.

I call RegProductName and it has three possible outcomes. I have these in an if statement that if it is outcome 1 or outcome 2 then i call my second function GetProductName but i can’t seem to get it working. Can anyone give me an example of calling one function from another please?

extern "C" UINT __stdcall RegProductName(MSIHANDLE hInstall)
{
AssertSz(FALSE, "debug here");
DebugBreak();

HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
char szProductName[MAX_PATH];


hr = WcaInitialize(hInstall, "RegProductName");
ExitOnFailure(hr, "Failed to initialize");

WcaLog(LOGMSG_STANDARD, "Initialized.");

strcpy(szProductName, Orc_Get_Product_Name());

if(szProductName == "ORCHESTRATOR")
{
    GetProductName();
} 
else if (szProductName == "CORAL")
{
    GetProductName();
}
else 
{
    MsiSetProperty(hInstall, "PRODUCTNAME",  szProductName);
}


LExit:
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
return WcaFinalize(er);
}

The error is “Too few arguments in function call when i hover over GetProductName();

extern "C" UINT __stdcall GetProductName(MSIHANDLE hInstall)
{

HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
DWORD Ret;
CHAR *Section = "General";
CHAR szBuffer[MAX_PATH];
CHAR szProductIniFile[MAX_PATH];
char lpszString[MAX_PATH];
int lplValue;


hr = WcaInitialize(hInstall, "GetProductName");
ExitOnFailure(hr, "Failed to initialize");

WcaLog(LOGMSG_STANDARD, "Initialized.");

TCHAR* szValueBuf = NULL;
DWORD cchValueBuf = 0;
UINT uiStat =  MsiGetProperty(hInstall, TEXT("TEMPFOLDER"), TEXT(""), &cchValueBuf);

if (ERROR_MORE_DATA == uiStat)
{
    ++cchValueBuf; 
    szValueBuf = new TCHAR[cchValueBuf];
    if (szValueBuf)
    {
        uiStat = MsiGetProperty(hInstall, TEXT("TEMPFOLDER"), szValueBuf, &cchValueBuf);
    }
}
if (ERROR_SUCCESS != uiStat)
{
    if (szValueBuf != NULL) 
        delete[] szValueBuf;
    return ERROR_INSTALL_FAILURE;
}

strcpy(szProductIniFile,szValueBuf);

Ret = strlen(szProductIniFile);
if(szProductIniFile[Ret-1] != '\\')
   strcat(szProductIniFile,"\\");

strcat(szProductIniFile, "Product.ini");

Ret = GetPrivateProfileString(Section,          // Section Title [General]
                              "PRODUCT_NAME",   // Entry
                              "Orchestrator",   // Default Value
                              szBuffer,         // Address of buffer to read to
                              MAX_PATH,         // Length of buffer
                              szProductIniFile); // .ini file name


if (strlen(szBuffer) == 0)
    strcpy(szBuffer, "ORCHESTRATOR");

if (strlen(szBuffer) >= 3 && (stricmp(szBuffer+strlen(szBuffer)-3,"DEM") == 0))
    lplValue = 1;
else
    lplValue = 0;


MsiSetProperty(hInstall, "PRODUCTNAME",  szBuffer);

LExit:
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
return WcaFinalize(er);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:10:25+00:00Added an answer on June 10, 2026 at 12:10 pm

    Your GetProductName() function takes an argument MSIHANDLE hInstall. You’ll need to provide that when calling it. For instance, if you just want to call it with the same handle as RegProductName() was called with:

    GetProductName(hInstall);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an install project which has a custom action that executes a VBScript
Projects have many tasks and a task has a custom RESTful action called 'approve'.
I have one custom action (add) and two custom objects (favorites list) and (tv
I have two custom ActionFilters on an action. In first of the actionfilters, I
I have an install project (running on Windows 7) that launches a custom action
I have a setup project in which I have a custom action that is
I have created a c++ custom action for a setup-project application in VS Team
I have a Windows installer project which includes a custom action. This custom action
In WIX project I have an custom action that works on SQL server with
I have sevevral custom actions as part of an MSI project, defined in vS2008.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.