cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
davide77
Level 5

how to access at this function?

I want to call the following function from my msi installscript call OnBegin...
how can I do it?
how can I get hMSI value?
Thank u in advance,
Davide

// 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;
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

That function signature is intended for an InstallScript custom action in a Basic MSI project; you should be able to call that code directly from OnBegin in an InstallScript MSI project, using ISMSI_HANDLE anywhere an MSI API function needs an MSI handle.
0 Kudos
davide77
Level 5

Perfect..thank u so much
Davide
0 Kudos