Что нового

Digital Signature Цифровая подпись программы

tonycstech

Новичок
Сообщения
94
Репутация
3
Версия AutoIt
3.3.14.5
Версия
0.3
Инструмент для цифровой подписи вашей программы.
Для чего ? Для того чтобы программа не была опознана как вирус, хотя может быть даже и вирус.
Скрипт должен находится в одной пакпе со остальными файлами которые вы должны скачать ниже.
Программа которую нужно пидписать, должна находится в той же самой папке, иначе может не работать, хотя на некоторых компьютерах работает без проблем.
Код очень простой и в какойто степени приметивный, думаю всем будет понятно.
Если есть вопроссы, добавки, изменения, пожалуйте. Всем только лучше будет.

Всё на Англиском. Я Америкос так что жалуйте.
Да и вообще, кто в 21 веке не понимает Англиский язык кроме замёрших мамонтов ?

Код:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=Icon.ico
#AutoIt3Wrapper_Outfile=Auto Signer.Exe
#AutoIt3Wrapper_Res_requestedExecutionLevel=highestAvailable
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <AutoItConstants.au3> ;for command output
#include <StaticConstants.au3> ;for centering text
#include <ButtonConstants.au3>
Opt ("TrayAutoPause",0)
$FileOpen = FileOpenDialog("Select executable to sign", "", "Executable (*.exe)")
If @error Then
    MsgBox(16, "Error", "Cannot continue without selecting executable you wish to sign.")
    Exit
ElseIf StringInStr ($FileOpen,@ScriptDir) = 0 Then
    MsgBox(16, "Error", "File must be located in the same folder as the Signer tool")
    Exit
ElseIf StringInStr ($FileOpen,@ScriptDir & "\cert2spc.exe") > 0 Then
    MsgBox (16,"Error","This file is utilized by the script. Do not select it.")
    Exit
ElseIf StringInStr ($FileOpen,@ScriptDir & "\makecert.exe") > 0 Then
    MsgBox (16,"Error","This file is utilized by the script. Do not select it.")
    Exit
ElseIf StringInStr ($FileOpen,@ScriptDir & "\pvk2pfx.exe") > 0 Then
    MsgBox (16,"Error","This file is utilized by the script. Do not select it.")
    Exit
ElseIf StringInStr ($FileOpen,@ScriptDir & "\PVKIMPRT.EXE") > 0 Then
    MsgBox (16,"Error","This file is utilized by the script. Do not select it.")
    Exit
ElseIf StringInStr ($FileOpen,@ScriptDir & "\signtool.exe") > 0 Then
    MsgBox (16,"Error","This file is utilized by the script. Do not select it.")
    Exit
EndIf
$GUI = GUICreate("AutoSign", 400, 210)

$INI = @ScriptDir & "\AutoSign.ini"
$SavedSigner = IniRead($INI, "Settings", "Signer", "Your name")
$SavedPassword = IniRead($INI, "Settings", "Password", "Enter password")
$SavedTimeStamp = IniRead($INI, "Settings", "TimeStamp", "http://timestamp.globalsign.com/scripts/timstamp.dll")

GUICtrlCreateGroup("Certificate Information", 5, 5, 200, 200)
GUICtrlCreateLabel("Signer ", 10, 32, 35, 20, $SS_RIGHT)
$SignerInput = GUICtrlCreateInput($SavedSigner, 50, 30, 100, 20)
$SignerSave = GUICtrlCreateButton("Save", 150, 30, 50, 20)
GUICtrlCreateLabel("Pswd ", 10, 62, 35, 20, $SS_RIGHT)
$PasswordInput = GUICtrlCreateInput($SavedPassword, 50, 60, 100, 20)
$PasswordSave = GUICtrlCreateButton("Save", 150, 60, 50, 20)
GUICtrlCreateLabel("Timestamp URL", 15, 92, 170, 20, $SS_CENTER)
$TimeStampInput = GUICtrlCreateInput($SavedTimeStamp, 15, 110, 135, 20)
$TimeStampSave = GUICtrlCreateButton("Save", 150, 110, 50, 20)

GUICtrlCreateLabel("Target ", 10, 142, 40, 20, $SS_RIGHT)
$File = GUICtrlCreateInput($FileOpen, 50, 140, 100, 20)
$FileBrowse = GUICtrlCreateButton("Browse", 150, 140, 50, 20)


GUICtrlCreateGroup("Output log", 210, 5, 185, 200)
$Log = GUICtrlCreateEdit("", 215, 30, 175, 170)

