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

Accessing all Properties in a CA


4 replies to this topic

sijmen

sijmen
  • Members
  • 9 posts

Posted 27 November 2002 - 07:47

Hi,

I have a C/C++ custom action.  Within the action, I would like to know what all the properties and thier values are, including those that may have be set during runtime, and not just those in the Property table.

Does anyone know how I can do this.  A code sample would be greatly appreciated.

Regards,
Sijmen.

larzo

larzo
  • Members
  • 12 posts

Posted 27 November 2002 - 09:46

Hi,

See
http://www.codeproje....asp?print=true

HTH

sijmen

sijmen
  • Members
  • 9 posts

Posted 28 November 2002 - 04:42

Larzo,

Although the link you specified, pointed to an interesting artical, it did not address my problem.  None the less, thank you for your reply.

If you do happen to find a solution to my problem, please feel free to send it to me.

Regards,
Sijmen.

taffit

taffit
  • Members
  • 5 posts

Posted 20 December 2002 - 15:34

Create a property, create a CustomAction with the same name the property has, with type 51 and set the property with this CustomAction to the formatted string you want. You can set the property e.g. to Property1---Property2.
Now you can see all of the set properties within your script with the help of the session.property of the session-object.

luke_s

luke_s
  • Full Members
  • 532 posts

Posted 09 January 2003 - 22:25

I read something about this a while ago but I cannot remeber the exact location.. :(

But what it did do was use a C/C++ custom action to some of the MSI api functions to access the msi database. It then queried one of the temporary tables which contained all of the properties.

Something like

msih = MsiGetActiveDatabase(ihnd);

/* MsiDatabaseOpenView(msih, "SELECT * FROM _Tables", &hView); */
MsiDatabaseOpenView(msih, "SELECT * FROM #TEMP0003", &hView);

MsiViewExecute(hView, 0);

while (MsiViewFetch(hView, &hRec) == ERROR_SUCCESS)
{
iRecCount = MsiRecordGetFieldCount(hRec);
for (iCurRec = 1; iCurRec <= iRecCount; iCurRec++)
{
TCHAR szValue[1001];
DWORD dwSize = 1000;

MsiRecordGetString(hRec,iCurRec, szValue, &dwSize);
fprintf(fp,"Value is [%s]\n",szValue);

}
}
fprintf(fp,"end\n");
fclose(fp);

MsiCloseHandle(msih);
MsiCloseHandle(hRec);


There are other tables, like #TEMP0003 as well...