I just need a little reassurance here. I am creating a basic C# program that, among other things, will uninstall and reinstall the most current version of a program (I can't build this functionality into the program itself). The way I am doing it is by:
MsiExec.exe /X{[UninstallString]} /passive
in a command prompt process. I have a couple of questions:
Basically I just want to know if this is safe. If not, or if there is a better way to do this programatically, let me know! Thanks!
See "To uninstall a product"; you can specify a ProductCode, which is globally unique by definition. So you won't uninstall any other product. You can also specify the msi filename, but you have to be more carefull, as it can happen that different products get the same filename. So using the ProductCode is the best way to do this.
See also What are Upgrade, Product and Package Codes used for?