Jim Beveridge
Posts: 32
Joined: Wed May 10, 2006 10:54 pm

Conditional reboot after custom action

I have to install a device driver by calling a DLL in a custom action (I know it's the wrong way, but the vendor won't support it installing from an INF file...) If the driver files are in use, the function in their DLL returns a flag saying that a reboot is required. However, I can't figure out how to modify the custom action to force a reboot based on the return value of the function.

Any help appreciated.

Thanks,
Jim
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Re: Conditional reboot after custom action

Hi Jim,

You can set a property in your custom action (depending on the return of the Driver function) and use it to conditionally set a value for the REBOOT property (controls a system reboot).

Read more about REBOOT property here:
http://msdn.microsoft.com/en-us/library/aa371101.aspx

Let us know if you encounter any problem.

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
Jim Beveridge
Posts: 32
Joined: Wed May 10, 2006 10:54 pm

Re: Conditional reboot after custom action

Thanks Gigi, but I'm still missing part of the answer to the question - how do I evaluate the return value from a function in a DLL so I can set the REBOOT property?

If I create a custom action that calls a function in a DLL, I don't see any place to add script or code to evaluate the return value.
Jim Beveridge
Posts: 32
Joined: Wed May 10, 2006 10:54 pm

Re: Conditional reboot after custom action

Never mind, answered my own question:
http://www.wixwiki.com/index.php?title= ... Action_Dll

This article describes that the DLL function is given a single parameter of type MSIHANDLE, which the DLL can use to call MsiGetProperty and MsiSetProperty.

Return to “Common Problems”