Steveiwonder Posted February 17, 2010 Share Posted February 17, 2010 You don't need to hold a database of each file if you use my method of making sure every file on the server is stored on the local machine. If each of your Clients have enough disk space and you don't mind having the patches on there then my method seems to work just fine. They call me MrRegExpMan Link to comment Share on other sites More sharing options...
madScientist Posted February 17, 2010 Share Posted February 17, 2010 I usually map a ftp to a drive letter and use microsoft's synctoy for this, but I will test your script and see if it's a better solution. Haven't had the time to read all the posts but do you make sure wow.exe is not running before updating? Link to comment Share on other sites More sharing options...
vtuls Posted February 18, 2010 Author Share Posted February 18, 2010 have'nt thought about that. the situation im thinking of is: "im getting an update from wow on my laptop when im not at home when i get home i start this script and it connects to my server computer wich has a simular script running. this script checks wich computers are on-line in my network and have wow installed. if they are in need of update the programm lets the client script know that he needs to update. then the client makes a conecction to the server folder where i store my updates, and coppies of them." this is how i am trying to script it as i am still a bit new to scripting im doing the best i can with the help of you guys im getting along very fast. but im still writing the master script, that is going to be installed on my laptop. after that im going to work on the distributor and after that the client. for all 3 im thinking of using a TCP or udp connection to get the programms communicating with one and another. but that will be the hardest part because those functions aren't so clear to me. a badly written code is better than a unwritten onea good written code is even better.but there is always room for improvement. :) Link to comment Share on other sites More sharing options...
Steveiwonder Posted February 18, 2010 Share Posted February 18, 2010 (edited) If you want simple then just have one script to do all the work that doesn't use TCP or UDP. Checking each file against Server / Client. Like i posted back on the first page. Edited February 18, 2010 by Steveiwonder They call me MrRegExpMan Link to comment Share on other sites More sharing options...
vtuls Posted February 18, 2010 Author Share Posted February 18, 2010 ok im bushed.Steveiwonder: nice script have read it thru and your getting ahead of the work im doing.and you are asuming im the one who is working on all the computers my self, but that is'nt true.one of the computers is a laptop that belongs to my mom i some times borrow it from her if my friends comes over to play some games.and one of them does'nt habve his laptop with him.as my friends live about 50 kilomiters away from me its not so easey to get his laptop and come back.so i want to run a silent script on the client that the user (my mom) does'nt get worried about.wel that said im taking a break from programming for now.i will keep track of the topic but im not actively doing anything this weekend.i'll be working on it again on Monday a badly written code is better than a unwritten onea good written code is even better.but there is always room for improvement. :) Link to comment Share on other sites More sharing options...
Steveiwonder Posted February 19, 2010 Share Posted February 19, 2010 so i want to run a silent script on the client that the user (my mom) does'nt get worried about.I dont understand whats not silent about this script, you just need to remove the traytips. They call me MrRegExpMan Link to comment Share on other sites More sharing options...
vtuls Posted February 25, 2010 Author Share Posted February 25, 2010 this is how my vision of the programm is:Master programm: (runs on my laptop)1. Find location of WOW installation2. Get Updates in to a list.3. Connect with server programm4. Tell server about new updates.5. Coppy updates to server location.Server programm: (runs on my server @ home)1. Wait till master progamm or client connects.2. Send or receive list of updates from master/client3. Send or receive update filesClient ( Runs on the other computers i have @ home)1. Find location of WOW installation2. Get Updates in to a list.3. Compare local list to list on server. 4. If out of date get updates from server location Else end programm.5. Run the updates in silent mode if possiblethere are still some things i need to research for this programm.and so this is going to be a very long process and topic,but it keeps me off the street and from cousing any trouble. (kidding about the trouble) a badly written code is better than a unwritten onea good written code is even better.but there is always room for improvement. :) Link to comment Share on other sites More sharing options...
vtuls Posted March 8, 2010 Author Share Posted March 8, 2010 took a sebattecall and have thought about your idea of using 1 programm for both functions. i think that its even easier to do it your way. ill get back on programming tonight and ill post my progress a badly written code is better than a unwritten onea good written code is even better.but there is always room for improvement. :) Link to comment Share on other sites More sharing options...
vtuls Posted March 22, 2010 Author Share Posted March 22, 2010 hey all expandcollapse popup; wow update manager. ; find the wow.exe file get its location. ; check with update list if there is an update. ; if there is get it from a centralized place ; programmer: Vincent Tuls ; starting date: 14-02-2010 ; last edited: 22-03-2010 #Include <File.au3> #Include <Array.au3> $dir = @ScriptDir & "\" $settings = $dir & "settings.ini" $updatedb = "updates.txt" $i = 0 $chk_pt = 0 if FileExists($settings) = 0 then ;getting location $loc = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Blizzard Entertainment\World of Warcraft", "InstallPath") ;msgbox(0, "wow loc", $loc) ;writing location to settings.ini IniWrite($dir & "\settings.ini", "variables", "GameLocation",$loc) $ServerLoc = InputBox("Server Location", "please enter the Path to where you can find the server updates.") IniWrite($dir & "\settings.ini", "variables", "ServerLocation",$Serverloc) else ;file exists $loc = IniRead($settings, "variables", "GameLocation","?") if $loc =Not "C:\*.*" then $loc = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Blizzard Entertainment\World of Warcraft", "InstallPath") IniWrite($dir & "\settings.ini", "variables", "GameLocation",$loc) EndIf $serverloc = IniRead($settings, "variables", "ServerLocation","?") TrayTip("location", "got location: " & $loc,2) EndIf $LocalArray= _FileListToArray($loc, "wow-*-patch.exe",1) $ServerArray= _FileListToArray($Serverloc, "wow-*-patch.exe",1) ; check if there are files in the server Folder if $ServerArray = 0 then select case @error = 1 msgbox(0,"error", "Server Path not found") case @error = 2 msgbox(0,"error", "error 2") case @error = 3 msgbox(0,"error", "error 3") case @error = 4 msgbox(0,"error", "Server Folder empty") call("cppyallsvr") EndSelect else $size = $LocalArray[0] - $ServerArray[0] select case $size = 0 MsgBox( 0, "up to date","Your wow Folder and server are up to date") case $size > 0 msgbox(0, "Update For Server", "there is an update on your laptop for the server") call("Cppysvr") case $size < 0 Msgbox(0, "need updates from server", "the folder on server has updates for you") call("CppyfrmSvr") EndSelect endif Func Cppyallsvr() ;copy all updates of WOW For $i = 1 to $Localarray[0] step 1 if FileExists($ServerLoc & "\" & $LocalArray[$i]) = 0 then FileCopy($loc & "\" & $LocalArray[$i], $ServerLoc,0) EndIf next traytip("Coppy Finished", "All files are coppied to the server",5) sleep(1000) EndFunc Func Cppysvr() ;copy updates of WOW to server For $i = 1 to $Localarray[0] step 1 if FileExists($ServerLoc & "\" & $LocalArray[$i]) = 0 then FileCopy($loc & "\" & $LocalArray[$i], $ServerLoc,0) EndIf next traytip("Coppy Finished", "All files are coppied to the server",5) sleep(1000) EndFunc Func CppyfrmSvr() ;copy all updates of WOW from server For $i = 1 to $ServerArray[0] step 1 if FileExists($LocalArray & "\" & $ServerLoc[$i]) = 0 then FileCopy($loc & "\" & $LocalArray[$i], $ServerLoc,0) EndIf next traytip("Coppy Finished", "All files are coppied from the server",5) sleep(1000) EndFunc as you can see i have returned to a one programm does all strategy. havn't quite tested all yet but works - from pc to empty server folder - from pc to server folder the programm also shows some simularity with steveiwonders suggestion. a badly written code is better than a unwritten onea good written code is even better.but there is always room for improvement. :) Link to comment Share on other sites More sharing options...
vtuls Posted April 15, 2010 Author Share Posted April 15, 2010 hi all here an update on how im doing i have so far managed to pull of: - getting the install folder from registry - reading patches in to an array local side - reading patches in to an array server side - comparing the 2 arrays and copy the updates to either side - get a listview of the Addons installed local - coppy addons to folder located on server and im still working on: - listing server side addons - copying addons from server to local - fixing little bug's but here's the code i have thus far: expandcollapse popup; wow update manager. ; find the wow.exe file get its location. ; check with update list if there is an update. ; if there is get it from a centralized place ; read out Addons folder and copy the addons either way ; programmer: Vincent Tuls ; starting date: 14-02-2010 ; last edited: 15-04-2010 #Include <File.au3> #Include <Array.au3> #include <GUIConstants.au3> #include <GuiListView.au3> #Include <Constants.au3> $dir = @ScriptDir & "\" $settings = $dir & "settings.ini" $updatedb = "updates.txt" $i = 0 $chk_pt = 0 ;$loc2 = IniRead($settings, "variables", "GameLocation","?") & "interface\addons\" ;$LocalArray2= _FileListToArray($loc2, "*",2) ;$serverloc2 = Dim $d[100] global $i, $i2 $g_box= guicreate("Addons",600,700) $g_list = GUICtrlCreateListView("addons" ,10 ,10 ,580 ,580, 0x0003, 0x00000204) $g_but_coppy_frmsrv = GUICtrlCreateButton("copy <- server", 10,590,120,30) $g_but_coppy_tosrv = GUICtrlCreateButton("copy -> server", 130,590,120,30) Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. $1 = TrayCreateitem("addons") if FileExists($settings) = 0 then ; ;getting location $loc = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Blizzard Entertainment\World of Warcraft", "InstallPath") ;msgbox(0, "wow loc", $loc) ;writing location to settings.ini IniWrite($dir & "\settings.ini", "variables", "GameLocation",$loc) $ServerLoc = InputBox("Server Location", "please enter the Path to where you can find the server updates.") IniWrite($dir & "\settings.ini", "variables", "ServerLocation",$Serverloc) $check = InputBox("silent or not", "please enter true to run this programm silent or false to show its progress","fals") IniWrite($dir & "\settings.ini", "variables", "check_silent",$check) else ;file exists $loc = IniRead($settings, "variables", "GameLocation","?") if $loc =Not "C:\*.*" then $loc = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Blizzard Entertainment\World of Warcraft", "InstallPath") IniWrite($dir & "\settings.ini", "variables", "GameLocation",$loc) EndIf $check = IniRead($dir & "\settings.ini", "variables", "check_silent","?") $serverloc = IniRead($settings, "variables", "ServerLocation","?") $loc2 = IniRead($settings, "variables", "GameLocation","?") & "interface\addons\" $serverloc2 = IniRead($settings, "variables", "ServerLocation","?")& "addons\" TrayTip("location", "got location: " & $loc,2) EndIf $loc2 = IniRead($settings, "variables", "GameLocation","?") & "interface\addons\" $serverloc2 = IniRead($settings, "variables", "ServerLocation","?")& "addons\" $LocalArray= _FileListToArray($loc, "wow-*-patch.exe",1) $ServerArray= _FileListToArray($Serverloc, "wow-*-patch.exe",1) ; check if there are files in the server Folder if $ServerArray = 0 then select case @error = 1 msgbox(0,"error", "Server Path not found") case @error = 2 msgbox(0,"error", "error 2") case @error = 3 msgbox(0,"error", "error 3") case @error = 4 msgbox(0,"error", "Server Folder empty") call("cppyallsvr") EndSelect else $size = $LocalArray[0] - $ServerArray[0] select case $size = 0 MsgBox( 0, "up to date","Your wow Folder and server are up to date",3) case $size > 0 msgbox(0, "Update For Server", "there is an update on your laptop for the server",3) call("Cppysvr") case $size < 0 Msgbox(0, "need updates from server", "the folder on server has updates for you",3) call("CppyfrmSvr") EndSelect endif ;section for copying addons $serverArray2= _FileListToArray($Serverloc2, "*",2) if $serverArray2 = 0 then select case @error = 1 msgbox(0,"error", "Server Path not found") case @error = 2 msgbox(0,"error", "error 2") case @error = 3 msgbox(0,"error", "error 3") case @error = 4 msgbox(0,"error", "Server Folder empty") GUICtrlSetState($g_but_coppy_frmsrv, $GUI_DISABLE) call("addons1") EndSelect else for $10 = 1 to 6000 step 1 $msg = TrayGetMsg() Select Case $msg = $1 call("addons1") EndSelect next EndIf exit Func Cppyallsvr() ;copy all updates of WOW ProgressOn("Progress Meter", "copying files", "0 percent") $i2 = 100 / $localarray[0] For $i = 1 to $Localarray[0] step 1 if FileExists($ServerLoc & "\" & $LocalArray[$i]) = 0 then FileCopy($loc & "\" & $LocalArray[$i], $ServerLoc,0) $i3 = $i2 * $i ProgressSet($i3, $i &"/" & $localarray[0]) EndIf next traytip("Coppy Finished", "All files are coppied to the server",5) ProgressOff() sleep(1000) EndFunc Func Cppysvr() ;copy updates of WOW to server progressOn("Progress Meter", "copying files", "0 percent") $i2 = 100 / $localarray[0] For $i = 1 to $Localarray[0] step 1 if FileExists($ServerLoc & "\" & $LocalArray[$i]) = 0 then FileCopy($loc & "\" & $LocalArray[$i], $ServerLoc,0) $i3 = $i2 * $i ProgressSet($i3, $i &"/" & $localarray[0]) EndIf next traytip("Coppy Finished", "All files are coppied to the server",5) ProgressOff() sleep(1000) EndFunc Func CppyfrmSvr() ;copy all updates of WOW from server ProgressOn("Progress Meter","copying files" , "0 percent") $i2 = 100 / $ServerArray[0] For $i = 1 to $ServerArray[0] step 1 if FileExists($LocalArray & "\" & $ServerLoc[$i]) = 0 then FileCopy($loc & "\" & $LocalArray[$i], $ServerLoc,0) $i3 = $i2 * $i ProgressSet( $i3, $i &"/" & $ServerArray[0]) EndIf next traytip("Coppy Finished", "All files are coppied from the server",5) ProgressOff() sleep(1000) EndFunc func Addons1() $LocalArray2= _FileListToArray($loc2, "*",2) if $LocalArray2= 0 Then ; local folder error select case @error = 1 msgbox(0,"error", "Local Path not found") case @error = 2 msgbox(0,"error", "error 2") case @error = 3 msgbox(0,"error", "error 3") case @error = 4 msgbox(0,"error", "Local Folder empty") ; programm reads from server location GUICtrlSetState($g_but_coppy_tosrv, $GUI_DISABLE) for $i = 1 to $serverArray2[0] step 1 $d[$i]= GUICtrlCreateListViewItem("addons",$g_list) GUICtrlSetData($d[$i],$serverArray2[$i]) Next EndSelect else ; program reads from local location EndIf for $i = 1 to $LocalArray2[0] step 1 $d[$i]= GUICtrlCreateListViewItem("addons",$g_list) GUICtrlSetData($d[$i],$LocalArray2[$i]) Next ;GuiCtrlSetState(-1,$GUI_DROPACCEPTED) Do $msg = GuiGetMsg () Select Case $msg = $g_but_coppy_tosrv call("adns_to_srv") Case $msg = $g_but_coppy_frmsrv call("adns_frm_srv") EndSelect Until $msg = $GUI_EVENT_CLOSE EndFunc func adns_frm_srv() ProgressOn("Progress Meter","copying files from Server location" , "0 percent") $i4 = 100 / $localarray[0] for $i = 1 to $LocalArray2[0] step 1 $i2 = $i -1 Local $is_Checked = _GUICtrlListViewGetCheckedState ($g_list, $i2) If ($is_Checked <> $LV_ERR) Then If ($is_Checked) Then ;msgbox(0,"Addons", GUICtrlRead($d[$i]) & " Item is Checked") dirCopy($serverloc2[$i], $loc2 & $serverloc2[$i],1) $i3 = $i4 * $i ProgressSet( $i3, $i &"/" & $ServerArray2[0]) Else ;msgbox(0,"Addons", GUICtrlRead($d[$i]) & " Item not Checked") EndIf EndIf ;MsgBox(0, "addons coppy", ;GUICtrlRead($d[$i]) & " state =" & GUICtrlGetState($d[$i]) ) Next ProgressOff() Exit EndFunc func adns_to_srv() ProgressOn("Progress Meter","copying files to server location" , "0 percent") $i4 = 100 / $localarray[0] for $i = 1 to $LocalArray2[0] step 1 $i2 = $i -1 Local $is_Checked = _GUICtrlListViewGetCheckedState ($g_list, $i2) If ($is_Checked <> $LV_ERR) Then If ($is_Checked) Then ;msgbox(0,"Addons", GUICtrlRead($d[$i]) & " Item is Checked") dirCopy($loc2 & $LocalArray2[$i], $serverloc & "\addons\" & $LocalArray2[$i],1) $i3 = $i4 * $i ProgressSet( $i3, $i &"/" & $LocalArray2[0]) Else ;msgbox(0,"Addons", GUICtrlRead($d[$i]) & " Item not Checked") EndIf EndIf ;MsgBox(0, "addons coppy", ;GUICtrlRead($d[$i]) & " state =" & GUICtrlGetState($d[$i]) ) Next ProgressOff() Exit EndFunc i have also included the files for this program:wow updater@home.au3 a badly written code is better than a unwritten onea good written code is even better.but there is always room for improvement. :) Link to comment Share on other sites More sharing options...
vtuls Posted April 20, 2010 Author Share Posted April 20, 2010 (edited) ok i've got the things working now - the program lists the addons that are on the server- shows the addons in a listview- checks wich addons i have selected ( due to a autoit version difference between writing platform(v3.2.2.0) and testing platform(V3.6.0) had some trouble with the "_guictrlgetlistviewitemChecked" but sorted that out.- the progamm now flawwlesly gets my selected addons from the server location and puts them in the addon folderthings im adding, or trying to at least:- deleting an addon from local folder - copying WTF folder from local to server and back again.- saving multiple WTF folders for different users.Note:"updating the server Addons update jour local addon via the internet and then just use the coppy function and it will overwrite the existing addon" Edited April 20, 2010 by vtuls a badly written code is better than a unwritten onea good written code is even better.but there is always room for improvement. :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now