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

Get the property through the installscript


3 replies to this topic

Hemamalini

Hemamalini
  • Members
  • 22 posts

Posted 10 January 2002 - 09:48

I'm new to Installshield- windows installer.How to get the INSTALLDIR path in the installscript file.I have tried with MsiGetProperty method.But i'm unable to get it.Do I have todo any setting for this.


Kurt Schneider

Kurt Schneider
  • Members
  • 98 posts

Posted 10 January 2002 - 17:22

In case you haven't seen this already here is an exerpt from the Help File:

// Include header file for built-in functions
#include "isrt.h"
// Include header file for MSI API functions and constants
#include "iswi.h"              

export prototype Func1(HWND);  

function Func1(hMSI)
   STRING svName;
   NUMBER nvSize, nResponse;
begin
   // Retrieve the user's name from the MSI database
   nvSize = 256;
   MsiGetProperty (hMSI, "USERNAME", svName, nvSize);
   
   nResponse = AskYesNo ("Your name will be registered as " +
                        svName + ". Is this correct?", YES);
           
   if nResponse = NO then
       AskText ("Enter the name that will be registered for " +
                "this product.", svName, svName);
       MsiSetProperty(hMSI, "USERNAME", svName);
   endif;
end;


I have used variations of this in InstallScript to get and set properties successfully.

Good Luck

Kurt Schneider


Hemamalini

Hemamalini
  • Members
  • 22 posts

Posted 11 January 2002 - 04:33

Thank you Schneider.But i'm not able to get the property for CA in derferred execution.The code works fine for Immediate execution.

Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 11 January 2002 - 10:31

There are only a few properties available during deferred custom actions.  One of these is "CustomActionData".  This is a special property that returns the contents of a property with the same name as the custom action called.  

So use an immediate action (Type 51 is useful) to set a suitably name property to a property or a list of properties that you can parse.  You will then be able to access your data.