New script for DAEMON Tools Lite 4.12.4:
CODE
Opt("TrayIconDebug", 1)
; Executable file name
$EXECUTABLE = "daemon4124-lite.exe"
; Run Daemon Tools on Windows startup
$Autostart = "0"
; Automount
$Automount = "1"
; Window title
$title = "DAEMON Tools Lite 4.12.4"
; Detect the Operating System type (32 bit or 64 bit)
$OS = _OSBit()
If $OS = 32 Then
; Installation folder
$INSTALLLOCATION = @ProgramFilesDir & "\DAEMON Tools Lite"
If FileExists($INSTALLLOCATION & "\daemon.exe") Then
MsgBox(0x40010, @ScriptName, "Please uninstall previous version of DAEMON Tools Lite before using this script", 4)
Exit
EndIf
; Disable the default internet browser (to prevent daemon.exe to open it)
$DefBrowser = RegRead("HKCR\HTTP\shell\open\command\", "")
RegDelete("HKCR\HTTP\shell\open\command\", "")
; Read from registry which is the home page of Internet Explorer (to restore it after the installation of DAEMON Tools Lite)
$HomePage = RegRead("HKCU\Software\Microsoft\Internet Explorer\Main", "Start Page")
; Run the installer
Run($EXECUTABLE & " /S")
; Start checking for a window
AdlibEnable('_Adlib')
ProcessWaitClose($EXECUTABLE)
Sleep(1000)
; Close browsers processes
$PID = ProcessExists("firefox.exe")
If $PID Then
ProcessClose($PID)
EndIf
$PID = ProcessExists("IEXPLORE.EXE")
If $PID Then
ProcessClose($PID)
EndIf
$PID = ProcessExists("opera.exe")
If $PID Then
ProcessClose($PID)
EndIf
; Restore the default internet browser
RegWrite("HKCR\HTTP\shell\open\command\", "", "REG_SZ", $DefBrowser)
; Restore the home page of Internet Explorer
RegWrite("HKCU\Software\Microsoft\Internet Explorer\Main", "", "REG_SZ", $HomePage)
; Delete DAEMON Tools Toolbar folder and registry entries made during installation process
FileDelete($INSTALLLOCATION & "\DAEMON Tools Toolbar.exe")
DirRemove(@ProgramFilesDir & "\DAEMON Tools Toolbar", 1)
RegDelete("HKCR\CLSID\{32099AAC-C132-4136-9E9A-4E364A424E17}")
RegDelete("HKCR\CLSID\{32099AAC-C132-4136-9E9A-4E364A424E17}\InprocServer32")
RegDelete("HKCR\CLSID\{32099AAC-C132-4136-9E9A-4E364A424E17}\ProgID")
RegDelete("HKCR\CLSID\{32099AAC-C132-4136-9E9A-4E364A424E17}\Programmable")
RegDelete("HKCR\CLSID\{32099AAC-C132-4136-9E9A-4E364A424E17}\TypeLib")
RegDelete("HKCR\CLSID\{32099AAC-C132-4136-9E9A-4E364A424E17}\VersionIndependentProgID")
RegDelete("HKCR\DTToolbar.ToolBandObj")
RegDelete("HKCR\DTToolbar.ToolBandObj\CLSID")
RegDelete("HKCR\DTToolbar.ToolBandObj\CurVer")
RegDelete("HKCR\DTToolbar.ToolBandObj.1")
RegDelete("HKCR\DTToolbar.ToolBandObj.1\CLSID")
RegDelete("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mds")
RegDelete("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Toolbar")
; Automount
If $Automount = "1" Then
IniWrite(@AppDataDir & "\DAEMON Tools\daemontools.ini", "Global", "Automount", 1)
EndIf
; Block DAEMON Tools to run on Windows startup
If $Autostart = 0 Then
RegDelete("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "DAEMON Tools Lite")
EndIf
IniWrite(@AppDataDir & "\DAEMON Tools\daemontools.ini", "Global", "Autostart", 0)
; Add uninstall entries
RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "DisplayName", "REG_SZ", "DAEMON Tools Lite 4.12.4")
RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "UninstallString", "REG_SZ", $INSTALLLOCATION & "\uninst.exe")
RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "InstallLocation", "REG_SZ", $INSTALLLOCATION)
RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "DisplayIcon", "REG_SZ", $INSTALLLOCATION & "\daemon.exe")
; Stop checking for a window
AdlibDisable()
EndIf
If $OS = 64 Then
; Installation folder
$INSTALLLOCATION = @HomeDrive & "\Program Files (x86)\DAEMON Tools Lite"
If FileExists($INSTALLLOCATION & "\daemon.exe") Then
MsgBox(0x40010, @ScriptName, "Please uninstall previous version of DAEMON Tools before using this script", 4)
Exit
EndIf
; Disable the default internet browser (to prevent daemon.exe to open it)
$DefBrowser = RegRead("HKCR\HTTP\shell\open\command\", "")
RegDelete("HKCR\HTTP\shell\open\command\", "")
; Read from registry which is the home page of Internet Explorer (to restore it after the installation of DAEMON Tools Lite)
$HomePage = RegRead("HKCU\Software\Microsoft\Internet Explorer\Main", "Start Page")
; Run the installer
Run($EXECUTABLE & " /S")
; Start checking for a window
AdlibEnable('_Adlib')
ProcessWaitClose($EXECUTABLE)
Sleep(1000)
; Close browsers processes
$PID = ProcessExists("firefox.exe")
If $PID Then
ProcessClose($PID)
EndIf
$PID = ProcessExists("IEXPLORE.EXE")
If $PID Then
ProcessClose($PID)
EndIf
$PID = ProcessExists("opera.exe")
If $PID Then
ProcessClose($PID)
EndIf
; Restore the default internet browser
RegWrite("HKCR\HTTP\shell\open\command\", "", "REG_SZ", $DefBrowser)
; Restore the home page of Internet Explorer
RegWrite("HKCU\Software\Microsoft\Internet Explorer\Main", "", "REG_SZ", $HomePage)
; Delete DAEMON Tools Toolbar folder and registry entries made during installation process
FileDelete($INSTALLLOCATION & "\DAEMON Tools Toolbar.exe")
DirRemove(@HomeDrive & "\Program Files (x86)\DAEMON Tools Toolbar", 1)
RegDelete("HKCR\CLSID\{32099AAC-C132-4136-9E9A-4E364A424E17}")
RegDelete("HKCR\CLSID\{32099AAC-C132-4136-9E9A-4E364A424E17}\InprocServer32")
RegDelete("HKCR\CLSID\{32099AAC-C132-4136-9E9A-4E364A424E17}\ProgID")
RegDelete("HKCR\CLSID\{32099AAC-C132-4136-9E9A-4E364A424E17}\Programmable")
RegDelete("HKCR\CLSID\{32099AAC-C132-4136-9E9A-4E364A424E17}\TypeLib")
RegDelete("HKCR\CLSID\{32099AAC-C132-4136-9E9A-4E364A424E17}\VersionIndependentProgID")
RegDelete("HKCR\DTToolbar.ToolBandObj")
RegDelete("HKCR\DTToolbar.ToolBandObj\CLSID")
RegDelete("HKCR\DTToolbar.ToolBandObj\CurVer")
RegDelete("HKCR\DTToolbar.ToolBandObj.1")
RegDelete("HKCR\DTToolbar.ToolBandObj.1\CLSID")
RegDelete("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mds")
RegDelete("HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Toolbar")
; Automount
If $Automount = "1" Then
IniWrite(@AppDataDir & "\DAEMON Tools\daemontools.ini", "Global", "Automount", 1)
EndIf
; Block DAEMON Tools to run on Windows startup
If $Autostart = 0 Then
RegDelete("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "DAEMON Tools Lite")
EndIf
IniWrite(@AppDataDir & "\DAEMON Tools\daemontools.ini", "Global", "Autostart", 0)
; Add uninstall entries
RegWrite("HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "DisplayName", "REG_SZ", "DAEMON Tools Lite 4.12.4")
RegWrite("HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "UninstallString", "REG_SZ", $INSTALLLOCATION & "\uninst.exe")
RegWrite("HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "InstallLocation", "REG_SZ", $INSTALLLOCATION)
RegWrite("HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "DisplayIcon", "REG_SZ", $INSTALLLOCATION & "\daemon.exe")
; Stop checking for a window
AdlibDisable()
EndIf
Func _Adlib()
; Please select a language.
If WinExists($title, "") Then
ControlClick($title, "", "Button1")
EndIf
EndFunc
Func _OSBit()
Local $tOS = DllStructCreate("char[256]")
Local $aGSWD = DllCall("Kernel32.dll", "int", "GetSystemWow64Directory", "ptr", DllStructGetPtr($tOS), "int", 256)
If IsArray($aGSWD) And DllStructGetData($tOS, 1) Then Return 64
Return 32
EndFunc