I think I've cracked it. <Property Id='UNINSTALL_EXE64'> <RegistrySearch Id='LocateUninstallExe64' Type='file' Root='HKLM' Key='SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{413B7644-1F93-4890-BD40-AC540C29935B}_is1' Name='QuietUninstallString' /> </Property> <Property Id='UNINSTALL_EXE32'> <RegistrySearch Id='LocateUninstallExe32' Type='file' Root='HKLM' Key='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{413B7644-1F93-4890-BD40-AC540C29935B}_is1' Name='QuietUninstallString' /> </Property>
<Media Id="1" Cabinet="ss.cab" EmbedCab="yes" /> <!-- Custom Actions --> <CustomAction Id="ca.RemovePreviousVersion64" ExeCommand="[UNINSTALL_EXE64]" Return="check" /> <CustomAction Id="ca.RemovePreviousVersion32" ExeCommand="[UNINSTALL_EXE32]" Return="check" /> <!-- Installer Sequencing --> <InstallExecuteSequence> <Custom Action="ca.RemovePreviousVersion64" Before="InstallFiles">VERSIONNT64</Custom> <Custom Action="ca.RemovePreviousVersion32" Before="InstallFiles">VERSIONNT</Custom> </InstallExecuteSequence> On 10/03/2011 22:23, Sean Farrow wrote: > Hi: > On a 32-bit version of windows, your key would look like: > "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{413B7644-1F93-4890-BD40-AC540C29935B}_is1" > I don't tend to use SilentUninstallString in these situations as this stil > shows user interface--at least the cancel button if I remember correctly and > it may even give the user the option to uninstall! I'd rather use > "QuietUninstallString" as this shows nothing. > To get these two custom actions to work you need to search the registry based > on a condition--I'd use VERSIONNT64/VERSIONNT. > Then have two custom actions in your InstallExecute sequence, one that > executes if your running 32-bit windows and the other if your running 64-bit. > Looking at the old code I ran the uninstall just before InstallFiles. > > If you need any further help let me know but hopefully this should be enough > to get you going! > Cheers > Sean. > > -----Original Message----- > From: Jammer [mailto:jam...@jammer.biz] > Sent: 10 March 2011 20:43 > To: wix-users@lists.sourceforge.net > Subject: [WiX-users] Uninstall Previous Inno Setup Installed App > > Hi All, > > I've just rewritten my installer using WiX 3.5. However, before I > distribute the new MSI I'm dotting all the i and crossing the t's this > time! The problem is that I need to make sure the previous .exe setup > is removed before installing the new msi version. > > So, i've been looking at various ways to locate the unins000.exe file > (UninstallString) and execute it. If possible I'd like to search the > registry and use the info in there but I can't think of a way to use the > <RegistrySearch> element and be sure it's found, if there. > > When I look at my dev machine registry the key would look like this: > > "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{413B7644-1F93-4890-BD40-AC540C29935B}_is1" > > How would this work on a 32bit XP machine for instance? What key value > can I possibly use to catch all flavours of OS? I've seen the Win64 > property but I can only find my keys in one place on my dev machine so > if I said no to this it wouldn't find it on my dev box ... confused! > > All the script I have for this at the moment is: > > <Property Id='UNINSTALL_EXE'> > <RegistrySearch Id='LocateUninstallExe' Type='file' Root='HKLM' > Key='SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{413B7644-1F93-4890-BD40-AC540C29935B}_is1' > Name='UninstallString' Win64='??' /> > </Property> > <Property Id='UNINSTALL_CMD' Value='/SILENT'/> > > <InstallExecuteSequence> > <Custom Action="ca.RemovePreviousVersion" Before="InstallInitialize" /> > </InstallExecuteSequence> > > <CustomAction Id="ca.RemovePreviousVersion" Property="UNINSTALL_EXE" > ExeCommand="UNINSTALL_CMD" /> > > Any pointers on this would be much appreciated. > > Thanks, > > Jammer > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users