Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy can I drive InstallShield with Win32::GuiTest on XP but not Windows 7?
    text
    copied!<p>I'm trying to use Win32::GuiTest to test an InstallShield-based uninstall process. I can open the Control Panel, find the application, and invoke InstallShield but nothing I do seems to let me pick the Remove button in the installer. So far, I've got:</p> <pre><code>sub uninstall($;$) { my ($name, $force) = @_; if (! defined($force)) { $force=0; } my @windows; # Control Panel window my $cpwin; my $w; my $text; # Install Shield window my $iswin; # Run the Control Panel (In windir, do `control appwiz.cpl`) system("cd %windir% &amp;&amp; control appwiz.cpl"); sleep 1; print("Opened control panel\n"); # Get the Window ID of the control panel # FIXME - this label is system specifie (W7) @windows = FindWindowLike(undef, "Programs and Features", ""); $cpwin = $windows[0]; printf("Found CP window ID %x\n", $cpwin); # Get the Folder View window of the control panel # Find the list of applications @windows = FindWindowLike($cpwin, "FolderView"); $w = $windows[0]; # Find program in the list if (Win32::GuiTest::SelListViewItemText($w, $name) == 0) { printf("Could not find '$name'.\n"); return -1; } # Invoke the installer for by pressing [Return] Win32::GuiTest::SendKeys("~"); # Wait for the "initializing the wizard" window @windows = Win32::GuiTest::WaitWindow("InstallShield Wizard", 5); # Wait for the real installer window sleep 10; @windows = Win32::GuiTest::WaitWindow("InstallShield Wizard", 3); $iswin = $windows[0]; # Win32::GuiTest::WaitWindow("Remove"); printf("Found IS window ID %x\n", $iswin); # Win32::GuiTest::SetFocus($iswin); @windows = FindWindowLike($iswin, "&amp;Remove", "Button"); my $remove = $windows[0]; printf("Found remove button %x\n", $remove); Win32::GuiTest::PushButton($remove); # Win32::GuiTest::SetFocus($remove); # Win32::GuiTest::SendKeys("%r"); # Win32::GuiTest::MouseClick("Remove",$iswin); # Win32::GuiTest::CheckButton($remove); # Win32::GuiTest::SendKeys("{DOWN}{DOWN}"); # Win32::GuiTest::MouseClick("Next",$iswin); # Win32::GuiTest::PushChildButton($iswin, "Cancel"); </code></pre> <p>None of the things I've tried (commented out, at the end) seem to have any effect. </p> <p>I'm using ActivePerl and Win32::GuiTest on Windows 7 if any of that matters.</p> <p>(Be kind. My Perl probably sucks. I have >25 years experience programming but less than a month in Perl.)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload