Forum Discussion

bravemen's avatar
bravemen
New Contributor
6 years ago
Solved

how to verify my program was uninstalled successfully

this is my first post to this community, please let me know if more information is needed.   i am trying to determine whether a program has been uninstalled successfully from Windows 8.1.  below ...
  • bravemen's avatar
    6 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();
        }

    }