$Start = GUICtrlCreateButton("Sign selected target", 10, 170, 190, 30, $BS_CENTER)
GUICtrlSetFont(-1, 10, 800)

GUISetState(@SW_SHOW)
_CheckForFiles()
While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
    If $msg = $SignerSave Then IniWrite($INI, "Settings", "Signer", GUICtrlRead($SignerInput))
    If $msg = $PasswordSave Then IniWrite($INI, "Settings", "Password", GUICtrlRead($PasswordInput))
    If $msg = $TimeStampSave Then IniWrite($INI, "Settings", "TImeStamp", GUICtrlRead($TimeStampInput))
    If $msg = $FileBrowse Then
        $FileOpen = FileOpenDialog("Select executable to sign", "", "Executable (*.exe)")
        If @error Then
            MsgBox(16, "Error", "Cannot cintinue without selecting executable you wish to sign")
        Else
            GUICtrlSetData($File, $FileOpen)
        EndIf
    EndIf
    If $msg = $Start Then _Run()
WEnd

Func _CheckForFiles()
    $Count = 0 ;add one for each found file
    If FileExists(@ScriptDir & "\capicom.dll") = 0 Then GUICtrlSetData($Log, @CRLF & "capicom.dll not found")
    If FileExists(@ScriptDir & "\cert2spc.exe") = 0 Then GUICtrlSetData($Log, @CRLF & "cert2spc.exe not found")
    If FileExists(@ScriptDir & "\makecert.exe") = 0 Then GUICtrlSetData($Log, @CRLF & "makecert.exe not found")
    If FileExists(@ScriptDir & "\pvk2pfx.exe") = 0 Then GUICtrlSetData($Log, @CRLF & "pvk2pfx.exe not found")
    If FileExists(@ScriptDir & "\PVKIMPRT.EXE") = 0 Then GUICtrlSetData($Log, @CRLF & "PVKIMPRT.EXE not found")
    If FileExists(@ScriptDir & "\signtool.exe") = 0 Then GUICtrlSetData($Log, @CRLF & "signtool.exe not found")
EndFunc   ;==>_CheckForFiles

Func _Run()
    $Executable = GUICtrlRead($File)
    If @error Then Exit
    GUICtrlSetData ($Log,"")
    DirCreate ("Certificates")
    $Password = GUICtrlRead($PasswordInput)
    $TimeStamp = GUICtrlRead($TimeStampInput)
    $Signer = GUICtrlRead($SignerInput)

    $Code1 = 'makecert.exe -r -n "CN=' & $Signer & '" -b 01/01/2013 -e 01/01/2099 -eku 1.3.6.1.5.5.7.3.3 -sv "Certificates\' & $Signer & '_cert.pvk" "Certificates\' & $Signer & '_cert.cer"'
    $Code2 = 'cert2spc.exe "Certificates\' & $Signer & '_cert.cer" "Certificates\' & $Signer & '_cert.spc"'
    $Code3 = 'pvk2pfx.exe -pvk "Certificates\' & $Signer & '_cert.pvk" -pi ' & $Password & ' -spc "Certificates\' & $Signer & '_cert.spc" -pfx "Certificates\' & $Signer & '_cert.pfx" -po ' & $Password
    $Code4 = 'signtool.exe sign /f "Certificates\' & $Signer & '_cert.pfx" /p ' & $Password & ' "' & $Executable & '"'
    $Code5 = 'signtool.exe timestamp /t "' & $TimeStamp & '" "' & $Executable & '"'

    $Run = Run('"' & @ComSpec & '" /c ' & $Code1, '', @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)
    If WinWait("Create Private Key Password", "", 2) = 0 Then ;Wait for required window
        GUICtrlSetData($Log, GUICtrlRead($Log) & @CRLF & "$Code1 1st Required window did not open. Possibly due to existing certificate.")
    Else
        ControlSend("Create Private Key Password", "", "Edit1", $Password) ;Send password to window
        ControlSend("Create Private Key Password", "", "Edit2", $Password) ;Confirm password
        ControlClick("Create Private Key Password", "", "Button1") ;Click OK button
    EndIf
    If WinWait("Enter Private Key Password", "", 2) = 0 Then ;Wait for required window
        GUICtrlSetData($Log, GUICtrlRead($Log) & @CRLF & "$Code1 2nd Required window did not open. Terminating process")
        Return
    Else
        ControlSend("Enter Private Key Password", "", "Edit1", $Password) ;Send password to window
        ControlClick("Enter Private Key Password", "", "Button1") ;Click OK button
        ProcessWaitClose($Run)
        GUICtrlSetData($Log, GUICtrlRead($Log) & @CRLF & "$Code1=" & StdoutRead($Run))
    EndIf

    $Run = Run('"' & @ComSpec & '" /c ' & $Code2, '', @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)
    ProcessWaitClose($Run)
    GUICtrlSetData($Log, GUICtrlRead($Log) & "$Code2=" & StdoutRead($Run))

    $Run = Run('"' & @ComSpec & '" /c ' & $Code3, '', @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)
    ProcessWaitClose($Run)
    If StdoutRead($Run) = "" Then
        GUICtrlSetData($Log, GUICtrlRead($Log) & "$Code3=Blank. Probably OK" & @CRLF & StdoutRead($Run))
    Else
        GUICtrlSetData($Log, GUICtrlRead($Log) & "$Code3=" & @CRLF & StdoutRead($Run))
    EndIf

    $Run = Run('"' & @ComSpec & '" /c ' & $Code4, '', @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)
    ProcessWaitClose($Run)
    GUICtrlSetData($Log, GUICtrlRead($Log) & "$Code4=" & StdoutRead($Run))

    $Run = Run('"' & @ComSpec & '" /c ' & $Code5, '', @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)
    ProcessWaitClose($Run)
    $message = StdoutRead($Run)
    If StringInStr ($message, "Success") = 0 Then ;one space is returned if error ?
        GUICtrlSetData($Log, GUICtrlRead($Log) & "$Code5=Cannot get timestamp. Try again or change timestamp URL" & @CRLF)
    Else
        GUICtrlSetData($Log, GUICtrlRead($Log) & "$Code5=" & $message & @CRLF)
    EndIf
    GUICtrlSetData($Log, GUICtrlRead($Log) & "Finished")
