Добрый день. Как сформулировать свой вопрос поиску я не понял поэтому извиняюсь заранее. Прошу подсказать по нижеприведенному коду где я косячу
При выполнении кода
1. Окно формы форматирования при нажатии ok не закрывается и форматирование не выполняется.
2. Копирование выполняется но архив не распаковывается
Заранее спасибо за помощь.
Код:
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=E:\Distr\Icons\Calabi\caution.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Comment=Скрипт конфигурации установки Windows
#AutoIt3Wrapper_Res_Description=AutoConfig Install
#AutoIt3Wrapper_Res_Fileversion=1.0.8
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include "GIFAnimation.au3"
;Чтение секции из ini
$sParam=$CmdLine[$CmdLine[0]]
$var = IniReadSection(@ScriptDir & "\Install.ini", $sParam)
$sFormatPath=$var[1][1]
$sInstallPath=$var[2][1]
;Проверка условия форматирования и окно подтверждения
If $sFormatPath <> "" Then
GUICreate ("Подтверждение форматирования", 350, 147,-1,-1)
GUICtrlCreateLabel("Для форматирования наберите ПРОДОЛЖИТЬ", 10, 20, 320, 34)
$Input = GUICtrlCreateInput("", 10, 54, 320, 21)
$bOK = GUICtrlCreateButton("OK", 10, 94, 121, 33)
$bCancel = GUICtrlCreateButton("Отмена", 209, 94, 121, 33)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $bCancel
Exit
Case $bOK
If GUICtrlRead($Input) == "ПРОДОЛЖИТЬ" Then
ExitLoop
EndIf
EndSwitch
WEnd
ShellExecuteWait ( @SystemDir & "\diskpart.exe", "/s %SYSTEMDRIVE%\Tools\HDD\" &$sFormatPath,"","",@SW_HIDE)
EndIf
If $sInstallPath = "" Then
Exit
EndIf
; Копирование и распаковка
$copy=3
$copy=_FileCopyEx("\\10.62.0.99\reminst\" & $sInstallPath, "C:\Win.iso")
Func _FileCopyEx($sSource, $sDest)
If Not FileExists($sSource) Then Return SetError(1)
ProgressOn("Подготовка дистрибутива", "Копирование и распаковка")
Local $hCopyProgressRoutine = DllCallbackRegister("_CopyProgressRoutine", "int", _
"uint64;uint64;uint64;uint64;dword;dword;ptr;ptr;ptr")
DllCall("kernel32.dll", "int", "CopyFileExA", _
"str", $sSource, _
"str", $sDest, _
"ptr", DllCallbackGetPtr($hCopyProgressRoutine), _
"ptr", 0, _
"int", 0, _
"int", 0)
DllCallBackFree($hCopyProgressRoutine)
Sleep(1000)
ProgressOff()
EndFunc
Func _CopyProgressRoutine($TotalFileSize, $TotalBytesTransferred, $StreamSize, $StreamBytesTransferred, $dwStreamNumber, $dwCallbackReason, $hSourceFile, $hDestinationFile, $lpData)
Local $iPrecent = $TotalBytesTransferred/$TotalFileSize * 100
ProgressSet($iPrecent, "Проценты: " & Round($iPrecent, 1) & " %")
Return 0
EndFunc
if $copy=0 then
ShellExecuteWait ( @SystemDir & "\7z.exe", "x c:\Win.iso -oc:\Setup","","",@SW_HIDE)
ShellExecuteWait ("c:\setup\i386\winnt32.exe", "/syspart:c: /tempdrive:c /unattend:c:\setup\i386\winnt.sif")
EndIf
While 1
WEnd
При выполнении кода
1. Окно формы форматирования при нажатии ok не закрывается и форматирование не выполняется.
2. Копирование выполняется но архив не распаковывается
Заранее спасибо за помощь.