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

Setting a property (MsiSetProperty)


2 replies to this topic

Cygnusx1

Cygnusx1
  • Members
  • 29 posts

Posted 18 June 2001 - 14:55

I am trying to retrieve a registry entry value and set that value to a property.  By using MessageBoxes I can see the value I want to set and then use MsiSetProperty; but if I use MsiGet Property the property is blank.  Should I use the CustumActionData method to set the value?  If so, what are the full steps on how to create it?

Here is my script:
#include "isrt.h"
#include "iswi.h"
   export prototype Get_Reg_Val(HWND);  
function Get_Reg_Val(hMSI)  
STRING svClass, svProp;
NUMBER nRootKey, nSize, nvType, nBuffer;
begin            
nRootKey = HKEY_LOCAL_MACHINE;
nBuffer = 255;
RegDBSetDefaultRoot (nRootKey);
RegDBGetKeyValueEx ("Software", "MyVal", nvType, svClass, nSize);
MsiSetProperty(hMSI,"MYVAL", svClass);
MessageBox(svClass, INFORMATION);
MsiGetProperty(hMSI,"MYVAL",svProp,nBuffer);  
MessageBox(svProp, INFORMATION);
end;

Thank You


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 18 June 2001 - 21:34

You can't set a property in a deferred execution custom action. You have to use an immediate CA instead.

Cygnusx1

Cygnusx1
  • Members
  • 29 posts

Posted 19 June 2001 - 16:09

How do I retrieve a registry entry and assign that value to a variable?  In deferred mode?