EndFunc   ;==>_Run


Список возможных аддрессов подлисчика. Смотрите $Code5=Successfully timestamped.
Если нет, то пробуйте один из списка

Код:
http://timestamp.globalsign.com/scripts/timstamp.dll
http://timestamp.globalsign.com/?signature=sha2
http://rfc3161timestamp.globalsign.com/advanced
https://timestamp.geotrust.com/tsa
http://timestamp.sectigo.com
http://timestamp.wosign.com
http://tsa.startssl.com/rfc3161
http://time.certum.pl
http://timestamp.digicert.com
https://freetsa.org
http://dse200.ncipher.com/TSS/HttpTspServer
http://tsa.safecreative.org
http://zeitstempel.dfn.de
https://ca.signfiles.com/tsa/get.aspx
http://services.globaltrustfinder.com/adss/tsa
https://tsp.iaik.tugraz.at/tsp/TspRequest
http://timestamp.apple.com/ts01
http://timestamp.entrust.net/TSS/RFC3161sha2TS
http://tsa.starfieldtech.com/
 
Автор
tonycstech

Вложения

  • Files.zip
    1.2 МБ · Просмотры: 51
Последнее редактирование:

joiner

Модератор
Локальный модератор
Сообщения
3,556
Репутация
628
пишет
signtool.exe not found
хотя в папке есть этот файл
что то с определением папки не так. в итоге кинул экзешник в папку утилиты и все сработало.
переменные нужно объявлять
да и справку на русском не плохо бы. форум то русскоязычный
 
Автор
T

tonycstech

Новичок
Сообщения
94
Репутация
3
Незнаю, у меня не жалуется на signtool.exe.
Хотя было один раз, но так и не понял почему.

Если чесно, я такую проблему замечал и раньше. Код без ошибок а вот сам Autoit переводчик почемуто пропускает и выдаёт ложный результат.

Вопрос по теме: Каким образом был подписан autoit-v3-setup.exe ?
Сообщение автоматически объединено:

Устранил проблему с неспособностью найти signtool.exe
Добавил некоторые сообщения если подписываемая программа не там где надо.
Код обнавил в верху
 
Последнее редактирование:

smsgeorge

