11/7/2022 0 Comments Native access uninstall product![]() ![]() For example I have used this in an external I'm just repeating myself now, so I'm not sure how useful this, but MsiOpenProduct is intended for performing actioms on the installed product, but that does not include uninstalling for which there is a specific API. Thanks for helping make community forums a great place. We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. You could modify that command line to yours to get that done. #Native access uninstall product windowsYou could use the following way which calls the command line instead of calling windows installer api. #Native access uninstall product codeI guess that to answer those questions access to Windows Installer source code will be needed. Is it possible to call the remaining actions somehow? If so, how? I mean something like MsiFinalizeInstallAndDoAllNecessar圜leanup() or similar. What does MsiConfigureProductEx do that is not done by the above API calls? Only deleting those files or something more?Ģ. I seems like msiexec /x uses MsiConfigureProductEx. If I was debugging this and experimenting because I was curious, I'd do all those those things, and also run the same code in C++ to see if it's an issue that results from the managed code interface (especially if you are runningĪ debug build) or whether something else is going on, but if I wanted to get the uninstall done cleanly I'd just use the proper API. So maybe you can get that code to work, but since I can't see all the code or debug it, or check handles, or run tools to see who has got handles open to the MSI file (assuming that's what it is given the information available) the question is ![]() Is, by definition, going to open that cached database, and, as the docs say, it is used for functions that access the product database, not for uninstalling! Given the shortage of information suppliedĪnd in the absence of complete code for the problem, and a complete run through the code (NOT in debug mode that doesn't release all objects) a leaked handle is probably the only thing that would keep the MSI in use when compared to a normal uninstall. The fact that the cached MSI file is not removed is almost certainly a consequence of it still being in use. If there is something else you're doing (such as querying the MSI contents), you still don't need MsiOpenProduct.Īnd no, the one and only handle is NOT clearly released in this code. Why not not just use the correct API with the guid you already have? Your problem is a consequence of your preference when the reasonable thing to do is to useĪn API that actually gets the job done. ![]() To use a handle instead of a guid seems bizarre to me because you use the guid to get a handle. Your code already uses the ProductCode so the idea that you want Don't get me wrong either, but you need to be told that. So the question is what do I need to call additionally to get the behaviour of "msiexec /x" using Msi API?Īgain, the issue you're are having with the Windows Installer API is that you are using the wrong call to uninstall a product. MsiHelper.Check(NativeMethods.MsiOpenProduct("" the files are removed along with the registry key (TempPackages). I am calling this code: MsiSafeHandle package ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |