TicTaC Posted April 18, 2006 Posted April 18, 2006 Too complicated for me & too much to read through. From your first post i've taken the FileCopy sections and come up with this. $cod2 = (@ProgramFilesDir & "\Activision\Call Of Duty 2") FileCopy("C:\WINDOWS\Patch\1.0\CoD2SP_s.exe", $cod2, 1) FileCopy("C:\WINDOWS\Patch\1.0\CoDMP.exe", $cod2, 1) FileCopy("C:\WINDOWS\Patch\1.0\CoD2MP_s.exe", $cod2, 1) FileCopy("C:\WINDOWS\Patch\1.0\mss32.dll", $cod2, 1) FileCopy("C:\WINDOWS\Patch\1.0\gfx_d3d_mp_x86_s.dll", $cod2, 1) FileCopy("C:\WINDOWS\Patch\1.0\gfx_d3d_x86_s.dll", $cod2, 1) FileDelete($cod2 & "\pb\pbags.dll") FileDelete($cod2 & "\pb\pbcl.dll") FileDelete($cod2 & "\pb\pbcls.dll") FileDelete($cod2 & "\pb\pbsv.dll") DirRemove($cod2 & "\pb\htm", 1) DirRemove($cod2 & "\pb\dll", 1) FileDelete($cod2 & "\version.inf") FileDelete($cod2 & "\cod2patch.ini") FileDelete($cod2 & "\main\iw_15.iwd") FileDelete($cod2 & "\main\localized_english_iw11.iwd") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Activision\Call of Duty 2\","Version","REG_SZ", 1.0) DirCreate($cod2 & "\pb\dll") DirCreate($cod2 & "\pb\htm") FileCopy("C:\WINDOWS\Patch\1.2\CoD2SP_s.exe",$cod2) FileCopy("C:\WINDOWS\Patch\1.2\CoDMP.exe.exe",$cod2) FileCopy("C:\WINDOWS\Patch\1.2\CoD2MP_s.exe",$cod2) FileCopy("C:\WINDOWS\Patch\1.2\cod2patch.ini",$cod2) FileCopy("C:\WINDOWS\Patch\1.2\version.inf",$cod2) FileCopy("C:\WINDOWS\Patch\1.2\gfx_d3d_mp_x86_s.dll",$cod2) FileCopy("C:\WINDOWS\Patch\1.2\gfx_d3d_x86_s.dll",$cod2) FileCopy("C:\WINDOWS\Patch\1.2\main\iw_15.iwd",$cod2 & "\main") FileCopy("C:\WINDOWS\Patch\1.2\main\localized_english_iw11.iwd",$cod2 & "\main") FileCopy("C:\WINDOWS\Patch\1.2\pbag.dll",$cod2 & "\pb", 1) FileCopy("C:\WINDOWS\Patch\1.2\pbags.dll",$cod2 & "\pb", 1) FileCopy("C:\WINDOWS\Patch\1.2\pbcl.dll",$cod2 & "\pb", 1) FileCopy("C:\WINDOWS\Patch\1.2\pbcls.dll",$cod2 & "\pb", 1) FileCopy("C:\WINDOWS\Patch\1.2\pbsv.dll",$cod2 & "\pb", 1) FileCopy("C:\WINDOWS\Patch\1.2\lc001203.htm",$cod2 & "\pb\htm\", 1) FileCopy("C:\WINDOWS\Patch\1.2\mc001203.htm",$cod2 & "\pb\htm\", 1) FileCopy("C:\WINDOWS\Patch\1.2\wc001203.htm",$cod2 & "\pb\htm\", 1) FileCopy("C:\WINDOWS\Patch\1.2\ws001105.htm",$cod2 & "\pb\htm\", 1) FileCopy("C:\WINDOWS\Patch\1.2\wc001203.dll",$cod2 & "\pb\dll\", 1) FileCopy("C:\WINDOWS\Patch\1.2\ws001105.dll",$cod2 & "\pb\dll\", 1) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Activision\Call of Duty 2\","Version","REG_SZ", 1.2) Should do what you want. Note, use the '1' flag to delete a directory and its contents eg DirRemove($cod2 & "\pb\htm", 1)
Erik. Posted April 18, 2006 Author Posted April 18, 2006 (edited) Wtf and you did that so simpley jezus how to do that when i have my program files at D:\? i have the game on D:\ other program on the C:\ Thanks for that!! Edited April 18, 2006 by Erik. I little problem, hard to find and fix
TicTaC Posted April 18, 2006 Posted April 18, 2006 If the script/program is run from D:\ then @ProgramFilesDir points to D:\ or if you like, instead of using the macro @ProgramFilesDir you could make the variable $cod2 to = D:\Program Files\Activision etc
Erik. Posted April 20, 2006 Author Posted April 20, 2006 Hello, How can i mae something that the program looks where the Call of Duty 2 folder is at what harddisk and then it's make a marco of it. so when you run it he will look where it's installed and then make the marco like this: normaly its: $cod2 = (@ProgramFilesDir & "\Activision\Call Of Duty 2") but how to made it so it first look in what harddisk it's installed? like this C:\Program Files\ D:\Program Files\ E:\Program Files\ it looks where its installed and the its set this: $cod2 = (D:\ProgramFilesDir & "\Activision\Call Of Duty 2") ore something like that do you know what i mean? it's dificult to explain I little problem, hard to find and fix
TicTaC Posted April 20, 2006 Posted April 20, 2006 (edited) $searchC = ("C:\Program Files\Activision\Call of Duty 2\CoD2MP_s.exe") $searchD = ("D:\Program Files\Activision\Call Of Duty 2\CoD2MP_s.exe") $searchE = ("E:\Program Files\Activision\Call Of Duty 2\CoD2MP_s.exe") If FileExists($searchC) Then $cod2 = ("C:\Program Files\Activision\Call Of Duty 2") EndIf If FileExists($searchD) Then $cod2 = ("D:\Program Files\Activision\Call Of Duty 2") EndIf If FileExists($searchE) Then $cod2 = ("E:\Program Files\Activision\Call Of Duty 2") EndIf FileCopy("C:\WINDOWS\Patch\1.2\CoD2MP_s.exe", $cod2, 1) FileCopy("C:\WINDOWS\Patch\1.2\main\localized_english_iw11.iwd", $cod2 & "\main", 1) I think that will work. Searches for the CoD2MP_s.exe on drives C, D & E if they exist and if found on E:\ for example, makes $cod2 = E:\Program Files\etc I'd like to know if there's an easier/shorter way of doing it. Edited April 20, 2006 by TicTaC
Valuater Posted April 20, 2006 Posted April 20, 2006 1what if that exe file is on more than 1 drive????2per help; Do not overwrite but create directory structure if it doesn't existFileCopy("C:\Temp\*.txt", "C:\Temp\TxtFiles", 8); FALSE - 'TxtFiles' works here like a single file name (like DOS "copy file1 + file2 +...")FileCopy("C:\Temp\*.txt", "C:\Temp\TxtFiles\", 8); RIGHT - 'TxtFiles' is now the target directory and the file names are given by the source names8)
TicTaC Posted April 20, 2006 Posted April 20, 2006 1what if that exe file is on more than 1 drive???Yeah, i did think of that but i'm trying to keep things simple for Erik and in most, if not all, cases the game is only going to be installed on one drive.I did think about scanning for all instances of the exe and letting the client choose where to install but as i said i'm keeping it simple
Erik. Posted April 20, 2006 Author Posted April 20, 2006 You only find the file at the game directory so, I can also let it look at a dll files that file is unic. Thanks i will try to make it I little problem, hard to find and fix
Erik. Posted April 23, 2006 Author Posted April 23, 2006 (edited) Hi, $searchC = ("C:\Program Files\Activision\Call of Duty 2\CoD2MP_s.exe") If FileExists($searchC) Then $cod2 = ("E:\Program Files\Activision\Call Of Duty 2") EndIf Works But how to search when the CoD2MP_s.exe is not into a Program Files folder but into C:/Games? in the register you can see where you the cod2 is installed in the register: HKEY_LOCAL_MACHINE/SOFTWARE/ACTIVISION/Call of Duty 2/EXEString REG_SZ HKEY_LOCAL_MACHINE/SOFTWARE/ACTIVISION/Call of Duty 2/MulitiEXEString REG_SZ $search = RegRead("HKEY_LOCAL_MACHINE/SOFTWARE/ACTIVISION/Call of Duty 2/MulitiEXEString REG_SZ","EXEString" If FileExists($search) Then $cod2 = ("C:\Program Files\Activision\Call Of Duty 2") EndIf How to do that? Edited April 23, 2006 by Erik. I little problem, hard to find and fix
Moderators SmOke_N Posted April 23, 2006 Moderators Posted April 23, 2006 ???What's your specific question? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Erik. Posted April 23, 2006 Author Posted April 23, 2006 Sorry i want to read form the registery where the game is installed. How to do ? i want to make a macro of it so i can do this: $search = RegRead("HKEY_LOCAL_MACHINE/SOFTWARE/ACTIVISION/Call of Duty 2/MulitiEXEString REG_SZ","EXEString" If ($search) Then $cod2 = ("C:\Program Files\Activision\Call Of Duty 2") EndIf it must set $cod2 what it reads from the registery how to do that? I little problem, hard to find and fix
Moderators SmOke_N Posted April 23, 2006 Moderators Posted April 23, 2006 Sorry i want to read form the registery where the game is installed. How to do ? i want to make a macro of it so i can do this: $search = RegRead("HKEY_LOCAL_MACHINE/SOFTWARE/ACTIVISION/Call of Duty 2/MulitiEXEString REG_SZ","EXEString" If ($search) Then $cod2 = ("C:\Program Files\Activision\Call Of Duty 2") EndIf it must set $cod2 what it reads from the registery how to do that?Well first off, if 'EXEString' gives the actual location, then all you need to do is $cod2 = $search. $search = RegRead("HKEY_LOCAL_MACHINE/SOFTWARE/ACTIVISION/Call of Duty 2/MulitiEXEString REG_SZ", "EXEString") MsgBox(0, 'Reg String', $search); This is just to see so you understand what $search is returning. If FileExists($search) Then $cod2 = $search Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Xenobiologist Posted April 23, 2006 Posted April 23, 2006 Hi, $installPath= RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Activision\Call of Duty 2", "InstallPath") MsgBox(0, 'Reg String', $installPath) So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
Erik. Posted April 24, 2006 Author Posted April 24, 2006 Hi, how can i make a code at the site? if you post a code i see CODE then the code how to do it? I little problem, hard to find and fix
TicTaC Posted April 24, 2006 Posted April 24, 2006 th.meger has pretty much answered your question and posted the code. So, FileCopy("C:\WINDOWS\Patch\1.2\main\localized_english_iw11.iwd", $InstallPath & "\main", 1)
Erik. Posted April 24, 2006 Author Posted April 24, 2006 No,i do not mean that:P at the forum at this site:P You see when the post something the code but above the code you see the text CODE how to do that? I little problem, hard to find and fix
Xenobiologist Posted April 24, 2006 Posted April 24, 2006 No,i do not mean that:Pat the forum at this site:PYou see when the post something the code but above the code you see the text CODEhow to do that?HI, if you hit reply, look at the toolbar ahed and wait for the tooltips. There you'll find the icons at the right site for quote and code. So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
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