FileInstall not working Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
jsong55
Posts: 263
Joined: 30 Mar 2021, 22:02

FileInstall not working

19 May 2024, 21:14

Code: Select all

Run("C:\Users\meuser\OneDrive\AHK\Icon\whatsapp.ico") ; to prove the file exists and the path is correct
FileInstall("C:\Users\meuser\OneDrive\AHK\Icon\whatsapp.ico", A_ScriptDir "\Icons\whatsapp.ico",0)
Simple but just not sure why I get

Error Failed

I'm running it not compiled. Thanks
TAC109
Posts: 1129
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: FileInstall not working

19 May 2024, 21:49

The icon may already exist at the destination location. In this case set the 'overwrite' parameter to 1.

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
jsong55
Posts: 263
Joined: 30 Mar 2021, 22:02

Re: FileInstall not working

19 May 2024, 23:16

Thank you 1 works.

though I thought it will be ignored in uncompiled mode. or I read the help files wrongly?
TAC109
Posts: 1129
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: FileInstall not working  Topic is solved

20 May 2024, 00:02

Under error handling for FileInstall it says
Any case where the file cannot be written to the destination is considered failure. For example:
The destination file already exists and the Overwrite parameter was 0 or omitted.
Edit: Error handling is the same regardless of whether the script is run directly or compiled.

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
jsong55
Posts: 263
Joined: 30 Mar 2021, 22:02

Re: FileInstall not working

25 May 2024, 05:24

@TAC109 ah thanks think I got it mixed up.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Google [Bot] and 19 guests