找回密码
 加入
搜索
楼主: pdp320921

[GUI管理] ListView中checkbox的选择与执行其功能?

  [复制链接]
 楼主| 发表于 2011-3-29 14:26:26 | 显示全部楼层
本帖最后由 pdp320921 于 2011-3-29 14:38 编辑

回复 15# netegg

是我没描述清楚?
上述代码已经实现对选中checkbox选中后点击卸载按钮卸载程序
我想在Run(_GUICtrlListView_GetItemText($Lv,$i,2))后根据弹出的窗口来判断去自动完成卸载~
我有监视几个程序的卸载,如何添加到Run(_GUICtrlListView_GetItemText($Lv,$i,2))后才能正常执行???
 ;DisplayName Skype Toolbars
 ;DisplayVersion 1.0.4051
;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{981029E0-7FC9-4CF3-AB39-6F133621921A}
;UninstallString REG_SZ MsiExec.exe /I{981029E0-7FC9-4CF3-AB39-6F133621921A}
If WinWaitActive("Skype Toolbars Setup","") Then
 Send("!n")
WinWaitActive("Skype Toolbars Setup","Removes Skype Toolbars")
Send("!r")
WinWaitActive("Skype Toolbars Setup","Ready to remove Skype Toolbar")
Send("!r")
WinWaitActive("Skype Toolbars Setup","Completed the Skype Toolbars Setup Wizard")
 Send("{ENTER}")
 EndIf        
                                                
If  WinWaitActive("Norton Internet Security 2011","") Then
Opt("MouseCoordMode", 0)  
;Run("C:\Program Files\NortonInstaller\{0C55C096-0F1D-4F28-AAA2-85EF591126E7}\NIS\A5E82D02\18.5.0.125\InstStub.exe /X /ARP")
 ;WinWaitActive("Norton Internet Security 2011","")
MouseClick("",381,328)
WinWaitActive("Norton Internet Security 2011","")
MouseClick("",397,363)
WinWaitActive("Norton Internet Security 2011","")
 MouseClick("",82,416)
EndIf        
                                                   
 ;DisplayName Microsoft SQL Server 2005 Compact Edition [ENU]
;DisplayVersion 3.1.0000
;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F0B430D1-B6AA-473D-9B06-AA3DD01FD0B8}
;UninstallString REG_SZ MsiExec.exe /I{F0B430D1-B6AA-473D-9B06-AA3DD01FD0B8}
;Run("MsiExec.exe /I{F0B430D1-B6AA-473D-9B06-AA3DD01FD0B8}")
If  WinWaitActive("Microsoft SQL Server 2005 Compact Edition [ENU]","remove Microsoft SQL Server") Then                        
Send("!n")
WinWaitActive("Microsoft SQL Server 2005 Compact Edition [ENU]","Remove Microsoft SQL Server Compact Edition from your computer")
Send("!r")
Send("!n")
WinWaitActive("Microsoft SQL Server 2005 Compact Edition [ENU]","If you want to review")
 Send("!r")
Send("!f")
EndIf        
                                                        
;DisplayName Adobe Flash Player 10 ActiveX
;DisplayVersion 10.1.85.3
;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player ActiveX
 ;UninstallString REG_SZ C:\windows\system32\Macromed\Flash\FlashUtil10k_ActiveX.exe -maintain activex
 ;Run("C:\windows\system32\Macromed\Flash\FlashUtil10k_ActiveX.exe -maintain activex")
  If  WinWaitActive("Uninstall Adobe Flash Player","This program will remove") Then
  ControlClick("Uninstall Adobe Flash Player","",102)
        Sleep(2000)
WinWaitActive("Uninstall Adobe Flash Player","")
 ControlClick("Uninstall Adobe Flash Player","",102)
EndIf        
                
;DisplayName WildTangent Games
  ;DisplayVersion 1.0.1.3
   ;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WildTangent toshiba Master Uninstall
    ;UninstallString REG_SZ "C:\Program Files\TOSHIBA Games\Uninstall.exe"
   ;Run("C:\Program Files\TOSHIBA Games\Uninstall.exe")
If WinWaitActive("Remove WildTangent Games","") Then
;Sleep(300)
 Opt("MouseCoordMode", 2)
MouseClick("",106,216)
Send("{TAB}{SPACE}")
Send("{TAB}{SPACE}")
Send("{TAB}{SPACE}")
 Send("{TAB}{SPACE}")
 Send("{TAB}{SPACE}")
