almaznak |
03-05-2008 16:31 793899 |
Установка daemon4123-lite.exe+монтирование+Размонтирование
Установка по тихому daemon4123-lite.exe
Код:
Opt("TrayIconDebug", 1)
Opt("SendKeyDelay", 200)
; Executable file name
$EXECUTABLE = "daemon4123-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(1000)
; 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)
;Set Options
IniWrite($INSTALLLOCATION & "\daemontools.ini","Global","Autostart","0")
IniWrite($INSTALLLOCATION & "\daemontools.ini","Options","PanelIncluded","0")
IniWrite($INSTALLLOCATION & "\daemontools.ini","View","Language","1049")
;Оставляем только русский, украинский и анлийский язык
FileMove ($INSTALLLOCATION & "\Lang\RUS.dll", $INSTALLLOCATION)
FileMove ($INSTALLLOCATION & "\Lang\UKR.dll", $INSTALLLOCATION)
FileMove ($INSTALLLOCATION & "\Lang\ENU.dll", $INSTALLLOCATION)
DirRemove($INSTALLLOCATION & "\Lang", 1)
DirCreate($INSTALLLOCATION & "\Lang")
FileMove ($INSTALLLOCATION & "\RUS.dll", $INSTALLLOCATION & "\Lang")
FileMove ($INSTALLLOCATION & "\UKR.dll", $INSTALLLOCATION & "\Lang")
FileMove ($INSTALLLOCATION & "\ENU.dll", $INSTALLLOCATION & "\Lang")
; 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.3")
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()
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 with "Please select a language." text inside
AdlibEnable('_Adlib')
ProcessWaitClose($EXECUTABLE)
Sleep(1000)
; 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.3")
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()
EndIf
Func _Adlib()
; Please select a language.
If WinExists("DAEMON Tools Lite 4.12.3", "Please select a language.") Then
ControlClick("DAEMON Tools Lite 4.12.3", "Please select a language.", "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
Меня другое теперь волнует как монтировать и размонтировать образы в DT скриптовыми командами? Дело в том что ранее писали монтирование по типу Run ( $daemondir & '\daemon.exe -noicon -mount 0,"' & @ScriptDir & '\образ.iso"' ) Оно не пашет с версией daemon4123-lite.exe
А размонтирование RunWait ( $daemondir & '\daemon.exe -noicon -unmount 0' )
А задача стоит работа по сети
смонтировать причем если возможно сразу включить все опции защиты в даемоне перед монтированием
Установить программу с образа
Размонтировать
Удалить DT
Вот и осталось мне выяснить как монтировать и размонтировать образы? http://rapidshare.com/files/11222589...s_lite.7z.html ССылка на программу со скриптом. Прелесть установки этим скриптом что нету перезагрузки. Удаляется тоже без перезагрузки!!! Daemon Tools прекрасно монтирует образы находящиеся в любом месте локальной сети!!! Таким образом можно по локалке ставить программы из образов не копируя образы на искомый компьютер! Я сталкнулся с такой проблемой когда AUTOCAD 2008 никак не хотел ставиться по сети . Я сделал образы дисков в Daemon Tools Pro v4.10.218 ( http://rapidshare.com/files/11223308...0.218.rar.html (пасс на архив 1234567890)и затем испльзовал способ с daemon4123-lite.exe и все пучком!!! Теперь надо окончательно автоматизировать процесс с монтированием.
|