oleg Posted March 14, 2006 Share Posted March 14, 2006 (edited) Can somebody explain why this script locks the taskbar ? Its even impossible to press start button when it finishes ? Any #include <GUIConstants.au3> #include <Constants.au3> Opt("WinTitleMatchMode",2) ;Check If Any Commandline Parameters Exists If $cmdline[0]< 1 Then MsgBox(16,"Error","No Key Passed") Exit EndIf ;Close Other Open Instances ProcessClose("Autorun.exe") ProcessClose("The Battle for Middle-earth II_code.exe") FileInstall("Resources\logo.jpg",@TempDir&"\logo.jpg",1) $LEFT_P = 0 $HEIGHT_P = 0 ;$LEFT_P = (@DesktopWidth - 1024) / 2 ;$HEIGHT_P = (@DesktopHeight - 768) / 2 $BFME2 = GUICreate("",1024,768,$HEIGHT_P,$HEIGHT_P,$WS_POPUPWINDOW,$WS_EX_TOPMOST) GUICtrlCreatePic(@TempDir&"\logo.jpg","","",1024,768) GUISetState (@SW_SHOW) $GAMEPATH = "D:\Games\Electronic Arts\The Battle for Middle-earth II" ;$ERROR = @error ;$GAMEPATH = StringTrimRight($GAMEPATH,1) ;If $ERROR = 1 THEN ; MsgBox(262144,"Error","Install Path Value Not Found"&@CRLF&"Using Default",5) ; Exit ; RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\Electronic Arts\The Battle for Middle-earth II","InstallPath","REG_SZ","C:\Program Files\Electronic Arts\The Battle for Middle-earth II") ; $GAMEPATH = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\Electronic Arts\The Battle for Middle-earth II","InstallPath") ;EndIf FileDelete($GAMEPATH&"\Game2.dat") Run("Autorun.exe",@ScriptDir,@SW_HIDE ) WinWait("The Battle for Middle-earth II","Before continuing with the installation process",30) WinSetState("The Battle for Middle-earth II","Before continuing with the installation process", @SW_HIDE ) ControlClick("The Battle for Middle-earth II","","Button1","Left") $KEY = StringSplit($cmdline[1],"-") $KEY1 = $KEY[1] $KEY2 = $KEY[2] $KEY3 = $KEY[3] $KEY4 = $KEY[4] $KEY5 = $KEY[5] WinWait("The Battle for Middle-earth II","Please enter the entire code",30) WinSetState("The Battle for Middle-earth II","", @SW_HIDE ) ControlSetText("The Battle for Middle-earth II","","Edit1",$KEY1) ControlSetText("The Battle for Middle-earth II","","Edit2",$KEY2) ControlSetText("The Battle for Middle-earth II","","Edit3",$KEY3) ControlSetText("The Battle for Middle-earth II","","Edit4",$KEY4) ControlSetText("The Battle for Middle-earth II","","Edit5",$KEY5) Sleep( 1000 ) ControlClick("The Battle for Middle-earth II","","Button3","Left") WinWait("The Battle for Middle-earth II","Typical User",30) WinSetState("The Battle for Middle-earth II","", @SW_HIDE ) ControlSetText("The Battle for Middle-earth II","","Edit1","") ControlSetText("The Battle for Middle-earth II","","Edit1",$GAMEPATH) ControlCommand("The Battle for Middle-earth II","","Button2","Check", "") ControlClick("The Battle for Middle-earth II","","Button4","Left") WinWait("The Battle for Middle-earth II","",30) WinSetState("The Battle for Middle-earth II","", @SW_HIDE ) ControlClick("The Battle for Middle-earth II","","Button3","Left") WinWait("Firewall Detected","",3) if WinExists("Firewall Detected","") Then ProcessClose("Autorun.exe") Check() EndIf WinWait("The Battle for Middle-earth II","",3) if WinExists("The Battle for Middle-earth II","") Then ProcessClose("Autorun.exe") EndIf GUIDelete($BFME2) Func Check() If Not FileExists ($GAMEPATH&"\Game2.dat") Then MsgBox(262160,"Error","Key Not Installed") Exit EndIf EndFunc Exit Edited March 14, 2006 by oleg There is a hex ( 31303030303030 ) reasons i love AutoIt ! Link to comment Share on other sites More sharing options...
Valuater Posted March 14, 2006 Share Posted March 14, 2006 this is not an executable for starters $GAMEPATH = "D:\Games\Electronic Arts\The Battle for Middle-earth II" no... exe 8) Link to comment Share on other sites More sharing options...
oleg Posted March 14, 2006 Author Share Posted March 14, 2006 Can somebody explain why this script locks the taskbar ? Its even impossible to press start button when it finishes ?Any Yes i know as it sates its gamepath There is a hex ( 31303030303030 ) reasons i love AutoIt ! Link to comment Share on other sites More sharing options...
oleg Posted March 14, 2006 Author Share Posted March 14, 2006 Found it Autorun exe was leaving an open dialogue when process was closed this blocked taskbar There is a hex ( 31303030303030 ) reasons i love AutoIt ! Link to comment Share on other sites More sharing options...
FreeFry Posted March 14, 2006 Share Posted March 14, 2006 I'm just curious, what does this program really do? automate the installation of the game? Link to comment Share on other sites More sharing options...
oleg Posted March 15, 2006 Author Share Posted March 15, 2006 (edited) I'm just curious, what does this program really do? automate the installation of the game?Exactly Its not that we need to automate the process itself for game install .Its that installation Encrypt cd key that user input depending on some system data like Windows PIDHard Drive Serial NumberCD Key Usedinto a file inside install dir when installing .While in game its checks all above data and if there any mismatch or same data its throws you out So basically when you have a lot of different machines its gives you a headech to make it run correctly .The actual goal of this automation is to Manage CD Keys Automatically / Dynamically see what i mean ? Edited March 15, 2006 by oleg There is a hex ( 31303030303030 ) reasons i love AutoIt ! Link to comment Share on other sites More sharing options...
FreeFry Posted March 16, 2006 Share Posted March 16, 2006 Hmm okay... well, if i've understod it right you want to be able to change the cdkey? or am i wrong there? anyways, if you just want to change cdkey, doesent is work to just change it in the system regristry? cus i found my cdkey of the game in HKLM\Software\Electronic Arts\Electronic Arts\The Battle for Middle-earth II\ergc I dunno if that works as you mentionen some kind of encryption thingylingy 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