Acheron Posted February 17, 2008 Posted February 17, 2008 I have updated the script in last post to work with Daemon Tools 4.12.1. This script should work at any screen size. The mouse position is related to the Window position of the Daemon Tools right click menu.I still have to do some actual tests to make sure Daemon Tools get unattended installed. My idea is to install Daemon Tools at T12 using install.cmd. Daemon Tools need a reboot, so I can't configure Daemon Tools until desktop is loaded for the first time.
radix Posted February 18, 2008 Posted February 18, 2008 (edited) I have updated the script in last post to work with Daemon Tools 4.12.1. This script should work at any screen size. The mouse position is related to the Window position of the Daemon Tools right click menu.I still have to do some actual tests to make sure Daemon Tools get unattended installed. My idea is to install Daemon Tools at T12 using install.cmd. Daemon Tools need a reboot, so I can't configure Daemon Tools until desktop is loaded for the first time.The new addon inside Daemon Tools is SRSAI.exe.I have installed SPTD from T13 with add /q switch and Daemon Tools from RunOnce with this script:Opt("TrayIconDebug", 1)Opt("SendKeyDelay", 200); Executable file name$EXECUTABLE = "daemon4121-lite.exe"; Run Daemon Tools on Windows startup$autostart = 0; 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 before using this script", 4) Exit EndIf ; Disable the default internet browser (to prevent SRSAI.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 with "Please select a language." text inside AdlibEnable('_Adlib'); Kill SRSAI.exe process ProcessWait("SRSAI.exe") $PID = ProcessExists("SRSAI.exe") If $PID Then ProcessClose($PID) EndIf ; Stop checking for a window with "Please select a language." text inside AdlibDisable() Sleep(2000) ; Delete SRSAI.exe file FileDelete($INSTALLLOCATION & "\SRSAI.exe") ; 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) ; Block daemon.exe to run on Windows startup If $autostart = 0 Then RegDelete("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "DAEMON Tools Lite") EndIf ; Add uninstall entries RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "DisplayName", "REG_SZ", "DAEMON Tools Lite 4.12.1") 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")EndIfIf $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 SRSAI.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 with "Please select a language." text inside AdlibEnable('_Adlib'); Kill SRSAI.exe process ProcessWait("SRSAI.exe") $PID = ProcessExists("SRSAI.exe") If $PID Then ProcessClose($PID) EndIf ; Stop checking for a window with "Please select a language." text inside AdlibDisable() Sleep(2000) ; Delete SRSAI.exe file FileDelete($INSTALLLOCATION & "\SRSAI.exe") ; 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) ; Block daemon.exe to run on Windows startup If $autostart = 0 Then RegDelete("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "DAEMON Tools Lite") EndIf ; Add uninstall entries RegWrite("HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "DisplayName", "REG_SZ", "DAEMON Tools Lite 4.12.1") 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")EndIfFunc _Adlib() ; Please select a language. If WinExists("DAEMON Tools Lite 4.12.1", "Please select a language.") Then WinActivate("DAEMON Tools Lite 4.12.1", "Please select a language.") ControlClick("DAEMON Tools Lite 4.12.1", "", "Button1") EndIfEndFuncFunc _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 32EndFuncMaybe is useful.Edit again. Edited March 13, 2008 by radix
ricktendo Posted February 18, 2008 Posted February 18, 2008 Very smart radix... Will it also delete the adware?
radix Posted February 18, 2008 Posted February 18, 2008 Very smart radix... Will it also delete the adware?Yes
squizo Posted February 22, 2008 Posted February 22, 2008 (edited) Hello, first sorry for my "tarzan-english". I am spanish from Madrid, España. I download daemons lite 4121.As you say nod 32 detect spyware in SRSAI.exe.I unpack with universal extractor.I delete SRSAI.exe.I see and read [NSIS].nsi archive.search into archive [NSIS].nsi and see only one reference to SRSAI in this part:SetOutPath $INSTDIRFile SRSAI.exeExecute 49043 0 0StrCpy $[43] "1"ReturnSetFlag 13 47631StrCpy $[41] "1"ReturnSetFlag 13 162UpdateSatusText Installing Desktop Shortcut... 0SetFlag 13 47631SetOutPath $INSTDIRI suspect that say to the installer -copy this archive (SRSAI) in install directory.This part start in "SetOutPath $INSTDIR" and ending in "SetFlag 13 47631"The next "instruction" is a new "SetOutPath $INSTDIR" i think.The question is: if i erase this part SetOutPath $INSTDIRFile SRSAI.exeExecute 49043 0 0StrCpy $[43] "1"ReturnSetFlag 13 47631StrCpy $[41] "1"ReturnSetFlag 13 162UpdateSatusText Installing Desktop Shortcut... 0SetFlag 13 47631and repack all without SRSAI.exe daemon tools work corrctly?Another question is : what program must use to repack it? HM NIS Edit for example'The last question Radix - How execute your last script in an active windows ?Opt("TrayIconDebug", 1); Disable the default internet browser (in order to prevent SRSAI.exe to open it)$DefBrowser = RegRead("HKCR\HTTP\shell\open\command\", "")RegDelete("HKCR\HTTP\shell\open\command\", "")... ...Is php code? must i create an archive with .php extension and execute it?when execute it? before install daemons tools?Can i create a registry entry for to avoid the install or execution of SRSAI?Is most easy install daemons complete and after remove the spyware?I hope you understand me. Sorry for my english again. Thanks. Edited February 22, 2008 by squizo
radix Posted February 22, 2008 Posted February 22, 2008 The question is: if i erase this part SetOutPath $INSTDIRFile SRSAI.exeExecute 49043 0 0StrCpy $[43] "1"ReturnSetFlag 13 47631StrCpy $[41] "1"ReturnSetFlag 13 162UpdateSatusText Installing Desktop Shortcut... 0SetFlag 13 47631and repack all without SRSAI.exe daemon tools work corrctly?Another question is : what program must use to repack it? HM NIS Edit for example'The last question Radix - How execute your last script in an active windows ?Opt("TrayIconDebug", 1); Disable the default internet browser (in order to prevent SRSAI.exe to open it)$DefBrowser = RegRead("HKCR\HTTP\shell\open\command\", "")RegDelete("HKCR\HTTP\shell\open\command\", "")... ...Is php code? must i create an archive with .php extension and execute it?when execute it? before install daemons tools?Can i create a registry entry for to avoid the install or execution of SRSAI?Is most easy install daemons complete and after remove the spyware?I hope you understand me. Sorry for my english again. Thanks.HiThe file [NSIS].nsi extracted with Universal Extractor is corrupt. If you are a master in coding Null Soft ya you can repack Daemon Tools.My code is AutoIt.
squizo Posted February 22, 2008 Posted February 22, 2008 (edited) Thanks for the answer.I am not a master in nothing. I am a stupid. Now i know.Always scan the files for virus before install with nod 32. This time was a false alarm.I make a restore point and try install daemontools to see what happen.This time the solution is easy: when install daemon tools unmark two options and goodbye spyware. Sorry for your spend time.And 1000 thanks for help me. Edited February 22, 2008 by squizo
radix Posted March 17, 2008 Posted March 17, 2008 (edited) New script for new DAEMON Tools Lite 4.12.2 with SPTD 1.56 (works in 32 and 64 bit environment)Opt("TrayIconDebug", 1)Opt("SendKeyDelay", 200); Executable file name$EXECUTABLE = "daemon4122-lite.exe"; Run Daemon Tools on Windows startup$autostart = 0; 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 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 with "Please select a language." text inside AdlibEnable('_Adlib') ProcessWaitClose($EXECUTABLE) Sleep(2000) ; 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); Block daemon.exe to run on Windows startup If $autostart = 0 Then RegDelete("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "DAEMON Tools Lite") EndIf ; Add uninstall entries RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "DisplayName", "REG_SZ", "DAEMON Tools Lite 4.12.2") 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 with "Please select a language." text inside AdlibDisable()EndIfIf $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 with "Please select a language." text inside AdlibEnable('_Adlib') ProcessWaitClose($EXECUTABLE) Sleep(2000) ; 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); Block daemon.exe to run on Windows startup If $autostart = 0 Then RegDelete("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "DAEMON Tools Lite") EndIf ; Add uninstall entries RegWrite("HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite", "DisplayName", "REG_SZ", "DAEMON Tools Lite 4.12.2") 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 with "Please select a language." text inside AdlibDisable()EndIfFunc _Adlib() ; Please select a language. If WinExists("DAEMON Tools Lite 4.12.2", "Please select a language.") Then ControlClick("DAEMON Tools Lite 4.12.2", "Please select a language.", "Button1") EndIfEndFuncFunc _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 32EndFuncNote: Close Internet connection before running the setup (to avoid firewall prompt for downloading of SRSAI.exe bonus). Edit Edited March 19, 2008 by radix
radix Posted April 3, 2008 Posted April 3, 2008 (edited) DAEMON Tools Lite 4.12.3 with SPTD 1.56 (works in 32 and 64 bit environment)Note: Close Internet connection before running the setup (to avoid firewall prompt and add-on download).DAEMON_Tools_Lite_4.12.3_with_SPTD_1.56.au3 Edited April 3, 2008 by radix
Acheron Posted April 3, 2008 Posted April 3, 2008 Radix, what's all that 64-bit translation stuff doing in your script? As long as you compile AutoIt as a 32-bit exe you don't have to do any path translations, as long as you don't hardcode paths.
radix Posted April 3, 2008 Posted April 3, 2008 Radix, what's all that 64-bit translation stuff doing in your script? As long as you compile AutoIt as a 32-bit exe you don't have to do any path translations, as long as you don't hardcode paths.If FileExists($INSTALLLOCATION & "\daemon.exe") Then MsgBox(0x40010, @ScriptName, "Please uninstall previous version of DAEMON Tools before using this script", 4) Exit EndIfFor the above code the script will check only in Program Files folder. But in 64 bit Windows, Daemon Tools is installed in Program Files (x86) and if you have allready installed Daemon Tools, FileExists will see nothing. The uninstall entries for 64 bit Windows will go to HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\DAEMON Tools Lite.These are the reasons for 64-bit translation stuff.
Acheron Posted April 4, 2008 Posted April 4, 2008 So @ProgramFilesDir is automaticly converted to Program Files (x86) and HKLM\Software\Windows\CurrentVersion\Uninstall should also automaticly get converted to the Wow6432node path.If this is not correct you should report this as a bug to the AutoIt team.
radix Posted April 4, 2008 Posted April 4, 2008 So @ProgramFilesDir is automaticly converted to Program Files (x86) and HKLM\Software\Windows\CurrentVersion\Uninstall should also automaticly get converted to the Wow6432node path.If this is not correct you should report this as a bug to the AutoIt team.Generally, the path isn't automaticaly converted. I have a script for an application which type the path with ControlSetText command. Application is 32 bit native, but the script doesn't detectthis and type C:\Program Files\blabla\ instead of C:\Program Files (x86)\blabla\ and install into Program Files. On other applications it works right. So is a bug, but is normally because is the first version with64 bit suport.
Acheron Posted May 2, 2008 Posted May 2, 2008 The Daemon Tools installer is not very friendly to install unattendly. Since all kernel stuff is put into the SPTD driver anyway I'm going to create my own installer for it. I'll also try to improve the AutoIt script to set Daemon Tools options.When I'm done I'll post a link here.
microbion Posted May 3, 2008 Posted May 3, 2008 (edited) to make it more flexible for further DT versions change the window title to a variable and replace the titles below (in line 66, 113, 124 and 125) with that variable.; Script Start - Add your code below hereOpt("TrayIconDebug", 1)Opt("SendKeyDelay", 200); Executable file name$EXECUTABLE = "daemon4123-lite.exe"[color="#FF0000"][b]$WINDOWTITLEVERSION = "DAEMON Tools Lite 4.12.3"[/b][/color]; Run Daemon Tools on Windows startup$autostart = 0; Detect the Operating System type (32 bit or 64 bit)$OS = _OSBit()PS: salutari din germania Edited May 3, 2008 by microbion
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now