Новичок
Сообщения
63
Репутация
0
Вписал имя, пароль (свой) Вылезло такое.
1623312683908.png
$Code1 1st Required window did not open. Possibly due to existing certificate.
$Code1 2nd Required window did not open. Terminating process
----------------------------------------------------------------------------------------------------------------
В папке создались такие файлы
Снимок.JPG
----------------------------------------------------------------------------------------------------------------
В процессе всплывали такие окна - вводил сюда пароль, который вводил в начале, в окне выше.
Снимок.JPG
После появилось еще окно - тоже ввожу пароль, который выше и всё. После ничего, окно закрывается.
Снимок.JPG
-----------------------------------------------------------------------------------------------------------------------------------------------------------
В папке 2 файла.
Снимок.JPG
Что сделал не так?
 
Автор
T

tonycstech

Новичок
Сообщения
94
Репутация
3
Кто то или что то блокирует это окно.
1ое окно не открылось возножно из за уже существующего сертификата.
Удали папку с сертификатом и пробуй ещё раз.
Второе окно скорее всего не сработало если пароль на русском языке.
Всё должно быть по англиски. Иначе сервер не поймёт и программа работать не будет как должно.
 

smsgeorge

Новичок
Сообщения
63
Репутация
0
Кто то или что то блокирует это окно.
1ое окно не открылось возножно из за уже существующего сертификата.
Удали папку с сертификатом и пробуй ещё раз.
Второе окно скорее всего не сработало если пароль на русском языке.
Всё должно быть по англиски. Иначе сервер не поймёт и программа работать не будет как должно.
удалял папку. Пароль - цифры, 6 цифр.
 
Автор
T

tonycstech

Новичок
Сообщения
94
Репутация
3
ну незнаю. у меня всё работает.
Может какой то антивирус или что.
Сообщение автоматически объединено:

Понял. У вас файл не там где надо.
Файл должен быт там же где и скрипт и все остальные файлы.
По другому никак.

Проигнорировали "File must be located in the same folder as the Signer tool" ошибку при выборе файла или её небыло ?
Мне трудно сказать как и что вы там делаете.
 
Последнее редактирование:

Solros2022

Новичок
Сообщения
1
Репутация
0
Hi

I have tested this autosigner script but it stops after code 1 and code 2 some problem with child window i really dont know
what it is for problem, what windows you recomend for this application to work?

I have windows 7 home edition.

Best regards Solros2022
 

admpos

Новичок
Сообщения
1
Репутация
0
Доброго всем дня!

Вот и я добрался до этапа "подписать свой exe" и потестил скрипт ТСа. Столкнулся с двумя проблемами:
1. ТС, будучи американцем, наверняка юзает винду с английской локалью, и ожидает окошки с заголовками на английском. А у жителей русскоязычного форума винда внезапно русская, и нужных окошек скрипт не дожидается, в связи с чем и падает с ошибкой.
2. 2 последних команды требуют повышенных прав, а скрипт их не запрашивает, в чем связи с чем получает ошибку использования приложенной CAPICOM.dll.

Надеюсь, уважаемый tonycstech меня простит за то, что я позволил себе немного поправить его скрипт:
Код:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=Icon.ico
#AutoIt3Wrapper_Outfile=Auto Signer.Exe
#AutoIt3Wrapper_Res_requestedExecutionLevel=highestAvailable
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#RequireAdmin ; Specifies that the current script requires full administrator rights to run.

#include <GUIConstantsEx.au3>
#include <AutoItConstants.au3> ;for command output
#include <StaticConstants.au3> ;for centering text
#include <ButtonConstants.au3>

Opt ("TrayAutoPause",0)

$FileOpen = FileOpenDialog("Select executable to sign", "", "Executable (*.exe)")
$sWindow1Header = 'Создание пароля закрытого ключа' ; 'Create Private Key Password'
$sWindow2Header = 'Пароль закрытого ключа' ; 'Enter Private Key Password'


If @error Then
    MsgBox(16, "Error", "Cannot continue without selecting executable you wish to sign.")
    Exit
ElseIf StringInStr ($FileOpen,@ScriptDir) = 0 Then
    MsgBox(16, "Error", "File must be located in the same folder as the Signer tool")
    Exit
ElseIf StringInStr ($FileOpen,@ScriptDir & "\cert2spc.exe") > 0 Then
    MsgBox (16,"Error","This file is utilized by the script. Do not select it.")
    Exit
ElseIf StringInStr ($FileOpen,@ScriptDir & "\makecert.exe") > 0 Then
    MsgBox (16,"Error","This file is utilized by the script. Do not select it.")
    Exit
ElseIf StringInStr ($FileOpen,@ScriptDir & "\pvk2pfx.exe") > 0 Then
    MsgBox (16,"Error","This file is utilized by the script. Do not select it.")
    Exit
