开发者

Skip installation of certian custom action based on condition

I'm completely new to Windows Installer, so please be gentle!

I want some drivers to be installed when my customers installs my program. If the drivers already is installed, however, I want the installation program to skip that certain step and continue with installing my program.

I have tried adding a Windows Installer launch conditi开发者_如何学运维on, which searches for a certain component Id. When I'm trying to install, though, the error message shows up and the installation program exits - nothing is installed. It doesn't matter if the driver is installed or not - I get the same result.

Any clues?

Thanks in advance!


A launch condition stops the installation if the condition is not met. This is not a solution for what you need.

You can try detecting if the driver is installed by using a search: http://msdn.microsoft.com/en-us/library/aa367579(VS.85).aspx

You can also use an immediate custom action which performs this search and sets an installer property based on the search result. This custom action requires custom code written by you. It can be a Win32 DLL:

http://msdn.microsoft.com/en-us/library/aa368338(VS.85).aspx

http://msdn.microsoft.com/en-us/library/aa367457(VS.85).aspx

http://www.advancedinstaller.com/user-guide/serial-number-validation-dll.html (a sample C++ DLL)

or a VBScript: http://msdn.microsoft.com/en-us/library/sx7b3k7y(VS.85).aspx

This way you can use the custom property to condition your custom action. For example, if the property is empty, the driver needs to be installed. So your custom action can use the condition:

NOT MY_CUSTOM_PROPERTY

where "MY_CUSTOM_PROPERTY" is the property you set based on a search.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