Sign in to follow this  
Followers 0
psgame_freak

Need Help with FileInstall

6 posts in this topic

#1 ·  Posted (edited)

I want my script to be able to compile the files I named but:

-I don't know where the script is saved when it is compiled

-The files and the script are in the same directory

One I have below does not work:

Func installcrack()
$worldedit_crack = FileInstall("" & @ScriptDir & "\worldedit.exe", "C:\Program Files\Warcraft III\worldedit.exe",1)
$war3_crack = FileInstall("" & @ScriptDir & "\war3.exe","C:\Program Files\Warcraft III\war3.exe",1)
EndFunc

Func removecrack()
$worldedit = FileInstall("" & @ScriptDir & "\Original\worldedit.exe", "C:\Program Files\Warcraft III\worldedit.exe",1)
$war3 = FileInstall("" & @ScriptDir & "\Original\war3.exe","C:\Program Files\Warcraft III\war3.exe",1)
EndFunc
Edited by psgame_freak

Share this post


Link to post
Share on other sites



From the FileInstall help. I emphasized the important part for you.

FileInstall ( "source", "dest" [, flag] )

Parameters

source The source path of the file to compile. This must be a literal string; it cannot be a variable.

dest The destination path of the file with trailing backslash if only the directory is used. This can be a variable.

flag [optional] this flag determines whether to overwrite files if they already exist:

0 = (default) do not overwrite existing files

1 = overwrite existing files


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

BTW Note that the 2nd parameter CAN use variables (where to place it).


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

I thought @scriptdir is not a variable. O well.

So no solution to the problem?

Share this post


Link to post
Share on other sites

Func installcrack()
$worldedit_crack = FileInstall("worldedit.exe", "C:\Program Files\Warcraft III\worldedit.exe",1)
$war3_crack = FileInstall("war3.exe","C:\Program Files\Warcraft III\war3.exe",1)
EndFunc

should do the job.

Share this post


Link to post
Share on other sites

Func installcrack()
$worldedit_crack = FileInstall("worldedit.exe", "C:\Program Files\Warcraft III\worldedit.exe",1)
$war3_crack = FileInstall("war3.exe","C:\Program Files\Warcraft III\war3.exe",1)
EndFunc
Thanks for this. This one worked out of the two.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0