NDog37 Posted January 26, 2009 Posted January 26, 2009 This is an autoit script that will install Daemon Tools 4.30.3 and configure the optionsIt will asign the virtual CD as x:It works and I have tested it on multiple PC's including Virtual Machines, however it is not 100% reliable as far as setting the drive options, since it uses a system tray click, so if you have lots of tray item popups while running it - it might not work so well.-daemon4303-lite.exe must be in the same folder as you are running the script-reboots computer after installing SPTD-I recommend to compile it to exe as it reboots and continues runningThis is setup using my prefered options as defaults, change it how you need.Opt("TrayIconDebug", 1)opt("WinTitleMatchMode",4)$g_szVersion = "NDog_WPIW"If WinExists($g_szVersion) Then Exit; It's already runningAutoItWinSetTitle($g_szVersion)HotKeySet("{ESC}", "MyExit")Func MyExit() ExitEndFunc#requireadmin#include <GuiConstantsEx.au3>#Include <GuiToolBar.au3>$type = "CD"$exe = "daemon4303-lite.exe"$titlepre = "nul"$title = "DAEMON Tools Lite 4.30.3"$processname = $exe;#csRegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "dtools", "REG_SZ", """" & @ScriptFullPath & """")If Not ProcessExists($processname) Then Run(@ScriptDir & "\" & $exe)EndIfLocal $Done = FalseWhile Not $Done If WinExists($titlepre) Then WinActivate($titlepre) WinWaitActive($titlepre, "", 5) ElseIf WinExists($title, "Please select a language.") Then ;ControlSend($title, "", "Button1","{ENTER}") ControlClick($title, "", "Button1") ElseIf WinExists($title, "Welcome to the DAEMON Tools Lite") Then ;ControlSend($title, "", "Button2","{ENTER}") ControlClick($title, "", "Button2") ElseIf WinExists($title, "License Agreement") Then ;ControlSend($title, "", "Button2","{ENTER}") ControlClick($title, "License Agreement", "Button2") While WinExists($title, "License Agreement") If WinExists($title, "Setup must restart Windows and continue installation after reboot") Then ControlClick($title, "Setup must restart Windows and continue installation after reboot", "Button2") RegDelete("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", $title & " Setup") Sleep(500) Shutdown(2); Computer will restart EndIf WEnd ElseIf WinExists($title, "Choose Components") Then ControlSend($title, "", "SysTreeView321","{DOWN}") ControlSend($title, "", "SysTreeView321","{DOWN}") ControlSend($title, "", "SysTreeView321","{SPACE}");Untick DAEMON Tools Toolbar ControlSend($title, "", "SysTreeView321","{DOWN}") ControlSend($title, "", "SysTreeView321","{SPACE}");Untick Desktop Shortcut ControlSend($title, "", "SysTreeView321","{DOWN}") ControlSend($title, "", "SysTreeView321","{SPACE}");Untick Start Menu Shortcuts ;ControlSend($title, "", "Button2","{ENTER}") ControlClick($title, "", "Button2") ElseIf WinExists($title, "Support the DAEMON Tools Team") Then ControlClick($title, "", "Button4") ;ControlSend($title, "", "Button2","{ENTER}") ControlClick($title, "", "Button2") ElseIf WinExists($title, "Choose Install Location") Then ;ControlSend($title, "", "Button2","{ENTER}") ControlClick($title, "", "Button2") ElseIf WinExists($title, "Completing the DAEMON Tools Lite Setup Wizard") Then ;ControlSend($title, "", "Button2","{ENTER}") ControlClick($title, "", "Button2") RegDelete("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "dtools") $Done = True ElseIf WinExists($title, "Already Installed") Then ;ControlClick($title, "", "Button3") ControlClick($title, "Already Installed", "Button3") While WinExists($title, "Already Installed") If WinExists($title, "Are you sure you want to quit Setup?") Then Sleep(5000) ;ControlSend($title, "", "Button1","{ENTER}") ControlClick($title, "Are you sure you want to quit Setup?", "Button1") EndIf WEnd RegDelete("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "dtools") Exit Else Sleep(500) ContinueLoop EndIfWEndWhile ProcessExists($processname) If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") EndIf If ProcessExists("firefox.exe") Then ProcessClose("firefox.exe") EndIf If ProcessExists("opera.exe") Then ProcessClose("opera.exe") EndIfWEndFileDelete(@DesktopCommonDir & "\DAEMON Tools Lite.lnk")DirRemove(@StartMenuCommonDir & "\Programs\DAEMON Tools Lite",1)#ceWhile Not IsDeclared ("BtnNum");Configure Daemon Tools (system tray) $hToolBar = WinGetHandle("[CLASS:Shell_TrayWnd]", "") $hSysTray = ControlGetHandle($hToolBar, "", "ToolbarWindow321") $BtnCnt = _GUICtrlToolbar_ButtonCount($hSysTray) $BtnTxt = "DAEMON Tools";Search for the right icon on the tray $i = 0 While $i < $BtnCnt ;MsgBox(2,"",StringLeft(_GUICtrlToolbar_GetButtonText($hSysTray, $i),12)) If StringLeft(_GUICtrlToolbar_GetButtonText($hSysTray, $i),12) = $BtnTxt Then $BtnNum = $i ExitLoop EndIf $i += 1 WEnd Sleep(500)WEnd$title = "Preferences"Local $Done = FalseWhile Not $Done If WinExists($title, "Autostart tray icon") Then ControlFocus($title, "", "Button31") ControlClick($title, "", "Button31") ControlClick($title, "", "Button33") ControlSend($title,"","ListBox1","{END}{UP 4}") Sleep(1000) ElseIf WinExists($title, "Enable DT Panel") Then ControlClick($title, "", "Button24") ControlSend ($title,"","ListBox1","{END}{UP 2}") Sleep(1000) ElseIf WinExists($title, "Mount on the first empty device") Then ControlClick($title, "", "Button4") ControlClick($title, "", "Button34") ControlClick($title, "", "Button35") Sleep(1000) ExitLoop Else _GUICtrlToolbar_ClickButton($hSysTray, $BtnNum, "right") WinWait("[CLASS:#32768]", "", 5) SendKeepActive("[LAST]") ControlSend("[LAST]", "", "", "{UP 5}{ENTER}") Sleep(1000) WinWaitClose("[CLASS:#32768]", "", 5) Sleep(1000) EndIfWEnd$dtconfig = "HKCU\Software\DT Soft\DAEMON Tools Lite\Config"RegWrite($dtconfig,"Autostart", "REG_DWORD", "1")RegWrite($dtconfig,"Automount", "REG_DWORD", "0")RegWrite($dtconfig,"CheckForUpdate", "REG_DWORD", "0")RegWrite($dtconfig,"EnableShellExtensions", "REG_DWORD", "0")RegWrite($dtconfig,"Integration_MountOnEmpty", "REG_DWORD", "1")$dtoptions="HKCU\Software\DT Soft\DAEMON Tools Lite\Options"RegWrite($dtoptions,"PanelIncluded", "REG_DWORD", "0")RegWrite($dtoptions,"PanelTopmost", "REG_DWORD", "0")RegWrite($dtoptions,"ShowPanelByDblClick", "REG_DWORD", "0")RegWrite($dtoptions,"PanelVisble", "REG_DWORD", "0")$dtclasses="HKLM\SOFTWARE\Classes\"RegWrite($dtclasses & ".b5t","","REG_SZ","DAEMON.Tools.Lite")RegWrite($dtclasses & ".b6t","","REG_SZ","DAEMON.Tools.Lite")RegWrite($dtclasses & ".bwt","","REG_SZ","DAEMON.Tools.Lite")RegWrite($dtclasses & ".ccd","","REG_SZ","DAEMON.Tools.Lite")RegWrite($dtclasses & ".cdi","","REG_SZ","DAEMON.Tools.Lite")RegWrite($dtclasses & ".cue","","REG_SZ","DAEMON.Tools.Lite")RegWrite($dtclasses & ".iso","","REG_SZ","DAEMON.Tools.Lite")RegWrite($dtclasses & ".isz","","REG_SZ","DAEMON.Tools.Lite")RegWrite($dtclasses & ".mds","","REG_SZ","DAEMON.Tools.Lite")RegWrite($dtclasses & ".nrg","","REG_SZ","DAEMON.Tools.Lite")RegWrite($dtclasses & ".pdi","","REG_SZ","DAEMON.Tools.Lite")Local $Done = FalseWhile Not $Done If WinExists("Device parameters") Then ControlClick("Device parameters", "", "Button5") ControlClick("Device parameters", "", "ComboBox1") ControlSend("[LAST]", "", "", "{END}{UP 2}{ENTER}") Sleep(100) ControlClick("Device parameters", "", "Button2") Sleep(1000) ExitLoop Else _GUICtrlToolbar_ClickButton($hSysTray, $BtnNum, "right") WinWait("[CLASS:#32768]", "", 5) SendKeepActive("[LAST]") ControlSend("[LAST]", "", "", "{UP 6}{RIGHT 2}{DOWN}{ENTER}") Sleep(1000) EndIfWEnd
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now