OK, so now my condition is "(!MyAppFeature=3) AND (&MyAppFeature<>3) AND (&MyAppFeature<>-1)". It works fine during install, uninstall, change or repair. But it doesn't seem to work during an upgrade (it's a major upgrade). I changed it to:
(!MyAppFeature=3) AND ((&MyAppFeature=2) OR UPGRADINGPRODUCTCODE) Basically what I mean is "if the feature is present, and it is being uninstalled or upgraded". But the action doesn't run. My guess is UPGRADINGPRODUCTCODE is not set yet, since the action is before InstallValidate. Is there another way to detect an upgrade before InstallValidate? Ivo Blair wrote: > &MyAppFeature is documented to be -1 when MyAppFeature will be left alone by > the installation transaction. > > From: http://msdn.microsoft.com/library/aa368012.aspx > > INSTALLSTATE_UNKNOWN -1 No action to be taken on the feature or component. > > -----Original Message----- > From: Ivo Beltchev [mailto:i...@roadrunner.com] > Sent: Saturday, June 26, 2010 2:23 PM > To: General discussion for Windows Installer XML toolset. > Subject: Re: [WiX-users] Problem with "Close App" condition > > Hmm... could be. > Is it possible that &MyAppFeature is not initialized yet because I'm > running before "InstallValidate"? I have to run before InstallValidate, > because I want to run before the Restart Manager pops up and asks to > close the app for me. > > What is the recommended way to debug such problems? Is there a tool that > can trace through the install process? > > Blair wrote: > >> If your feature won't be affected at all by the transaction (such as when >> removing a different feature) &MyAppFeature may very well be -1, which >> > would > >> make your condition be true. >> >> -----Original Message----- >> From: Ivo Beltchev [mailto:i...@roadrunner.com] >> Sent: Saturday, June 26, 2010 8:11 AM >> To: General discussion for Windows Installer XML toolset. >> Subject: [WiX-users] Problem with "Close App" condition >> >> Hi >> >> I have a custom action that closes my app when its feature is being >> uninstalled. Here's my code: >> >> <Custom Action="CloseMyApp" >> Before="InstallValidate"><![CDATA[(!MyAppFeature=3) AND >> (&MyAppFeature<>3)]]></Custom> >> >> For some reason the action gets triggered during "Repair" and also when >> ANOTHER feature is being uninstalled. Why is this happening? Doesn't my >> condition mean "if MyAppFeature is installed, and about to be >> > uninstalled"? > >> Thanks >> Ivo >> >> >> >> > ---------------------------------------------------------------------------- > >> -- >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> WiX-users mailing list >> WiX-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wix-users >> >> >> >> > ---------------------------------------------------------------------------- > -- > >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> WiX-users mailing list >> WiX-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wix-users >> >> >> > > ---------------------------------------------------------------------------- > -- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users