ElseIf StringInStr ($FileOpen,@ScriptDir & "\PVKIMPRT.EXE") > 0 Then
    MsgBox (16,"Error","This file is utilized by the script. Do not select it.")
    Exit
ElseIf StringInStr ($FileOpen,@ScriptDir & "\signtool.exe") > 0 Then
    MsgBox (16,"Error","This file is utilized by the script. Do not select it.")
    Exit
EndIf
$GUI = GUICreate("AutoSign", 400, 210)

$INI = @ScriptDir & "\AutoSign.ini"
$SavedSigner = IniRead($INI, "Settings", "Signer", "Your name")
$SavedPassword = IniRead($INI, "Settings", "Password", "Enter password")
$SavedTimeStamp = IniRead($INI, "Settings", "TimeStamp", "http://timestamp.globalsign.com/scripts/timstamp.dll")

GUICtrlCreateGroup("Certificate Information", 5, 5, 200, 200)
GUICtrlCreateLabel("Signer ", 10, 32, 35, 20, $SS_RIGHT)
$SignerInput = GUICtrlCreateInput($SavedSigner, 50, 30, 100, 20)
$SignerSave = GUICtrlCreateButton("Save", 150, 30, 50, 20)
GUICtrlCreateLabel("Pswd ", 10, 62, 35, 20, $SS_RIGHT)
$PasswordInput = GUICtrlCreateInput($SavedPassword, 50, 60, 100, 20)
$PasswordSave = GUICtrlCreateButton("Save", 150, 60, 50, 20)
GUICtrlCreateLabel("Timestamp URL", 15, 92, 170, 20, $SS_CENTER)
$TimeStampInput = GUICtrlCreateInput($SavedTimeStamp, 15, 110, 135, 20)
$TimeStampSave = GUICtrlCreateButton("Save", 150, 110, 50, 20)

GUICtrlCreateLabel("Target ", 10, 142, 40, 20, $SS_RIGHT)
$File = GUICtrlCreateInput($FileOpen, 50, 140, 100, 20)
$FileBrowse = GUICtrlCreateButton("Browse", 150, 140, 50, 20)


GUICtrlCreateGroup("Output log", 210, 5, 185, 200)
$Log = GUICtrlCreateEdit("", 215, 30, 175, 170)

$Start = GUICtrlCreateButton("Sign selected target", 10, 170, 190, 30, $BS_CENTER)
GUICtrlSetFont(-1, 10, 800)

GUISetState(@SW_SHOW)
_CheckForFiles()
While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
    If $msg = $SignerSave Then IniWrite($INI, "Settings", "Signer", GUICtrlRead($SignerInput))
    If $msg = $PasswordSave Then IniWrite($INI, "Settings", "Password", GUICtrlRead($PasswordInput))
    If $msg = $TimeStampSave Then IniWrite($INI, "Settings", "TImeStamp", GUICtrlRead($TimeStampInput))
    If $msg = $FileBrowse Then
        $FileOpen = FileOpenDialog("Select executable to sign", "", "Executable (*.exe)")
        If @error Then
            MsgBox(16, "Error", "Cannot cintinue without selecting executable you wish to sign")
        Else
            GUICtrlSetData($File, $FileOpen)
        EndIf
    EndIf
    If $msg = $Start Then _Run()
WEnd

Func _CheckForFiles()
    $Count = 0 ;add one for each found file
    If FileExists(@ScriptDir & "\capicom.dll") = 0 Then GUICtrlSetData($Log, @CRLF & "capicom.dll not found")
    If FileExists(@ScriptDir & "\cert2spc.exe") = 0 Then GUICtrlSetData($Log, @CRLF & "cert2spc.exe not found")
    If FileExists(@ScriptDir & "\makecert.exe") = 0 Then GUICtrlSetData($Log, @CRLF & "makecert.exe not found")
    If FileExists(@ScriptDir & "\pvk2pfx.exe") = 0 Then GUICtrlSetData($Log, @CRLF & "pvk2pfx.exe not found")
    If FileExists(@ScriptDir & "\PVKIMPRT.EXE") = 0 Then GUICtrlSetData($Log, @CRLF & "PVKIMPRT.EXE not found")
    If FileExists(@ScriptDir & "\signtool.exe") = 0 Then GUICtrlSetData($Log, @CRLF & "signtool.exe not found")
EndFunc   ;==>_CheckForFiles

