Компьютерный форум OSzone.net  

Компьютерный форум OSzone.net (http://forum.oszone.net/index.php)
-   Автоматическая установка приложений (http://forum.oszone.net/forumdisplay.php?f=61)
-   -   Автоматическая установка Delphi6 (AutoIt) (http://forum.oszone.net/showthread.php?t=106789)

Konstantin_555 12-05-2008 13:15 800317

Автоматическая установка Delphi6 (AutoIt)
 
Интересует автоматизация концовки установки Delphi 6 через AutoIt.
Вот мой код:
Код:

Func MySendCom($NameWindow,$TextWinControl,$command)
    WinWaitActive($NameWindow,$TextWinControl)
        Send($command)
EndFunc
 
Run("setup.exe")
$a1="Borland Delphi 6 Enterprise Edition - Installation Wizard"
$a2="Welcome to Borland Delphi 6, Enterprise Edition"
MySendCom($a1,$a2,'!n')
$a2="Serial Number"
MySendCom($a1,$a2,'12345678901234')
MySendCom($a1,$a2,'{TAB}')
MySendCom($a1,$a2,'123456')
MySendCom($a1,$a2,'{TAB}')
MySendCom($a1,$a2,'{ENTER}')
$a2="License Agreement"
MySendCom($a1,$a2,'!a')
MySendCom($a1,$a2,'!n')
MySendCom($a1,'Important Installation Information','!n')
$a2="Setup Type"
MySendCom($a1,$a2,'!u')
MySendCom($a1,$a2,'!n')
$a2="Custom Setup"
MySendCom($a1,$a2,'{TAB 4}')
MySendCom($a1,$a2,'{ENTER}')
MySendCom($a1,'BDE SQL Driver Configuration','!n')
MySendCom($a1,'Choose VisiBroker','!n')
MySendCom($a1,'Microsoft Office Controls','!n')
MySendCom($a1,'Install Additional Components','!n')
MySendCom($a1,'Remote Dataset License Agreement','!a')
MySendCom($a1,'Remote Dataset License Agreement','!n')
MySendCom($a1,'Destination Folder','!n')
MySendCom($a1,'Save Installation Database','!n')
MySendCom($a1,'Ready to Install the Program','!i')
WinWaitActive("Borland Delphi 6 Installer Information");
$a=0;
while $a<45;
 sleep(50);
 Send("!i");
 $a=$a+1;
WEnd;
WinWaitActive("InterBase Client setup");
MySendCom('InterBase Client setup','','{TAB}')
MySendCom('InterBase Client setup','','{ENTER}')
MySendCom('Important installation information','','{ENTER}')
MySendCom('Software License Agreement','','{TAB}')
MySendCom('Software License Agreement','','{TAB}')
MySendCom('Software License Agreement','','{ENTER}')
MySendCom('InterBase component selection','','{TAB}')
MySendCom('InterBase component selection','','{TAB}')
MySendCom('InterBase component selection','','{TAB}')
MySendCom('InterBase component selection','','{TAB}')
MySendCom('InterBase component selection','','{ENTER}')
MySendCom('InterBase Client setup complete','','{ENTER}')
MySendCom('InterBase Client setup complete','','!f')

Код окончания установки:
Код:

$a1='Borland Delphi 6 Enterprise Edition - Installation Wizard'
Sleep(100)
WinActivate($a1)
Send("{SPACE}")

$a1='Borland Delphi 6 Installer Information'
Sleep(100)
WinActivate($a1)
Send("{TAB}")
Send("{SPACE}")

MsgBox(0,"ВНИМАНИЕ!","Не забудь перезагрузить компьютер!",5);

Если код завершения установки дописать к первому "главному" коду - он работать не будет... Остановиться на окне с кнопкой "Finish"

Если же выполнить отдельно "главный" код, а потом (не закрывая при этом последнее окно), выполнить код автоматизации завершения установки - всё будет гуд (окно "Borland Delphi 6 Enterprise Edition - Installation Wizard" закроется, автоматически нажмётся кнопка Нет (на запрос - нужно ли перезагружать ПК?) и появится сообщение в течении 5 секунд про необходимость перезагрузки компьютера.



Отсюда и вопрос - как правильным образом дописать код завершения установки к главному коду?..

Заранее, спасибо!

Konstantin_555 12-05-2008 18:57 800754

Если есть другой способ тихой установки Delphi 6 - подскажите, плиз!

alex_84 13-05-2008 13:48 801389

http://forum.oszone.net/thread-106386.html - ставил так 7-ю версию. На 6-й тоже должно прокатить. И никакого AutoIT =)

projectsoft 21-06-2010 03:30 1438312

Я юзаю Delphi 7
вот мой код:
Код:

Run("setup.exe")
WinWaitActive('Borland Delphi 7 Enterprise Edition - Installation Wizard','Welcome to Borland Delphi 7, Enterprise Edition')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button1')
WinWaitActive('Borland Delphi 7 Enterprise Edition - Installation Wizard','Serial Number')
Sleep(500) ; Обязательно нужна задержка!
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button1')
WinWaitActive('Borland Delphi 7 Enterprise Edition - Installation Wizard','License Agreement')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button3')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button5')
WinWaitActive('Borland Delphi 7 Enterprise Edition - Installation Wizard','Important Installation Information')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button1')
WinWaitActive('Borland Delphi 7 Enterprise Edition - Installation Wizard','Setup Type')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button1')
WinWaitActive('Borland Delphi 7 Enterprise Edition - Installation Wizard','Choose VisiBroker')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button4')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button1')
WinWaitActive('Borland Delphi 7 Enterprise Edition - Installation Wizard','Microsoft Office Controls')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button1')
WinWaitActive('Borland Delphi 7 Enterprise Edition - Installation Wizard','Install Additional Components')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button3')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button1')
WinWaitActive('Borland Delphi 7 Enterprise Edition - Installation Wizard','Destination Folder')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button1')
WinWaitActive('Borland Delphi 7 Enterprise Edition - Installation Wizard','Save Installation Database')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button1')
WinWaitActive('Borland Delphi 7 Enterprise Edition - Installation Wizard','Ready to Install the Program')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button1')
WinWaitActive('Borland Delphi 7 Enterprise Edition - Installation Wizard','Installation Wizard Completed')
ControlClick('Borland Delphi 7 Enterprise Edition - Installation Wizard','','Button1')

А в Setup.ini делаю вот такие изменения в секции [startup]:

Код:

[Startup]
CmdLine= PRODUCT_ID=6AKD-PD29Q9-RDF?JQ-X65Z AUTH_KEY=QX8-EEC

Я просто не пользуюсь InterBase и VisiBroker, поэтому в своей установке я их не устанавливаю.


Время: 05:36.

Время: 05:36.
© OSzone.net 2001-