Question

Is it possible to pass some properties value at the time of uninstalling WIX setup.

In my wix setup i want to uninstall a particular files that depends on property values. But at the time of uninstall setup that files not deleted because of property check condition. Is there any way to achieve this?

Was it helpful?

Solution 3

I don't think a condition will leave your file behind on uninstall - as far as I know component conditions are for installation, not uninstallation. Or are you trying to delete files with a conditioned custom action, and it fails to run?

OTHER TIPS

That's an odd question - you may need to explain what you're doing exactly. If you are uninstalling the product then you are uninstalling all the files in the product. If you want to install a file but maybe leave it behind at uninstall then you cannot install it in the usual way with a component id. You'd need to give it a null id so it is unmanaged by Windows Installer. Then you must uninstall it with a custom action if you want it removed. So the general answer is to install it with a null component id and then run an uninstall custom action that knows whether to actually remove the file or not.

It's usually considered a bug if an uninstall eaves files behind. If you want to leave a file behind because it's being shared with another product or app then all of the above is irrelevant because if you use the same component id the sharing just works automatically, just in case that's what you're doing.

Windows Installer was specifically designed to not have a UI during uninstall. Agree or not, that was the goal. They just wanted ARP to have a Remove button and away it goes nice and easy no questions asked.

An alternative would be to disable the Remove button and only leave the Change button. Then author some UI in your maintenance experience to ask the user if they want to remove the files or not and then go with that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top