te($1gui)
Switch GUICtrlRead($Combo3)
case $Name10 ;salesExpert======================================================================================================================
global $sServer = 'ftp.edi.md'
global $sUsername = "userftp"
global $sPass = "passwords"
global $hOpen = _FTP_Open('MyFTP Control')
global $hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass, 1)
Global $s_Remote = "/SalesExpert/beta/" ;adresa la mapa cu versiuni la programe
Global $Tr_remote = "/Templates/Configurations/Osc.Transport.Service.exe.config" ;adresa la config transporta pe ftp
Global $DB_remote = "/Templates/Configurations/Osc.DB.Service.exe.config" ;adresa la db config pe ftp
;adresa la mapa cu DB versiuni
Global $Postgres_remote = "/DB/Postgre SQL x86/"
If @OSArch = "X64" Then ;проверяет разрядность ОС-системы
Global $Postgres_remote = "/DB/Postgre SQL x64/"
EndIf
Global $DBServ = "/DB/DBService2/"
Global $program= _FTP_DirSetCurrent($hConn,$s_Remote) ;setam adresa curenta pentru programa
global $aFile = _FTP_ListToArray2D($hConn,0) ;atribuim sa ne arate ce se afla in mapa
If GUICtrlRead($Combo2) = $Name3 then
$hGui = GUICreate("Release SalesExpert", 800, 600)
GUISetBkColor(0x00E0FFFF)
GUICtrlCreateLabel ("Data Base Config" ,5,10,200,20)
GUICtrlCreateLabel ("DBType" ,5,38,45,20)
$nInput1 = GUICtrlCreateInput('3', 60, 35, 200, 20)
GUICtrlCreateLabel ("URI value" ,5,68,60,20)
$nInput2 = GUICtrlCreateInput('net.tcp://localhost:5959/OscDBService', 60, 65, 200, 20)
GUICtrlCreateLabel ("DB Server" ,5,98,60,20)
$nInput3 = GUICtrlCreateInput('localhost', 60, 95, 200, 20)
GUICtrlCreateLabel ("DB Name" ,5,128,60,20)
$nInput4 = GUICtrlCreateInput('', 60, 125, 200, 20)
GUICtrlCreateLabel ("DB User" ,5,158,60,20)
$nInput5 = GUICtrlCreateInput('postgres', 60, 155, 200, 20)
GUICtrlCreateLabel ("DB Pass" ,5,188,60,20)
$nInput6 = GUICtrlCreateInput('', 60, 185, 200, 20,BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlCreateLabel ("Transport Service Config" ,300,10,300,20)
GUICtrlCreateLabel ("Timer Interval" ,300,38,80,20)
$nInput7 = GUICtrlCreateInput('60000', 375,35, 200, 20)
GUICtrlCreateLabel ("Office Code" ,305,68,60,20)
$nInput8 = GUICtrlCreateInput('', 375, 65, 200, 20)
GUICtrlCreateLabel ("DB Code" ,305,98,60,20)
$nInput9 = GUICtrlCreateInput('', 375, 95, 200, 20)
GUICtrlCreateLabel ("DB Service'value" ,305,118,80,40)
$nInput10 = GUICtrlCreateInput('net.tcp://localhost:5959/OscDBService', 375, 125, 200, 20)
GUICtrlCreateLabel ("PostgreSQL:" ,295,170,300,20)
GUICtrlCreateLabel ("Password" ,305,183,80,40)
$nInput11 = GUICtrlCreateInput('', 375, 180, 200, 20,BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
GUICtrlSetColor(-1, 0x505050)
GUICtrlCreateLabel ("Установить и бэк офис?" ,5,210,150,20)
$chekbox123 = GUICtrlCreateCheckbox ("" ,170,210,20,20)
If GUICtrlRead($chekboxTerminalsales) = $GUI_CHECKED then
GUICtrlCreateLabel ("Terminal Service Config" ,5,240,150,20)
GUICtrlCreateLabel ("MetaUri" ,5,265,60,20)
$nInput112 = GUICtrlCreateInput(@IPAddress1, 60, 265, 200, 20)
GUICtrlCreateLabel ("DBService" ,5,290,60,20)
$nInput113 = GUICtrlCreateInput('net.tcp://localhost:5959/OscDBService', 60, 290, 200, 20)
GUICtrlCreateLabel ("HHTPPort" ,5,315,60,20)
$nInput114 = GUICtrlCreateInput('', 60, 315, 200, 20)
GUICtrlCreateLabel ("Version program you want instal?" ,275,240,200,20)
GUICtrlCreateLabel ("What version prg?" ,275,270,100,30)
$Combov = GUICtrlCreateCombo("", 375,275,200,20)
If @error Then
MsgBox($MB_SYSTEMMODAL, '_FTP_Connect', 'ERROR connect to ftp=' & @error)
Else
For $i = 1 to $aFile[0][0] Step 1
GUICtrlSetData($Combov,$aFile[$i][0])
Next
EndIf
Global $db = _FTP_DirSetCurrent($hConn,$DBServ) ;setam adresa la mapa pentru DB
global $DbFile = _FTP_ListToArray2D($hConn,0) ;setam ca sa ne arate ce este in mapa
GUICtrlCreateLabel ("What version DB?" ,275,310,100,30)
$Combod = GUICtrlCreateCombo("", 375,315,200,20)
If @error Then
MsgBox($MB_SYSTEMMODAL, '_FTP_Connect', 'ERROR connect to ftp=' & @error)
Else
For $j = 1 to $DbFile[0][0] Step 1
GUICtrlSetData($Combod,$DbFile[$j][0])
Next
EndIf
Global $pg = _FTP_DirSetCurrent($hConn,$Postgres_remote) ;setam adresa la mapa pentru postgres
global $pgFile = _FTP_ListToArray2D($hConn,0)
GUICtrlCreateLabel ("What version PG?" ,275,345,100,30)
$Combopg = GUICtrlCreateCombo("", 375,350,200,20)
If @error Then
MsgBox($MB_SYSTEMMODAL, '_FTP_Connect', 'ERROR connect to ftp=' & @error)
Else
For $k = 1 to $pgFile[0][0] Step 1
GUICtrlSetData($Combopg,$pgFile[$k][0])
Next
EndIf
Else
GUICtrlCreateLabel ("Version program you want instal?" ,5,240,200,20)
GUICtrlCreateLabel ("What version prg?" ,5,270,100,30)
$Combov = GUICtrlCreateCombo("", 105,275,200,20)
If @error Then
MsgBox($MB_SYSTEMMODAL, '_FTP_Connect', 'ERROR connect to ftp=' & @error)
Else
For $i = 1 to $aFile[0][0] Step 1
GUICtrlSetData($Combov,$aFile[$i][0])
Next
EndIf
Global $db = _FTP_DirSetCurrent($hConn,$DBServ) ;setam adresa la mapa pentru DB
global $DbFile = _FTP_ListToArray2D($hConn,0) ;setam ca sa ne arate ce este in mapa
GUICtrlCreateLabel ("What version DB?" ,5,310,100,30)
$Combod = GUICtrlCreateCombo("",105,315,200,20)
If @error Then
MsgBox($MB_SYSTEMMODAL, '_FTP_Connect', 'ERROR connect to ftp=' & @error)
Else
For $j = 1 to $DbFile[0][0] Step 1
GUICtrlSetData($Combod,$DbFile[$j][0])
Next
EndIf
Global $pg = _FTP_DirSetCurrent($hConn,$Postgres_remote) ;setam adresa la mapa pentru postgres
global $pgFile = _FTP_ListToArray2D($hConn,0)
GUICtrlCreateLabel ("What version PG?" ,5,345,100,30)
$Combopg = GUICtrlCreateCombo("",105,350,200,20)
If @error Then
MsgBox($MB_SYSTEMMODAL, '_FTP_Connect', 'ERROR connect to ftp=' & @error)
Else
For $k = 1 to $pgFile[0][0] Step 1
GUICtrlSetData($Combopg,$pgFile[$k][0])
Next
EndIf
EndIf
GUISetState()
GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND')
$next = GUICtrlCreateButton ("Далее!",200,500,100,20)
$cancel1 = GUICtrlCreateButton ( "Отмена",320,500,100,20)
While 1
$msg = GUIGetMsg()
Select
Case $msg=$cancel
exit
case $msg=$next
GUISetState(@SW_HIDE)
_GDIPlus_Startup() ;тут я поставил часть того что вы мне дали, функций внизу кода.
Global Const $STM_SETIMAGE1 = 0x0172
Global $iW = 380, $iH = 260
Global $hG = GUICreate("Loading", $iW, $iH, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
Global $cPic = GUICtrlCreatePic("", 0, 0, $iW, $iH)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState()
Global $hHBmp_BG, $hB, $iPerc = 0, $iSleep = 20, $fPower = 4
GUIRegisterMsg($WM_TIMER, "PlayAnim")
DllCall("user32.dll", "int", "SetTimer", "hwnd", $hG, "int", 0, "int", $iSleep, "int", 0)
Global $hHBmp_BG, $hB, $iSleep = 20, $k
$iTimerID = _Timer_SetTimer($hG, $iSleep, '_PlayAnim')
Do
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
_Quite(1)
;~ GUIRegisterMsg($WM_TIMER, "")
;~ _WinAPI_DeleteObject($hHBmp_BG)
;~ _GDIPlus_Shutdown()
;~ GUIDelete()
;~ Exit
EndSwitch
Sleep(30)
$k += 1
ToolTip('Нажмите "ESC" для выхода.', Default, Default, 'Скрипт Работает: ' & $k & '%')
If $k = 100 Then
_Quite()
MsgBox(262144 + 64, 'Сообщение!', 'Программа установлена!')
Exit
EndIf
Until False
DirCreate("C:\IS\SalesExpert")
DirCreate("C:\IS\SalesExpertT")
DirCreate("C:\IS\OscDBService")
Local $oscDB = "C:\IS\OscDBService"
Local $SEt = "C:\IS\SalesExpertT"
Local $SE = "C:\IS\SalesExpert"
Global $localFile = @ScriptDir & GUICtrlRead($Combov) ;adresa failu de la programa pe comp
Global $DBvFile = @ScriptDir & GUICtrlRead($Combod) ;adresa la db fail pe com
Global $PGvFile = @ScriptDir & GUICtrlRead($Combopg) ;adresa la fisier la postgres pe comp
Global $Tfile = "C:\IS\SalesExpertT\Osc.Transport.Service.exe.config" ;adresa la config tra pe comp
Global $DBfile = "C:\IS\OscDBService\Osc.DB.Service.exe.config" ;adresa la db config pe comp
Global $s_RemoteFile = ($s_Remote & GUICtrlRead($Combov)) ;adresa la fisier ales de la programa pe ftp
Global $DB_RemoteFile = ($DBServ & GUICtrlRead($Combod)) ;adresa la db fisier ales pe ftp
Global $PG_RemoteFile = ($Postgres_remote & GUICtrlRead($Combopg)) ;adresa la postgres fisier ales pe ftp
Global $fisprog = _FTP_FileGet ($hConn,$s_RemoteFile,$localFile) ;descarcam pe comp fisieru cu programa
Global $fisDBS = _FTP_FileGet ($hConn,$DB_RemoteFile,$DBvFile) ;descarcam pe comp sisieru co db programa
Global $fisPG = _FTP_FileGet ($hConn,$PG_RemoteFile,$PGvFile)
Global $fisTRa = _FTP_FileGet ($hConn,$Tr_remote,$Tfile)
Global $fisDBSe = _FTP_FileGet ($hConn,$DB_remote,$DBfile)
If GUICtrlRead($chekboxTerminalsales) = $GUI_CHECKED then
Global $Terminal_remote = "/Templates/Configurations/Sales.Remote.Service.exe.config" ;adresa la config pentru terminal pe ftp
global $fisTerminal= "C:/IS/SalesExpertT/Sales.Remote.Service.exe.config" ;adresa la config pentru terminal pe comp
Global $fisDBS = _FTP_FileGet ($hConn,$Terminal_remote,$fisTerminal)
EndIf
FileMove ( $localFile ,@ScriptDir & "\SalesExpert.exe")
global $sales = @ScriptDir & "\SalesExpert.exe" & " /s"
Global $rename_sales = @ScriptDir & "\SalesExpert.exe"
Global $dir_sales= " /d"
Global $fin_sales = $sales & $dir_sales & $SE
Global $finT_sales = $sales & $dir_sales & $SEt
RunWait(@ComSpec & ' /c ' & $fin_sales,@ScriptDir)
RunWait(@ComSpec & ' /c ' & $finT_sales,@ScriptDir)
FileDelete ($rename_sales)