Send("{TAB}{SPACE}")
 Send("{TAB}{SPACE}")
Send("{TAB}{SPACE}")
Send("{TAB}{SPACE}")
Send("{TAB}{SPACE}")
Send("{TAB}{SPACE}")
Send("{TAB}{SPACE}")
MouseClick("",490,426)
WinWaitActive("WildTangent Games Uninstall","Are you sure you want to remove")
 Send("{ENTER}")
;WinWaitActive("Remove WildTangent Games","Click")
  Sleep(60000)
MouseClick("",493,429)
EndIf        
;DisplayName Amazon Kindle For PC v1.1
;DisplayVersion 15.4.3502.0922
 ;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Amazon Kindle For PC
;UninstallString REG_SZ C:\Program Files\Amazon\Kindle For PC\uninstall.exe
;Run("C:\Program Files\Amazon\Kindle For PC\uninstall.exe")
   If  WinWaitActive("Uninstall Amazon Kindle For PC ","Uninstalling from") Then
Send("!u")
WinWaitActive("Uninstall Amazon Kindle For PC ","All software components have been removed")
ControlClick("Uninstall Amazon Kindle For PC ","Take me to Manage",1203)
 Send("!f")
EndIf        
;DisplayName Windows Live Essentials
 ;DisplayVersion 15.4.3502.0922
 ;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinLiveSuite
 ;UninstallString REG_SZ C:\Program Files\Windows Live\Installer\wlarp.exe
  ;Run("C:\Program Files\Windows Live\Installer\wlarp.exe")
If WinWaitActive("Windows Live Essentials 2011","Uninstall or repair Windows Live programs") Then
Send("{SPACE}")
WinWaitActive("Windows Live Essentials 2011","What do you want to uninstall")
 Send("{SPACE}")
 Send("{RIGHT}")
 Send("{SPACE}")
 Send("{DOWN}")
 Send("{SPACE}")
Send("{LEFT}" )
 Send("{SPACE}")
 Send("{DOWN}" )
Send("{SPACE}")
Send("!u")
 WinWaitActive("Windows Live Essentials 2011","Done")
 Send("!c")
EndIf
发表于 2011-3-29 16:03:05 | 显示全部楼层
回复 16# pdp320921
那就加呗,又不影响原来的函数过程
 楼主| 发表于 2011-3-29 17:01:04 | 显示全部楼层
回复 17# netegg
加了这么多的if条件判断,却无法实现自动化,程序仍然停留在Run(_GUICtrlListView_GetItemText($Lv,$i,2)),不会去判断执行,问题就在Run(_GUICtrlListView_GetItemText($Lv,$i,2))与if之间的连接~~~
发表于 2011-3-29 18:26:54 | 显示全部楼层
回复 18# pdp320921
你把代码整理下,我看不明白
 楼主| 发表于 2011-3-30 10:25:25 | 显示全部楼层
回复 19# netegg

在Run(_GUICtrlListView_GetItemText($Lv, $i, 2))後面插入一个函数传入要卸载的程序名
AutoUninstall(_GUICtrlListView_GetItemText($Lv, $i, 1))
Func AutoUninstall($Name)
        Switch $Name
                Case "Skype Toolbars"
                        If WinWaitActive("Skype Toolbars Setup","") Then
                                Send("!n")
                                WinWaitActive("Skype Toolbars Setup","Removes Skype Toolbars")
                                Send("!r")
                                WinWaitActive("Skype Toolbars Setup","Ready to remove Skype Toolbar")
                                Send("!r")
                                WinWaitActive("Skype Toolbars Setup","Completed the Skype Toolbars Setup Wizard")
                                Send("{ENTER}")
                        EndIf 
                Case "Microsoft SQL Server 2005 Compact Edition [ENU]"
                        ;.  以下省略
                        ;.
                        ;.
        EndSwitch
EndFunc
基本可以解决了,不过程序运行时会同时打开多个卸载窗口我把Run(_GUICtrlListView_GetItemText($Lv, $i, 2))换成
Runwait(_GUICtrlListView_GetItemText($Lv, $i, 2))后程序停留在卸载窗口不能继续下一步(自动卸载的脚本代码没问题),
不知如何解决??
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-15 10:13 , Processed in 0.077154 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表