Hi all,

My apologies if this is already answered somewhere, but I couldn't find an 
answer. My question is:

How can I setup a Wix installer to NOT delete the application directory on 
uninstall (even when the directory was initially created by the Wix install)?

Some background:

Let's say we have a Wix installer that installs an app in "C:\Dir1\Dir2". Well, 
the general behavior seems to be this:

- If "Dir2" doesn't already exist when the install happens, it will obviously 
be created at install time (along with "Dir1" as well, if necessary).
- If the "C:\Dir1\Dir2" path already exists at install time, then obviously it 
doesn't need to be created, and Wix will just install the necessary files 
underneath the path.
- On uninstall, if Wix had to create the "Dir2" directory at install time, it 
will also remove the "Dir2" directory (unless there are other stray files 
there, of course).
- On uninstall, if Wix DID NOT create the "Dir2" directory at install time (the 
path already existed), then it seems that Wix WILL NOT remove the "Dir2" 
directory.

In summary, on uninstall Wix will remove whatever part of the directory tree it 
created at install time, assuming nothing else has placed other content there 
since the install. This behavior is very logical and makes sense. The problem 
comes in when you have a situation like this:

- Let's say that after installing the above example app, we set some custom 
NTFS permissions on the "C:\Dir1\Dir2" folder.
- Let's also say that when we installed the app, the "C:\Dir1\Dir2" path didn't 
exist, so the install created it.

The problem now is that when we go to re-install this app (upgrading to a newer 
version of the app), when the uninstall portion of the install runs, it will 
remove the "Dir2" directory, and then re-add it when it gets to the "install" 
part, losing the custom NTFS permissions that were set.

What can I do to ensure that "Dir2" NEVER gets deleted when installing an newer 
version of the app (whether or not Wix initially created the directory at 
install time) so that the NTFS permissions of the directory are preserved 
through upgrades?

If this is impossible, I guess a secondary question would be: How can I 
enumerate the NTFS permissions of the existing folder before the uninstall 
happens, and then re-apply those same permissions after the directory is 
re-created? (although I'd much opt for the first solution)


Any help is greatly appreciated.


Thank you.


Joe

------------------------------------------------------------------------------

_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to