Hello,
I have a script that i need to compile along with an image, so that when i press a button in the gui, the image pops up in the preview space on the gui.
I have this line on the autoexecute section of my script:
FileInstall, C:\Users\myname\Desktop\Autohotkey\images\play.bmp, A_WorkingDir\images\play.bmp
I compile the script, create the images folder on my desktop, then when i run the script and press the play button, no image shows and the folder is empty. If however i just copy paste the image from my pre-compiled images folder into the new one, then the button shows the image ok.
I was under the impression that fileinstall would extract the image in the folder i designated then use it from there, but i haven't managed to make that happen so far.
Any help?
Can't get FileInstall to work
Re: Can't get FileInstall to work
A_workingDir is a variable you want to evaluate while the rest of the file path is meant literally: %A_WorkingDir%\images\play.bmp
But you could probably leave that first part out anyway (About the Dest parameter: "It is assumed to be in %A_WorkingDir% if an absolute path isn't specified.").
But you could probably leave that first part out anyway (About the Dest parameter: "It is assumed to be in %A_WorkingDir% if an absolute path isn't specified.").
Re: Can't get FileInstall to work
You probably want
Code: Select all
FileInstall, C:\Users\myname\Desktop\Autohotkey\images\play.bmp, %A_WorkingDir%\images\play.bmp
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: Can't get FileInstall to work
I tried removing the %a_workingdir% but it still didn't work.gregster wrote: ↑13 Aug 2022, 04:47A_workingDir is a variable you want to evaluate while the rest of the file path is meant literally: %A_WorkingDir%\images\play.bmp
But you could probably leave that first part out anyway (About the Dest parameter: "It is assumed to be in %A_WorkingDir% if an absolute path isn't specified.").
I am sorry, but i don't see the difference.TAC109 wrote: ↑13 Aug 2022, 04:49You probably wantCode: Select all
FileInstall, C:\Users\myname\Desktop\Autohotkey\images\play.bmp, %A_WorkingDir%\images\play.bmp
Re: Can't get FileInstall to work
I didn’t see that @gregster had replied first.
Check that your source and destination directories exist. FileInstall can throw an error, so insert code to test for this after the FileInstall command.
Cheers
Check that your source and destination directories exist. FileInstall can throw an error, so insert code to test for this after the FileInstall command.
Cheers
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: Can't get FileInstall to work
i just tried with just a .txt file and it worked fine, so i assume it's some issue with the bmp. I will keep testing, if i can't work around it somehow.