You may have to give more clarity on what exactly is happening. I can't picture any uninstall process that would revert when you stop the script.
What NoUse4aName is suggesting is the typical solution. If for some reason stopping the script is causing an issue, why not just manually do the uninstall, and wait for whatever visual clue tells you it's done (a popup, or a Done or Finish button that becomes active). Record at at that point. You could put an exist on the object (if it only appears at the end), or use a waitproperty if the object exists but one of the properties changes (like the enabled property).
i am using the uninstall using msiexec/s with product code /qb. it grabs the product code from datatable and I am writing it to batch file to execute the uninstall process. once the batch file gets executed the uninstall process will show a window with progress of uninstall.