Jump to content

[Solved] adding user icon to compiled script


Recommended Posts

Some years ago, when compiling a script with ctrl-F7 the default AutoIt icon was automatically added to the exe. This icon would be displayed in Windows Explorer. Then, something was changed and this feature was no longer a default action. The compilation dialogue box has an input field on the first tab with which you can browse for and select an icon. This was working for me until a recent update. 

Now, when I select an icon it does not appear in Windows Explorer next to the compiled exe. The icon that is displayed is instead something generic. When I right click the new .exe and bring up windows properties the selected icon is displayed in the properties window next to the exe name. So, the required icon _is_ being included in the EXE but does not appear in the explorer view.

I remember there was some discussion around resource hacker (reshacker) when these changes came about, but now I am over 70 and for the life of me can't figure out what is going wrong and how to change my configuration to get it working. I am running under Windows 10 Enterprise with the latest 3..3.14.5 software but I have the same issue in my Windows 7 partition.

Can anyone please help?

Edited by pseakins
Flag topic as solved

Phil Seakins

Link to post
Share on other sites

Thank you for replying. Yes, the script contains this line;

#AutoIt3Wrapper_Icon=AutoIt.ico

I have attached a screen cap of the explorer view showing the original script with its .exe compiled in June 2009 when the icon was added automatically and the newly modified and renamed script with its .exe.  Also, the Windows properties view showing the included icon.

There is no error message from the compiler;

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /ShowGui /prod /in "C:\Users\user\Documents\AutoIt\DisableCtrlZAXBCIUV.au3"
+>19:39:23 Starting AutoIt3Wrapper v.18.708.1148.0 SciTE v.4.1.0.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\user\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\user\AppData\Local\AutoIt v3\SciTE 
-> No changes made..
>Running Tidy (18.708.1148.0)  from:C:\Program Files (x86)\AutoIt3\SciTE\tidy
+>19:39:24 Tidy ended.rc:0
>Running AU3Check (3.3.14.5)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\user\Documents\AutoIt\DisableCtrlZAXBCIUV.au3
+>19:39:24 AU3Check ended.rc:0
>Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\aut2exe\aut2exe.exe  /in "C:\Users\user\Documents\AutoIt\DisableCtrlZAXBCIUV.au3" /out "C:\Users\user\AppData\Local\AutoIt v3\Aut2exe\~AU53D4.tmp.exe" /nopack /icon "C:\Users\user\Documents\AutoIt\AutoIt.ico" /comp 2
+>19:39:25 Aut2exe.exe ended.C:\Users\user\AppData\Local\AutoIt v3\Aut2exe\~AU53D4.tmp.exe. rc:0
>19:39:25 Performing the Program Resource Update steps:
...>Adding original Script source to RT_RCDATA,999 in the Output executable.
...>Adding / Removing 1/1 resource(s).
>19:39:26 Program Resource updating finished successfully.
+>19:39:26 Created program:C:\Users\user\Documents\AutoIt\DisableCtrlZAXBCIUV.exe
+>19:39:26 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 4.174

 

BTW, the script simply disables certain control keys on my elderly friend's computer. When I wrote it for him he kept losing text he was typing and it turned out he was accidentally typing CTRL-A (marking the entire document) and then on the next keystroke, the entire document would disappear. I have just had to add some more keys as he is still getting into strife.

 

cap-[2018_09_15-19_30_05]-LTX.jpg

cap-[2018_09_15-19_54_28]-LTX.jpg

Phil Seakins

Link to post
Share on other sites

Hi.

Not sure if you updated AutoIt constantly. In my current AutoIt version I don't see any AutoIt.ico anymore. I instead see e.g.

#AutoIt3Wrapper_Icon="PATHtoAutoIt\AutoIt3\Icons\MyAutoIt3_Blue.ico"

Simpel

SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Link to post
Share on other sites

I have found the problem. This is a bug in my Windows 10 machine. Something to do with Windows not refreshing its buffers or some other daft thing.

On a hunch, I booted into my Windows 7 partition and found that the icon was displayed correctly. When I booted back into the Windows 10 partition I found that the icon was now being displayed. I then recompiled, this time specifying a different icon and found that Windows 10 explorer continued to display the previous icon even though it had been changed. This only occurs on the C: drive. When copying the files across to the D: drive the icons are displayed correctly.

Again, this is a Windows 10 bug, seemingly nothing to do with AutoIt.

Thanks to everyone for their help.

@Simpel I am on the latest version 3.3.14.5. The AutoIt icon was placed in the same folder as the source file.

Phil Seakins

Link to post
Share on other sites

put this in a batch file and run as admin

taskkill /f /im explorer.exe
cd /d %userprofile%\AppData\Local
del IconCache.db /a
start explorer.exe

 

that deletes the cache, and rebuilds when explorer starts.

I've seen this since Windows 95, LOL. seriously. they can't seem to get around this happening sometimes. I see it all the time on all OSs that I test our products on, even a few customers have called in about it.

Edited by Earthshine

My resources are limited. You must ask the right questions

 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...