Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

CA 1 OR CA 17 - Pls Help


2 replies to this topic

colby

colby
  • Full Members
  • 37 posts

Posted 26 February 2003 - 23:56

I am attempting to call a test DLL created by someone at my company (see source at end of email).  The MS Visual C++ project creates 'MyTest.DLL' and 'MyTest.LIB' when compiled.  In my basic IS Dev project, I have tried calling the DLL from the binary table (immediate execution after CostFinalize and deferred execution after InstallFinalize) as well as "installed with the product" (immediate execution after FileTransfer and deferred execution after InstallFinalize).  I am not getting any type of error message during the install.  The test dll is supposed to display a message box showing the value of the retrieved property.

Any ideas here?  Is it my installer or the DLL itself (code below)?



MyTest.DLL source:

#include <windows.h>
#include <msiquery.h>

UINT __stdcall My_TestCA(MSIHANDLE hInstall)
{
   TCHAR* szValueBuf = NULL;
   DWORD cchValueBuf = 0;
   UINT uiStat =  MsiGetProperty(hInstall, TEXT("MY_TEST_PROPERTY"), TEXT(""), &cchValueBuf);
   if (ERROR_MORE_DATA == uiStat)
   {
       ++cchValueBuf; // on output does not include terminating null, so add 1
       szValueBuf = new TCHAR[cchValueBuf];
       if (szValueBuf)
       {
           uiStat = MsiGetProperty(hInstall, TEXT("MY_TEST_PROPERTY"), szValueBuf, &cchValueBuf);
       }
   }
   if (ERROR_SUCCESS != uiStat)
   {
MessageBox(GetForegroundWindow( ),
           TEXT("There was an error"),
           TEXT("Value of MY_TEST_PROPERTY"), MB_OK | MB_ICONINFORMATION);
       return ERROR_INSTALL_FAILURE;
   }

   MessageBox(GetForegroundWindow( ),
           szValueBuf,
           TEXT("Value of MY_TEST_PROPERTY"), MB_OK | MB_ICONINFORMATION);


   delete [] szValueBuf;

   return ERROR_SUCCESS;
}

colby

colby
  • Full Members
  • 37 posts

Posted 28 February 2003 - 00:07

Turns out there's nothing wrong!  The test machine being used had some type of configuration problem.  It works on other systems without any modification.

Thanks.

ijahman

ijahman
  • Members
  • 15 posts

Posted 06 March 2003 - 14:53

Is the property SecureCustomProperty filled?