Because properties and directory paths share the same namespace, and if you 
don't want/need to allow any arbitrary path to be used, you can simplify that 
code even further:

     <Directory Id="TARGETDIR" Name="SourceDir">
       <Directory Id="WindowsVolume" >
         <Directory Id="TopDir" Name="TopDir">
           <Directory Id="SecondDir" Name="SecondDir" />
         </Directory>
              </Directory>
     </Directory> 
 
If you really need the ability to set the installation path, then you would 
change this to:

     <Directory Id="TARGETDIR" Name="SourceDir">
       <Directory Id="WindowsVolume" >
         <Directory Id="INSTALLDIR" Name="TopDir">
           <Directory Id="SecondDir" Name="SecondDir" />
         </Directory>
              </Directory>
     </Directory> 
 
and you eliminate the unneeded SetDirectory custom action.
 
> From: bwhee...@dshs.wa.gov
> To: wix-users@lists.sourceforge.net
> Date: Thu, 10 Oct 2013 21:12:06 +0000
> Subject: Re: [WiX-users] Wix MSI not uninstalling files when  package 
> uninstalled
> 
> After fighting the default OS locations I finally convinced others around 
> here that going with what the OS wants for directory structure is much 
> simpler to do and more stable and takes fewer steps of code. 
> 
> I have a suggestion that may help and is more stable than a custom action.
> Set a property that is whatyou want for the root of your folder structure.  
> In this example I use the Set WINDOWSVOLUME = [WindowsVolume] - it's always 
> available and it is usually C:
> 
> 
>    <!-- WINDOWSVOLUME is the root above the Windows folder.  This forces the 
> install out of PrograFiles-->
> 
>     <SetDirectory Id="WINDOWSVOLUME" Value="[WindowsVolume]"/>
> 
>     <Directory Id="TARGETDIR" Name="SourceDir">
>       <Directory Id="WINDOWSVOLUME" >
>         <Directory Id="TopDir" Name="TopDir">
>           <Directory Id="SecondDir" Name="SecondDir" />
>         </Directory>
>       </Directory>
>     </Directory>      
> 
> 
> 
> -----Original Message-----
> From: Walter Dexter [mailto:wfdex...@gmail.com] 
> Sent: Thursday, October 10, 2013 1:53 PM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Wix MSI not uninstalling files when package 
> uninstalled
> 
> Moving the custom actions for setting the C Drive to be After CostFinalized 
> resolved the problem. WiX threw an error when I tried before CostInitialize.
> 
> Thanks!
> 
> 
> On Thu, Oct 10, 2013 at 2:20 PM, Walter Dexter <wfdex...@gmail.com> wrote:
> 
> > I just tested by copying the installed files to where the log say 
> > C_DRIVE would be prior to the redefine (in my case, e:\cdrive) and 
> > then ran the uninstall.
> >
> > The installed files were deleted from e:\... rather than c:\... 
> > proving this theory.
> >
> > Looks like I need to change when the custom action triggers. I'll try 
> > before CostInitialize and see what happens since you like it.
> >
> > I'm very new to both MSI and WiX. (I'm really good at Inno Setup but 
> > our corporate standard says make MSIs. It also says to use WISE which 
> > is even more confusing than WiX for me and my developer brain.)
> >
> > Thanks a lot!
> >
> >
> > On Thu, Oct 10, 2013 at 1:33 PM, Edwin Castro <0ptikgh...@gmx.us> wrote:
> >
> >> On 10/10/13 11:08 AM, Walter Dexter wrote:
> >> > I had a similar thought about an hour ago while driving about 
> >> > c_drive
> >> not
> >> > getting redefined properly for the uninstall and will try to 
> >> > validate if that's the problem later this afternoon. I do see it 
> >> > and all the directories getting property changed to the right path 
> >> > prior to the FileRemove entries in the uninstall log, though.
> >>
> >> I think your CA_SetCDrive custom action is scheduled too late. I 
> >> thought directories needed to be set prior to CostInitialize.
> >>
> >> --
> >> Edwin Castro
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> --------- October Webinars: Code for Performance Free Intel webinars 
> >> can help you accelerate application performance.
> >> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the 
> >> most from the latest Intel processors and coprocessors. See abstracts 
> >> and register >
> >>
> >> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.
> >> clktrk _______________________________________________
> >> WiX-users mailing list
> >> WiX-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/wix-users
> >>
> >
> >
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
> the latest Intel processors and coprocessors. See abstracts and register > 
> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
> 
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
                                          
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to