scrouchman
Posts: 12
Joined: Fri Aug 07, 2009 1:42 pm

Standard Function Call

Currently, our installer does a force reboot every time to ensure a reboot occurs should we ever update a driver we use. I am trying to find a way round this but nothing I try seems to work.
I attempted the attached action route that gets passed an MSIHANDLE however we need admin rights to install the driver and running in deferred prevents me from updating the REBOOT property.
I am now playing with calling a standard function in the hope that can be run as deferred but still update the property, however while I can get it to call the function I cannot get the passing of parameters in or out to work.

What I would like is an example of how to call a standard function as the document is severely lacking, and confirmation that this route is actually going to work.
Currently my function is defined as:

std::wstring __stdcall DeferredInstallDrivers(std::wstring szProperty)
{
MessageBox(NULL, szProperty.c_str(), L"livedrive.com", MB_OK);
return L"Force";
}

And the custom data passed to CallStdFcn is:

[&setuplib.dll]?S;REBOOT;S;DeferredInstallDrivers;B;S;I;This is a test?

Where setuplib.dll is a temporary file
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Standard Function Call

Hi,

Please note that it doesn't matter what type of custom action you are using. A deferred action cannot set installer properties.

A solution would be to use two custom actions:
1. An immediate one which detects if the driver needs to be updated. This action can set the REBOOT property.
2. A deferred action which actually installs the driver. This one can be conditioned with a custom property set by the first action.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
scrouchman
Posts: 12
Joined: Fri Aug 07, 2009 1:42 pm

Re: Standard Function Call

Thanks for the response. I am trying this method and can get my function called, however whenever I try and call MsiGetProperty I get ERROR_ACCESS_DENIED and I can't seem to find anything that would cause this. Is there a part in the install sequence where this method wont work?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Standard Function Call

Hello,

To find out how to get installer public properties in a deferred custom action, please read the Action Data reference from the General Properties section of the following article:
http://www.advancedinstaller.com/user-g ... rties.html

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”