tags:

views:

992

answers:

1

What I would like to do is this:

<Property Id="LICENSEKEYPATH">
      REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE
      <DirectorySearch Id="ProgramDataSearch" AssignToProperty="yes" Depth="4" Path="[#ProductDirInAppData]">
        <FileSearch Id="LicenseFileSearch" Name="lic-conf.enp"/>
      </DirectorySearch>
</Property>

When my application is being uninstalled, only then, do I want to search for the license file and get its path. Currently, although the code doesnt give any errors, it still searches for the license file path even when I am installing the file. Because of this, the setup gets delayed by a long time. And more importantly, the wix setup displays in the first screen to the effect that its searching for this property and then it continues with the other screens.

So, how do I search for a file or set the value of a property only during uninstallation?

+1  A: 

You can control the setting of a property using the SetProperty element. That is just a shortcut for registering a custom action. You can control when the SetProperty executes using a Conditoin in the text element.

As for AppSearch (XxxSearch elements), you can add a condition like the one above to the AppSearch element so that it only runs during uninstall. Note that the conditioning the AppSearch element will affect all XxxSearch elements. So if you need to have a search working during install and another search only during uninstall, that is not possible.

PS: The condition you want will look something like:

Installed AND REMOVE="ALL"

Rob Mensching

related questions