LeeSG Posted March 12, 2023 Posted March 12, 2023 (If translated with a translator, it may be written a little awkwardly. I would be grateful if you could understand my situation) As mentioned in the title, the icon file, which was applied well when compiled with exe, does not apply when compiled with a3x, and is displayed as the default autoit icon. #AutoIt3Wrapper_Icon=icon.ico I specified the icon file at the top, but why can't it be applied? Is there any way to compile with a3x including icons?
Moderators Melba23 Posted March 12, 2023 Moderators Posted March 12, 2023 Moved to the appropriate AutoIt General Help and Support forum, as the AutoIt Example Scripts forum very clearly states: Quote Share your cool AutoIt scripts, UDFs and applications with others. Do not post general support questions here, instead use the AutoIt Help and Support forums. Moderation Team Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
ioa747 Posted March 12, 2023 Posted March 12, 2023 (edited) this way it works with or without compilation No need to set #AutoIt3Wrapper_Icon. The icon of <file>.a3x I don't think it changes #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile_type=a3x #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstants.au3> #include <WinAPIShellEx.au3> #include <TrayConstants.au3> ; Required for the $TRAY_ICONSTATE_SHOW constant. Opt("TrayMenuMode", 3) ; 1+2 ;0=append, 1=no default menu, 2=no automatic check, 4=menuitemID not return _WinAPI_SetCurrentProcessExplicitAppUserModelID(_WinAPI_CreateGUID()) ; ensure a unique ID, neded for TaskBar icon TraySetIcon("shell32.dll", 239) ; Set the tray menu icon GUICreate("My Custom GUI", 300, 200) GUISetIcon(@SystemDir & "\shell32.dll", 239) ; Set the Window & TaskBar icon icon GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited March 12, 2023 by ioa747 I know that I know nothing
mistersquirrle Posted March 12, 2023 Posted March 12, 2023 (edited) From what I understand there is not a way to add a custom icon to a3x (specifically for the file itself), as it's a reference to the AutoIt exe/icon. Here's some more information: The best option you're likely to get is to create a shortcut to the .a3x file, and change the icon of that shortcut: Edited March 12, 2023 by mistersquirrle We ought not to misbehave, but we should look as though we could.
Skysnake Posted March 14, 2023 Posted March 14, 2023 (edited) I have used this for almost 10 years now #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=MyApp #AutoIt3Wrapper_Icon=scriptfd.ico #AutoIt3Wrapper_Outfile=some.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Res_Comment=Awesome AutoIt script #AutoIt3Wrapper_Res_Description=Does some magix #AutoIt3Wrapper_Res_Fileversion=2.0.1.440 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_LegalCopyright=Mister Skysnake #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #AutoIt3Wrapper_Res_Field=Compile Date|%date% %time% #AutoIt3Wrapper_Res_Field=#pragma|compile(OriginalFilename,some.exe) #AutoIt3Wrapper_Res_Icon_Add=other.ico #AutoIt3Wrapper_Res_Icon_Add=blackbook.ico #AutoIt3Wrapper_Res_Icon_Add=bluebook.ico #AutoIt3Wrapper_Res_Icon_Add=purplebook.ico #AutoIt3Wrapper_Run_AU3Check=n #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 6 -q #AutoIt3Wrapper_Run_Tidy=y #Au3Stripper_Parameters=/rm #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** This goes at the top of your script. The icons must be correctly named and present in the local @Script folder Edited March 14, 2023 by Skysnake Skysnake Why is the snake in the sky?
mistersquirrle Posted March 14, 2023 Posted March 14, 2023 (edited) 1 hour ago, Skysnake said: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** ;... ://////=__= ://////=__=://////==OriginalFilename,some.exe) ;... #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** What is this part supposed to be? It just throws errors for me, and I haven't seen something like this before. Also while this will work for outputting a .exe, the question is specifically about .a3x which this won't do anything for (tested compiling after adding: #AutoIt3Wrapper_Outfile_type=a3x and even adding multiple icons with Res_Icon_Add didn't change the filesize from a couple kb ). Edited March 14, 2023 by mistersquirrle We ought not to misbehave, but we should look as though we could.
Developers Jos Posted March 14, 2023 Developers Posted March 14, 2023 2 hours ago, Skysnake said: This goes at the top of your script. The icons must be correctly named and present in the local @Script folder This will only work when: You have the full SciTE4AutoIt3 installer installed with AutoIt3Wrapper You compile to an EXE ! not A3X as that is missing the PE header a program has which contains the ICO info. Skysnake 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Skysnake Posted March 14, 2023 Posted March 14, 2023 (edited) 9 hours ago, mistersquirrle said: What is this part supposed to be? It just throws errors for me, and I haven't seen something like this before. Hmm. Interesting, that is the way the Forum represents the following directive #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #AutoIt3Wrapper_Res_Field=Compile Date|%date% %time% #AutoIt3Wrapper_Res_Field=#pragma|compile(OriginalFilename,some.exe) Probably the |% screws with the interpreter. I have changed the code tag above to HTML (it is not HTML but now displays the code correctly) Edited March 14, 2023 by Skysnake Skysnake Why is the snake in the sky?
Skysnake Posted March 14, 2023 Posted March 14, 2023 8 hours ago, Jos said: This will only work when: You have the full SciTE4AutoIt3 installer installed with AutoIt3Wrapper You compile to an EXE ! not A3X as that is missing the PE header a program has which contains the ICO info. Yes Master Skysnake Why is the snake in the sky?
Developers Jos Posted March 14, 2023 Developers Posted March 14, 2023 mmm so what exactly does this do? 13 minutes ago, Skysnake said: #AutoIt3Wrapper_Res_Field=#pragma|compile(OriginalFilename,some.exe) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Skysnake Posted March 15, 2023 Posted March 15, 2023 From what I see that is a Windows file system parameter, the key is "OriginalFilename" and you can then specify "some.exe" Introduced with Vista Sp1 System.OriginalFileName - Win32 apps | Microsoft Learn Skysnake Why is the snake in the sky?
Developers Jos Posted March 15, 2023 Developers Posted March 15, 2023 4 minutes ago, Skysnake said: From what I see that is a Windows file system parameter, the key is "OriginalFilename" and you can then specify "some.exe" I have no idea what this all means, but assume that statement is ONLY adding an extra TEXT field to the PE header with that content and nothing else! SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Skysnake Posted March 15, 2023 Posted March 15, 2023 You may be right. My impression is that Windows does not know what the compiler "Outfile" name means, but is supposed to know what the OriginalFilename means. I am guessing this has to do with Windows Indexes and search. And yes, I am guessing. Skysnake Why is the snake in the sky?
Developers Jos Posted March 15, 2023 Developers Posted March 15, 2023 17 minutes ago, Skysnake said: You may be right. May? funny... 18 minutes ago, Skysnake said: My impression is that Windows does not know what the compiler "Outfile" name means, but is supposed to know what the OriginalFilename means. I am guessing this has to do with Windows Indexes and search. And yes, I am guessing. Correct .... you are guessing and I have no clue why one would think that Windows can do anything with this. Possibly you are referring to these supported "Variables" by AutoIt3Wrapper directive found in the Helpfile?: Quote ; The following directives can contain: these variables; %in% , %out%, %outx64%, %icon% which will be replaced by the fullpath\filename.; %scriptdir% same as @ScriptDir and %scriptfile% = filename without extension.; %fileversion% is the information from the #AutoIt3Wrapper_Res_Fileversion directive; %scitedir% will be replaced by the SciTE program directory; %autoitdir% will be replaced by the AutoIt3 program directory SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Skysnake Posted March 15, 2023 Posted March 15, 2023 It was introduced for Vista Sp1. (as above) . So why did Microsoft introduce this then? And it is still supported for Windows 10 . Skysnake Why is the snake in the sky?
Developers Jos Posted March 15, 2023 Developers Posted March 15, 2023 (edited) Again, what is the relation between an AutoIt3Script that updates an PE header of an Program resource and anything with Windows? I realize that the Windows Explorer does use some of the Info in the PE header to display such things as Version and Description. Looking at your line: #AutoIt3Wrapper_Res_Field=#pragma|compile(OriginalFilename,some.exe) .. there are a number of strange things with it! For starters: Why are you setting a PE field to a AutoIt3 specific #PRAGMA statement? What are you expecting this line to do? Edited March 15, 2023 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Skysnake Posted March 15, 2023 Posted March 15, 2023 (try setting the code to HTML then it doesn't get all slashy) Expectation? I expect that code to tell the Windows OS what the OriginalFilename is as described here: Property System Overview - Win32 apps | Microsoft Learn So that when a user searches, the application will show up. Am I missing something? Skysnake Why is the snake in the sky?
Developers Jos Posted March 15, 2023 Developers Posted March 15, 2023 (edited) 9 minutes ago, Skysnake said: Am I missing something? Guess so as you are not answering my whole question... Why #PRAGMA? .. but when the question is how to set a PE header known fieldname like: OriginalFilename you simply use this format: #AutoIt3Wrapper_Res_Field=OriginalFilename|"Whatever.exe" Which works nicely for me: Edited March 15, 2023 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Skysnake Posted March 15, 2023 Posted March 15, 2023 (edited) Contamination 🤷♂️ Thank you for pointing that out. I will remove the #pragma, but what would the correct syntax be then? Jos: Was already Edited. Edited March 15, 2023 by Jos Skysnake Why is the snake in the sky?
Skysnake Posted March 15, 2023 Posted March 15, 2023 Thank you kindly. Skysnake Why is the snake in the sky?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now