Page 1 of 1

Need a little more help on FileInstall

Posted: 18 Mar 2019, 05:45
by AviationGuy
Hi there!

Question is pretty obvious. Can someone tell me a bit more about the FileInstall command?
Obviously, it installs something somewhere but how exactly would I do this?
I was playing with it a bit myself and came up with the following. Unfortunately, it doesn't seem to do anything or I am looking at the wrong place.

Code: Select all

IfNotExist, %A_Temp%\TestPic.png
	FileInstall, S:\...\AHKStudio.png, %A_Temp%\TestPic.png
return
From the docs, I've read that the first parameter, called Source, is the file that is getting installed at the Dest (destination).
Am I doing something wrong? Also, it seems like %A_Temp% or %A_ProgramFiles% is always needed within the Dest parameter, is that always the case, or could the dest also be just a 'normal' path?

Thanks guys!

Re: Need a little more help on FileInstall

Posted: 18 Mar 2019, 06:02
by AHKStudent
could be anywhere you have permission to install, if it doesn't work try running as admin

Re: Need a little more help on FileInstall

Posted: 18 Mar 2019, 15:35
by Ahk_fan
Hi,

FileInstall is only for compiled scripts.

Read Documentation...
1) Source allows only fixed paths and filename, no variables. So you have to define exactly where the files are.
2) when you compile the script, ahk2exe take the file from the source path and inserts it into die the compiled EXE-File, (the file grows)
3) when you execute the compiled script, the intepreter looks for the path and filename you've selected into 2.parameter(variables like %A_Scriptdir% allowed) and overwrite if flag = 1, otherwise if flag = 0 it save the file only if not exist at the destination path.

Re: Need a little more help on FileInstall

Posted: 18 Mar 2019, 16:57
by AviationGuy
Hi and thanks for the responses.

I figured it out now. Did some more testing and got it to work. Just found the documents not that extensive but I guess there is no need for that :p
I'm working on a project which should be able to compile scripts later on and was hoping for some more indepth examples which are using FileInstall.
But this will help me out anyway, thanks!