Hi all, I created a small sample file that shows exactly my problem, pls see below. The problem can be easily duplicated by doing: 1) build the below sample into a project with version 1.0.0 2) build the same sample but with another version 1.0.1 3) run version 1.0.0 => the product will be installed 4) In C:\Program Files\MySmallProject add a dummy file: momo.txt 5) run the second version 101, which _updates_ the product
=> the momo.txt is gone!! But if in the code instead of: <RemoveExistingProducts After="InstallInitialize"/> you have: <RemoveExistingProducts After="InstallFinalize"/> by doing all the above steps the momo.txt is _not_ deleted during an update, only during a real uninstall (from add/remove programs), which is the _desired_ behavior. Is this maybe a bug in wix/msi? or am I doing something wrong? I have to have in the installer the: <RemoveExistingProducts After="InstallInitialize"/> so, can somebody point me out a way of doing this also when: <RemoveExistingProducts After="InstallInitialize"/>? Thank you, MeCoco The code: <?xml version="1.0" encoding="UTF-8"?> <?define UpgradeCode = "61608F07-C47C-459F-97DD-CD02D104294C"?> <?define CurrentVersion = "1.0.0"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name="SmallProject" Language="1033" Version="$(var.CurrentVersion)" Manufacturer="SmallProject" UpgradeCode="$(var.UpgradeCode)"> <Package Id="*" InstallerVersion="200" Compressed="yes" /> <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" /> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLLOCATION" Name="MySmallProject"> <Component Id="mytest.txt" Guid="7CED77A9-597B-456A-BEF7-44C094800A06"> <File Id="mytest.txt" Source="mytest.txt" KeyPath="yes" /> </Component> <Component Id="removeFile" Guid="F82061CB-27F9-41F5-B5FE-2EDCA1F1A8F9"> <RemoveFile Id="remove" Name="momo.txt" On="uninstall"/> <Condition>(REMOVE=ALL) AND (NOT UPGRADINGPRODUCTCODE)</Condition> </Component> </Directory> </Directory> </Directory> <Feature Id="ProductFeature" Title="SmallProject" Level="1"> <ComponentRef Id="mytest.txt"/> <ComponentRef Id="removeFile"/> </Feature> <Upgrade Id="$(var.UpgradeCode)"> <UpgradeVersion OnlyDetect="no" Property="OLDAPPFOUND" Minimum="0.0.1" IncludeMinimum="yes" Maximum="$(var.CurrentVersion)" IncludeMaximum="no" /> <UpgradeVersion OnlyDetect="yes" Property="NEWAPPFOUND" Minimum="$(var.CurrentVersion)" IncludeMinimum="no" /> <UpgradeVersion OnlyDetect="yes" Property="SELFFOUND" Minimum="$(var.CurrentVersion)" IncludeMinimum="yes" Maximum="$(var.CurrentVersion)" IncludeMaximum="yes" /> </Upgrade> <CustomAction Id="NewerVersionDetected" Error="2000"/> <CustomAction Id="CurrentVersionDetected" Error="2001"/> <UI> <Error Id="2000">!(loc.Error2000)</Error> </UI> <UI> <Error Id="2001">!(loc.Error2001)</Error> </UI> <InstallExecuteSequence> <FindRelatedProducts Sequence="100" /> <AppSearch After="FindRelatedProducts"/> <LaunchConditions After="AppSearch" /> <Custom Action="NewerVersionDetected" After="AppSearch">NEWAPPFOUND</Custom> <Custom Action="CurrentVersionDetected" After="AppSearch">SELFFOUND</Custom> <RemoveExistingProducts After="InstallInitialize"/> <!--<RemoveExistingProducts After="InstallFinalize"/>--> </InstallExecuteSequence> <!-- Find previous installation directory --> <Property Id="INSTALLDIR"> <RegistrySearch Id="FindInstallLocation" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDAPPFOUND]" Name="InstallLocation" Type="raw" /> </Property> <CustomAction Id="SetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" /> <InstallExecuteSequence> <Custom Action="SetARPINSTALLLOCATION" After="InstallValidate">NOT Installed</Custom> </InstallExecuteSequence> </Product> </Wix> On 11/25/2010 12:41 PM, MeCoco wrote: > Hi all, > > I have to accomplish the following: when the product gets completelly > uninstalled (from add/remove programs, _not_ during an update) I need to > specifically delete 2 additional files. > > For that I have the following code: > > <Component Id="RemoveLogosFile" Guid="PUT_MY_GUID"> > <RemoveFile Id="RemoveLogosFile" Name="MyLogo.jpg" On="uninstall"/> > <RemoveFile Id="RemoveBundleFile" Name="bundle" On="uninstall"/> > <Condition>(NOT UPGRADINGPRODUCTCODE) AND (REMOVE=ALL)</Condition> > </Component> > > The above code works as expected _if_: > <RemoveExistingProducts After="InstallFinalize"/> > > meaning the 2 files are deleted _only_ during an uninstall from > add/remove programs and they _don't_ get deleted during an update. > > But in my installer I have: > <RemoveExistingProducts After="InstallInitialize"/> > > and the behavior in this case is that the 2 files are _always_ deleted > regardless if it's an update or removal from add/remove programs. > > Can somebody help me accomplish the deletion of those files only when > uninstalling from add/remove programs and not during an update, when having > <RemoveExistingProducts After="InstallInitialize"/>? > > Thank you, > MeCoco > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App& Earn a Chance To Win $500! > Tap into the largest installed PC base& get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users