Thanks Bob, I could use <Custom Action="RemoveImported" After="UnpublishFeatures"><![CDATA[!ROOTFEATURE=3 AND &ROOTFEATURE=2]]></Custom> <Custom Action="Import" After="InstallFinalize"><![CDATA[Not Installed OR (?CommonComponents=$CommonComponents)]]></Custom>
This will work because I don't have a change mode or any options to choose any features (there is only 1 feature and 1 component inside it). It is important to note that this code relies on the ROOTFEATURE feature to be there as well as a component called CommonComponents and that they are allways affected in the same way as the installer is ie: when install happens the CommponComponents component gets installed, and the same for uninstall and repair. It would have been better if I could tell what mode the installer is in whether it be install, uninstall or repair so that this code isn't tied to a specific feature or component. I am building deployment templates for visual studio, whereby a developer can select a custom Wix template from the projects list in VS. The developer can then add whatever components and features are required without worrying about changing any of the above code. Having said that you pointed me in a cleaner way of doing this: The custom action imports SSIS packages into MSDB (Sql Server 2005). It looks for all files in the installer that have a .dtsx extension and imports it or removes it based on whether its install or uninstall. I have removed the conditions from the wix file - the custom action code will run every time - but inside the custom action I now check the install status of the component that each file belongs to to check whether it should import or remove. That way we can implement a change mode as well and each component will be handled individually Bob Arnson-6 wrote: > > carlldev wrote: >> The above works as advertised for installing and uninstalling, but if I >> click repair, then the RemoveImported part is run as well, which it >> shouldn't do because of the InstallMode = "Repair" condition. >> >> So I played around with it and found that the InstallMode property is >> never >> set during the install. It is COMPLETELY useless! No combination of >> InstallMode = “Repair” or InstallMode = “Remove” works. >> > > There is no such standard property. > >> I looked around trying to find another property that may do the trick. >> The >> WixUI_InstallMode looked like it but it also is COMPLETELY useless! >> > > That's for WixUI to control UI branching; it isn't intended to be used > outside the UI. > > See "Examples of Conditional Statement Syntax" for how you should do it. > > -- > sig://boB > http://joyofsetup.com/ > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > -- View this message in context: http://www.nabble.com/InstallMode-Conditions-DON%27T-work%21-tp14487073p14524583.html Sent from the wix-users mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users