AutoIt script for DAEMON Tools Lite 4.30.3 (x86 or x64)
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.0.0
Author: myName
DAEMON Tools Lite 4.30.3 with SPTD 1.56 x86 & x64
Application site: [url="http://www.daemon-tools.cc/dtcc/announcements.php"]http://www.daemon-tools.cc/dtcc/announcements.php[/url]
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
Opt("TrayIconDebug", 1)
; Intaller file name
$Installer = "daemon4303-lite.exe"
; Automount
$Automount = 1
; Check for updates monthly
$Checkforupdatesmonthly = 0
; Disable DAEMON Tools Panel
$DTPanel = 0
; Add uninstall entri to Control Panel->Add or Remove Programs
$UninstallEntri = 1
; DAEMON Tools Lite title in Control Panel->Add or Remove Programs
$DTLTitle = "DAEMON Tools Lite 4.30.3"
; Keeps the Start Menu folder
$StartMenuFolder = 1
; Create a new icon in Start Menu (set this variable = 1 only if you chosen to delete the folder created by installer in
; Start Menu folder (above) and you really need it; otherwise let it be = 0)
$NewStartMenuIcon = 0
; Keeps the Desktop icon
$DesktopIcon = 1
; Program language (Arabic = 1025; Bulgarian = 1026; Catalan = 1027; Chinese Simplified = 2052; Chinese Traditional = 1028;
; Croatian = 1050; Czech = 1029; Danish = 1030; Dutch = 1043; English = 1033; Finnish = 1035; French = 1036; Georgian = 1079;
; German = 1031; Greek = 1032; Hebrew = 1037; Hungarian = 1038; Italian = 1040; Japanese = 1041; Korean = 1042; Latvian = 1062;
; Lithuanian = 1063; Norwegian = 1044; Polish = 1045; Portuguese = 1044; ROMANIAN = 1048; Russian = 1049; Serbian = 2074;
; Slovak = 1051; Slovenian = 1060; Spanish = 3082; Swedish = 1053; Turkish = 1055; Ukrainian = 1058)
$ProgramLanguage = 1033
; Run DAEMON Tools Lite after installation is done (useful if you want to install arniWORX)
$RunDAEMONToolsLite = 1
; Run Daemon Tools for All Users (on Windows startup)
$Autostart = 0
If @OSArch = "X86" Then
; Installation folder
$InstallDir = @ProgramFilesDir & "\DAEMON Tools Lite"; Do not edit this variable!
If FileExists($InstallDir & "\daemon.exe") Then
MsgBox(0x40010, @ScriptName, "Please uninstall previous version of DAEMON Tools Lite before using this script", 4)
Exit
EndIf
; Start checking for DAEMON Tools Lite Toolbar, Internet Explorer and New Connection Wizard processes
AdlibEnable('_Adlib')
; Set installation language (to avoid window pop-up at the begining of installation)
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\View", "Language", "REG_DWORD", 1033)
; Save the default internet browser (to restore it after the installation of DAEMON Tools Lite)
$DefaultHttpBrowser = RegRead("HKCR\http\shell\open\command\", "")
$DefaultHttpsBrowser = RegRead("HKCR\https\shell\open\command\", "")
; Make Internet Explorer the default Internet browser (to deal only with this browser later)
RegWrite("HKCR\http\shell\open\command", "", "REG_SZ", '"' & @ProgramFilesDir & "\Internet Explorer\iexplore.exe" & '" -nohome')
RegWrite("HKCR\https\shell\open\command", "", "REG_SZ", '"' & @ProgramFilesDir & "\Internet Explorer\iexplore.exe" & '" -nohome')
; Save the home page of Internet Explorer (to restore it after the installation of DAEMON Tools Lite)
$IEHomePage = RegRead("HKCU\Software\Microsoft\Internet Explorer\Main", "Start Page")
; Save the default search engine of IE7 or IE8 (to restore it after the installation of DAEMON Tools Lite)
; Check if Internet Explorer version is 7 or higher
$IEVersion = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe")
$IEVersion = StringLeft($IEVersion, 1)
If $IEVersion >= 7 Then
$IE7orIE8DefaultSearchEngine = RegRead("HKCU\Software\Microsoft\Internet Explorer\SearchScopes", "DefaultScope")
EndIf
; Save .mds file association (to restore it after the installation of DAEMON Tools Lite)
$mdsfileassociation = RegRead("HKCR\.mds", "")
; Run the installer
Run($Installer & " /S")
; Wait to finish installation
ProcessWaitClose($Installer)
Sleep(1000)
; Restore the default internet browser
RegWrite("HKCR\http\shell\open\command\", "", "REG_SZ", $DefaultHttpBrowser)
RegWrite("HKCR\https\shell\open\command\", "", "REG_SZ", $DefaultHttpsBrowser)
; Restore the home page of Internet Explorer
RegDelete("HKCU\Software\Microsoft\Internet Explorer\Main", "Start Page")
RegWrite("HKCU\Software\Microsoft\Internet Explorer\Main", "Start Page", "REG_SZ", $IEHomePage)
; Restore the default search engine of IE7 or IE8
If $IEVersion >= 7 Then
RegDelete("HKCU\Software\Microsoft\Internet Explorer\SearchScopes\{AD22EBAF-0D18-4fc7-90CC-5EA0ABBE9EB9}")
RegWrite("HKCU\Software\Microsoft\Internet Explorer\SearchScopes", "DefaultScope", "REG_SZ", $IE7orIE8DefaultSearchEngine)
EndIf
; Restore .mds file association
RegDelete("HKCR\.mds", "")
RegWrite("HKCR\.mds", "", "REG_SZ", $mdsfileassociation)
; Settings
If $Automount = 1 Then
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\Config", "Automount", "REG_DWORD", 1)
EndIf
If $Checkforupdatesmonthly = 0 Then
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\Config", "CheckForUpdate", "REG_DWORD", 0)
EndIf
If $DTPanel = 0 Then
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\Options", "PanelIncluded", "REG_DWORD", 0)
EndIf
; Delete the Start Menu folder
If $StartMenuFolder = 0 Then
DirRemove(@StartMenuCommonDir & "\Programs\DAEMON Tools Lite", 1)
EndIf
; Create a new icon in Start Menu
If $NewStartMenuIcon = 1 Then
FileCreateShortcut($InstallDir & "\daemon.exe", @StartMenuCommonDir & "\Programs\DAEMON Tools Lite.lnk", $InstallDir)
EndIf
; Delete the Desktop icon
If $DesktopIcon = 0 Then
FileDelete(@DesktopCommonDir & "\DAEMON Tools Lite.lnk")
EndIf
; Add uninstall entri to Control Panel->Add or Remove Programs
If $UninstallEntri = 1 Then
RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "DisplayName", "REG_SZ", $DTLTitle)
RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "UninstallString", "REG_SZ", $InstallDir & "\uninst.exe")
RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "InstallLocation", "REG_SZ", $InstallDir)
RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "DisplayIcon", "REG_SZ", $InstallDir & "\daemon.exe")
EndIf
; Delete DAEMON Tools Toolbar
FileDelete($InstallDir & "\DAEMON Tools Toolbar.exe")
; Set the program language
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\View", "Language", "REG_DWORD", $ProgramLanguage)
; Run DAEMON Tools Lite
If $RunDAEMONToolsLite = 1 Then
If $Autostart = 0 Then
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\Config", "Autostart", "REG_DWORD", 0)
RegDelete("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", "DAEMON Tools Lite")
Run($InstallDir & "\daemon.exe")
WinWait("Updating virtual devices", "Updating virtual devices")
WinWaitClose("Updating virtual devices", "Updating virtual devices")
ElseIf $Autostart = 1 Then
Run($InstallDir & "\daemon.exe -autorun")
WinWait("Updating virtual devices", "Updating virtual devices")
WinWaitClose("Updating virtual devices", "Updating virtual devices")
EndIf
ElseIf $RunDAEMONToolsLite = 0 Then
If $Autostart = 0 Then
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\Config", "Autostart", "REG_DWORD", 0)
RegDelete("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", "DAEMON Tools Lite")
EndIf
EndIf
Sleep(1000)
; Close DAEMON Tools Lite process
$PID = ProcessExists("daemon.exe")
If $PID Then
ProcessClose($PID)
EndIf
; Remove obsolete registry keys
RegDelete("HKLM\SOFTWARE\19659239224e364682fa4baf72c53ea4")
RegDelete("HKLM\SOFTWARE\DT Soft")
; Stop checking for DAEMON Tools Lite Toolbar, Internet Explorer and New Connection Wizard processes
AdlibDisable()
EndIf
If @OSArch = "X64" Then
; Installation folder
$InstallDir = @HomeDrive & "\Program Files (x86)\DAEMON Tools Lite"; Do not edit this variable!
If FileExists($InstallDir & "\daemon.exe") Then
MsgBox(0x40010, @ScriptName, "Please uninstall previous version of DAEMON Tools Lite before using this script", 4)
Exit
EndIf
; Start checking for DAEMON Tools Lite Toolbar, Internet Explorer and New Connection Wizard processes
AdlibEnable('_Adlib')
; Set installation language (to avoid window pop-up at the begining of installation)
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\View", "Language", "REG_DWORD", 1033)
; Save the default internet browser (to restore it after the installation of DAEMON Tools Lite)
$DefaultHttpBrowser = RegRead("HKCR\http\shell\open\command\", "")
$DefaultHttpsBrowser = RegRead("HKCR\https\shell\open\command\", "")
; Make Internet Explorer the default Internet browser (to deal only with this browser later)
RegWrite("HKCR\http\shell\open\command", "", "REG_SZ", '"' & @HomeDrive & "\Program Files (x86)\Internet Explorer\iexplore.exe" & '" -nohome')
; Save the home page of Internet Explorer (to restore it after the installation of DAEMON Tools Lite)
$IEHomePage = RegRead("HKCU\Software\Microsoft\Internet Explorer\Main", "Start Page")
; Save the default search engine of IE7 or IE8 (to restore it after the installation of DAEMON Tools Lite)
; Check if Internet Explorer version is 7 or higher
$IEVersion = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe")
$IEVersion = StringLeft($IEVersion, 1)
If $IEVersion >= 7 Then
$IE7orIE8DefaultSearchEngine = RegRead("HKCU\Software\Microsoft\Internet Explorer\SearchScopes", "DefaultScope")
EndIf
; Save .mds file association (to restore it after the installation of DAEMON Tools Lite)
$mdsfileassociation = RegRead("HKCR\.mds", "")
; Run the installer
Run($Installer & " /S")
; Wait to finish installation
ProcessWaitClose($Installer)
Sleep(1000)
; Restore the default internet browser
RegWrite("HKCR\http\shell\open\command\", "", "REG_SZ", $DefaultHttpBrowser)
RegWrite("HKCR\https\shell\open\command\", "", "REG_SZ", $DefaultHttpsBrowser)
; Restore the home page of Internet Explorer
RegDelete("HKCU\Software\Microsoft\Internet Explorer\Main", "Start Page")
RegWrite("HKCU\Software\Microsoft\Internet Explorer\Main", "Start Page", "REG_SZ", $IEHomePage)
; Restore the default search engine of IE7 or IE8
If $IEVersion >= 7 Then
RegDelete("HKCU\Software\Microsoft\Internet Explorer\SearchScopes\{AD22EBAF-0D18-4fc7-90CC-5EA0ABBE9EB9}")
RegWrite("HKCU\Software\Microsoft\Internet Explorer\SearchScopes", "DefaultScope", "REG_SZ", $IE7orIE8DefaultSearchEngine)
EndIf
; Restore .mds file association
RegDelete("HKCR\.mds", "")
RegWrite("HKCR\.mds", "", "REG_SZ", $mdsfileassociation)
; Settings
If $Automount = 1 Then
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\Config", "Automount", "REG_DWORD", 1)
EndIf
If $Checkforupdatesmonthly = 0 Then
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\Config", "CheckForUpdate", "REG_DWORD", 0)
EndIf
If $DTPanel = 0 Then
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\Options", "PanelIncluded", "REG_DWORD", 0)
EndIf
; Delete the Start Menu folder
If $StartMenuFolder = 0 Then
DirRemove(@StartMenuCommonDir & "\Programs\DAEMON Tools Lite", 1)
EndIf
; Create a new icon in Start Menu
If $NewStartMenuIcon = 1 Then
FileCreateShortcut($InstallDir & "\daemon.exe", @StartMenuCommonDir & "\Programs\DAEMON Tools Lite.lnk", $InstallDir)
EndIf
; Delete the Desktop icon
If $DesktopIcon = 0 Then
FileDelete(@DesktopCommonDir & "\DAEMON Tools Lite.lnk")
EndIf
; Add uninstall entri to Control Panel->Add or Remove Programs
If $UninstallEntri = 1 Then
RegWrite("HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "DisplayName", "REG_SZ", $DTLTitle)
RegWrite("HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "UninstallString", "REG_SZ", $InstallDir & "\uninst.exe")
RegWrite("HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "InstallLocation", "REG_SZ", $InstallDir)
RegWrite("HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "DisplayIcon", "REG_SZ", $InstallDir & "\daemon.exe")
EndIf
; Delete DAEMON Tools Toolbar
FileDelete($InstallDir & "\DAEMON Tools Toolbar.exe")
; Set the program language
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\View", "Language", "REG_DWORD", $ProgramLanguage)
; Run DAEMON Tools Lite
If $RunDAEMONToolsLite = 1 Then
If $Autostart = 0 Then
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\Config", "Autostart", "REG_DWORD", 0)
RegDelete("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", "DAEMON Tools Lite")
Run($InstallDir & "\daemon.exe")
WinWait("Updating virtual devices", "Updating virtual devices")
WinWaitClose("Updating virtual devices", "Updating virtual devices")
ElseIf $Autostart = 1 Then
Run($InstallDir & "\daemon.exe -autorun")
WinWait("Updating virtual devices", "Updating virtual devices")
WinWaitClose("Updating virtual devices", "Updating virtual devices")
EndIf
ElseIf $RunDAEMONToolsLite = 0 Then
If $Autostart = 0 Then
RegWrite("HKCU\Software\DT Soft\DAEMON Tools Lite\Config", "Autostart", "REG_DWORD", 0)
RegDelete("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", "DAEMON Tools Lite")
EndIf
EndIf
Sleep(1000)
; Close DAEMON Tools Lite process
$PID = ProcessExists("daemon.exe")
If $PID Then
ProcessClose($PID)
EndIf
; Remove obsolete registry keys
Run(@ComSpec & " /c " & 'REG DELETE "HKLM\SOFTWARE\Wow6432Node\19659239224e364682fa4baf72c53ea4" /f', "", @SW_HIDE)
Run(@ComSpec & " /c " & 'REG DELETE "HKLM\SOFTWARE\Wow6432Node\DT Soft" /f', "", @SW_HIDE)
; Stop checking for DAEMON Tools Lite Toolbar, Internet Explorer and New Connection Wizard processes
AdlibDisable()
EndIf
Func _Adlib()
; Close Internet Explorer process
$PID = ProcessExists("iexplore.exe")
If $PID Then
ProcessClose($PID)
EndIf
; Close New Connection Wizard process (if was started)
$PID = ProcessExists("icwconn1.exe")
If $PID Then
ProcessClose($PID)
EndIf
; Kill Daemon Tools Lite toolbar installation process
$PID = ProcessExists("DAEMON Tools Toolbar.exe")
If $PID Then
ProcessClose($PID)
EndIf
EndFunc
Func OnAutoItStart()
; One script instance only
If WinExists(@ScriptName & '_Interpreter') Then Exit
AutoItWinSetTitle(@ScriptName & '_Interpreter')
EndFunc
This post has been edited by radix: 07 February 2009 - 04:19 AM