Func _Run()
    $Executable = GUICtrlRead($File)
    If @error Then Exit
    GUICtrlSetData ($Log,"")
    DirCreate ("Certificates")
    $Password = GUICtrlRead($PasswordInput)
    $TimeStamp = GUICtrlRead($TimeStampInput)
    $Signer = GUICtrlRead($SignerInput)

    $Code1 = 'makecert.exe -r -n "CN=' & $Signer & '" -b 01/01/2013 -e 01/01/2099 -eku 1.3.6.1.5.5.7.3.3 -sv "Certificates\' & $Signer & '_cert.pvk" "Certificates\' & $Signer & '_cert.cer"'
    $Code2 = 'cert2spc.exe "Certificates\' & $Signer & '_cert.cer" "Certificates\' & $Signer & '_cert.spc"'
    $Code3 = 'pvk2pfx.exe -pvk "Certificates\' & $Signer & '_cert.pvk" -pi ' & $Password & ' -spc "Certificates\' & $Signer & '_cert.spc" -pfx "Certificates\' & $Signer & '_cert.pfx" -po ' & $Password
    $Code4 = 'signtool.exe sign /f "Certificates\' & $Signer & '_cert.pfx" /p ' & $Password & ' "' & $Executable & '"'
    $Code5 = 'signtool.exe timestamp /t "' & $TimeStamp & '" "' & $Executable & '"'

    $Run = Run('"' & @ComSpec & '" /c ' & $Code1, '', @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)
    If WinWait($sWindow1Header, "", 2) = 0 Then ;Wait for required window
        GUICtrlSetData($Log, GUICtrlRead($Log) & @CRLF & "$Code1 1st Required window did not open. Possibly due to existing certificate.")
    Else
        ControlSend($sWindow1Header,  '', "Edit1", $Password) ;Send password to window
        ControlSend ($sWindow1Header, '', "Edit2", $Password) ;Confirm password
        ControlClick($sWindow1Header, '', "Button1") ;Click OK button
    EndIf
    If WinWait($sWindow2Header, "", 2) = 0 Then ;Wait for required window
        GUICtrlSetData($Log, GUICtrlRead($Log) & @CRLF & "$Code1 2nd Required window did not open. Terminating process")
        Return
    Else
        ControlSend($sWindow2Header,  '', "Edit1", $Password) ;Send password to window
        ControlClick($sWindow2Header, '', "Button1") ;Click OK button
        ProcessWaitClose($Run)
        GUICtrlSetData($Log, GUICtrlRead($Log) & @CRLF & "$Code1=" & StdoutRead($Run))
    EndIf

    $Run = Run('"' & @ComSpec & '" /c ' & $Code2, '', @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)
    ProcessWaitClose($Run)
    GUICtrlSetData($Log, GUICtrlRead($Log) & "$Code2=" & StdoutRead($Run))

    $Run = Run('"' & @ComSpec & '" /c ' & $Code3, '', @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)
    ProcessWaitClose($Run)
    If StdoutRead($Run) = "" Then
        GUICtrlSetData($Log, GUICtrlRead($Log) & "$Code3=Blank. Probably OK" & @CRLF & StdoutRead($Run))
    Else
        GUICtrlSetData($Log, GUICtrlRead($Log) & "$Code3=" & @CRLF & StdoutRead($Run))
    EndIf

    $Run = Run('"' & @ComSpec & '" /c ' & $Code4, '', @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)
    ProcessWaitClose($Run)
    GUICtrlSetData($Log, GUICtrlRead($Log) & "$Code4=" & StdoutRead($Run))

    $Run = Run('"' & @ComSpec & '" /c ' & $Code5, '', @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)
    ProcessWaitClose($Run)
    $message = StdoutRead($Run)
    If StringInStr ($message, "Success") = 0 Then ;one space is returned if error ?
        GUICtrlSetData($Log, GUICtrlRead($Log) & "$Code5=Cannot get timestamp. Try again or change timestamp URL" & @CRLF)
    Else
        GUICtrlSetData($Log, GUICtrlRead($Log) & "$Code5=" & $message & @CRLF)
    EndIf
    GUICtrlSetData($Log, GUICtrlRead($Log) & "Finished")
EndFunc   ;==>_Run


Изменения:
- добавлена строка 7 - запрашиваем админские права
- добавлены строки 17,18 - заголовки окон вынесены в переменные
- в строках 117,120-122,124,128,129 заменены заголовки окон на соответствующие переменные

У меня такой вариант заработал, win7pro_x64_sp1_ru_ru
 
Верх