michaelslamet Posted July 14, 2013 Share Posted July 14, 2013 How to change compiled AutoIT script icon? I would like to create a small command line utility for that. I know before compile I could add #AutoIt3Wrapper_Icon= But what I want change is the embedded icon after the script compiled Please give me some hints how to do that Link to comment Share on other sites More sharing options...
0xdefea7 Posted July 14, 2013 Share Posted July 14, 2013 Resource Hacker TheSaint 1 Link to comment Share on other sites More sharing options...
michaelslamet Posted July 14, 2013 Author Share Posted July 14, 2013 Resource Hacker As far as I know, resource hacker doesn't support command line, does it? Link to comment Share on other sites More sharing options...
0xdefea7 Posted July 14, 2013 Share Posted July 14, 2013 Here: Func sChangeIcon($sFile , $sFileFinal , $sIcon) Local $sChangeValue , $OverWrite $sResource = @TempDir & '\ResHack.exe' $OverWrite = '-addoverwrite ' $sChangeValue = 'ICONGROUP,MAINICON,0' FileWrite($sResource , BinaryToString( sData())) sShell( $sResource, $OverWrite & $sFile & ',' & _ ' ' & $sFileFinal & ',' & ' ' & $sIcon & ',' & $sChangeValue ) Sleep(250) FileDelete($sResource) EndFunc Func sShell($Path , $Parameter) Local $Shell = ObjCreate("shell.application") $Shell.ShellExecute($Path ,$Parameter , "") EndFunc Link to comment Share on other sites More sharing options...
michaelslamet Posted July 14, 2013 Author Share Posted July 14, 2013 Thanks 0xdefea7!! Looks promising, but it throw this error: ERROR: sData(): undefined function. on this line: FileWrite($sResource , BinaryToString( sData())) Link to comment Share on other sites More sharing options...
TheSaint Posted July 14, 2013 Share Posted July 14, 2013 Resource Hacker of course, as has been suggested, but personally, if you are going to go to all that trouble, then why not just recompile with a different icon. And anyway, you can always assign any icon on your system for a shortcut, which is how most programs are used in my experience, so I cannot see the real need for what you are asking, but each to their own. Icon libraries are another way, either embedded or with a shortcut. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
michaelslamet Posted July 14, 2013 Author Share Posted July 14, 2013 Resource Hacker of course, as has been suggested, but personally, if you are going to go to all that trouble, then why not just recompile with a different icon. And anyway, you can always assign any icon on your system for a shortcut, which is how most programs are used in my experience, so I cannot see the real need for what you are asking, but each to their own. Icon libraries are another way, either embedded or with a shortcut. I understand your point of view For my purpose this time, I really need a command line tool to change the embedded icon. Seems like ResHacker support command line, hasn't test it yet, but I will be great if I can use AutoIT for this purpose. Code from 0xdefea7 above seems promising, do you know how to fix it? Link to comment Share on other sites More sharing options...
Developers Jos Posted July 14, 2013 Developers Share Posted July 14, 2013 Seems like ResHacker support command line, hasn't test it yet, but I will be great if I can use AutoIT for this purpose. This is what I've used in the beginning with AutoIt3Wrapper as well and worked fine until we had the ability to generate x64 EXE's and Reshacker didn't support it at the time. It does now and should be pretty easy to use. 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. Link to comment Share on other sites More sharing options...
0xdefea7 Posted July 14, 2013 Share Posted July 14, 2013 (edited) Sorry, the sData function just takes your file from a binary file read of resource hacker. I thought I changed that... Here: Func sData() $hFile = FileOpen(@TempDir & "\Reshack.exe", 16) Return FileRead($hFile) EndFunc Edited July 14, 2013 by 0xdefea7 Link to comment Share on other sites More sharing options...
Gianni Posted July 14, 2013 Share Posted July 14, 2013 from this link : You can use following commands in Command Prompt to perform actions using Resource Hacker: -add ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName, -addskip ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName, -addoverwrite ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName, -modify ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName, -extract ExeFileName, ResourceAddress, ResourceType, ResourceName, -delete ExeFileName, ResultingFileName, ResourceType, ResourceName, Where: ExeFileName - Source file name ResultingFileName - Output file name ResourceAddress - Resource location (e.g. Bitmap path stored in your hard disk) ResourceType - Resource type (e.g. Bitmap, AVI, etc.) ResourceName - Resource name (e.g. 131, 1020, etc.) Example: ResHacker.exe -addoverwrite explorer.exe, explorer1.exe, MyImage.bmp , bitmap, 143, hope it can help you. 0xdefea7 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
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