how to verify my program was uninstalled successfully
- 7 years ago
so, i figured out a different way to test this. instead of looking for a child object, i decided to look directly at the objects properties. interestingly, saw this in the Remarks section of WaitProperty method:
"The
WaitProperty
method does not support indexed properties (that is, properties that require parameters). "so there must be something unusual with having indexed properties. so right after that line, they give an example of a while loop to use instead of the WaitProperty. so i did that (with a for loop) and got what i needed. here is the new code:
var XT300_uninstalled = false;
var folderViewObj = Aliases.explorer.wndCabinetWClass.ShellTabWindowClass.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.ShellView.FolderView;
// waitproperty method doesn't support indexed properties like the wItem on the folderview object. so need
// to check the property using for loop. wait up to 5 seconds for XT 300 application to be uninstalled
for( var i=0; i<5; i++ ) {
if( aqString.Compare( folderViewObj.wItem(2, 0), "XT 300", true ) != 0 ) {
XT300_uninstalled = true;
break;
} else {
Delay( 1000 );
folderViewObj.Refresh();
}}