Need a little more help on FileInstall

Get help with using AutoHotkey and its commands and hotkeys
AviationGuy
Posts: 185
Joined: 17 Jan 2019, 10:13

Need a little more help on FileInstall

18 Mar 2019, 05:45

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!
AHKStudent
Posts: 576
Joined: 05 May 2018, 12:23

Re: Need a little more help on FileInstall

18 Mar 2019, 06:02

could be anywhere you have permission to install, if it doesn't work try running as admin
Ahk_fan
Posts: 78
Joined: 31 Aug 2018, 14:34

Re: Need a little more help on FileInstall

18 Mar 2019, 15:35

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.
regards,
AHK_fan :)
AviationGuy
Posts: 185
Joined: 17 Jan 2019, 10:13

Re: Need a little more help on FileInstall

18 Mar 2019, 16:57

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!

Return to “Ask For Help”

Who is online

Users browsing this forum: DavidBevi, hoppfrosch and 198 guests