You're in the right area with that code. I do something similar for a
plug-in installer using the following:

    <DirectoryRef Id="CommonAppDataFolder">
      <Directory Id="A_Directory" Name="A_Directory">
        <Component Id="A_Component" DiskId="1" Guid="A-GUID">
          <RemoveFile Id="Clean_A_Directory" Name="*" On="both"/>
          <RemoveFolder Id="Remove_A_Directory" On="both"/>
        </Component>
        <Directory Id="Another_Directory" Name="Another_Directory">
          <Component Id="Another_Component" DiskId="1"
Guid="ANOTHER-GUID">
            <RemoveFile Id="Clean_Another_Directory" Name="*"
On="both"/>
            <RemoveFolder Id="Remove_Another_Directory" On="both"/>
          </Component>
        </Directory>
      </Directory>
    </DirectoryRef>

You may find it easier to build the Directory tree under AppDataFolder
first then inserting your Components with RemoveFile & RemoveFolder
Elements. The RemoveFile Elements with Name="*" will empty the directory
of files so it can be deleted by the RemoveFolder Element (RemoveFolder
only removes empty directories). If you only want the directories to be
deleted on install change the On="both" attributes to On="install" in
the RemoveFile & RemoveFolder Elements (On="both" deletes them on
install & uninstall).

Also AppDataFolder is the user-specific Roaming folder
(C:\Users\user.name\AppData\Roaming\ on Vista & later). To access
C:\ProgramData\ you need to use CommonAppDataFolder

Palbinder Sandher 
Software Deployment & IT Administrator
T: +44 (0) 141 945 8500 
F: +44 (0) 141 945 8501 

http://www.iesve.com 
**Design, Simulate + Innovate with the <Virtual Environment>**
Integrated Environmental Solutions Limited. Registered in Scotland No.
SC151456 
Registered Office - Helix Building, West Of Scotland Science Park,
Glasgow G20 0SP
Email Disclaimer

-----Original Message-----
From: William Newbery [mailto:firelan...@hotmail.co.uk] 
Sent: 30 March 2010 19:49
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Cleaning up directories other than the program
directory


My application keeps various files in the common app data directory
(C:\ProgramData\MyApp\ on Vista), and the users local and roaming
application directories. These are created by the application it's self
if they don't exist (Where applicable files are also created from
defaults in the main program directory, e.g. the settings.cfg file).

I want to make my installer be able to remove these directories on
install, however I'm not sure how to go about doing this.

I tried simply adding the following to my wxs file in the TARGETDIR
directory in the hope the installer would create, and thus delete it and
any contents on install/uninstall. However I got some error about a
"RemoveFile" table, I'm not even sure what this has to do with any file
table...

            <Directory Id='AppDataFolder'>
                <Directory Id='MyAppDataFolder' Name='MyApp'>
                    
                </Directory>
            </Directory>

Is this along the right lines and I just need to work out what this
table thing is going on about, or am I going about this completely the
wrong way?
                                          
_________________________________________________________________
Send us your Hotmail stories and be featured in our newsletter
http://clk.atdmt.com/UKM/go/195013117/direct/01/
------------------------------------------------------------------------
------
Download Intel&#174; Parallel Studio Eval Try the new software tools for
yourself. Speed compiling, find bugs proactively, and fine-tune
applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to