Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / AGK2 , Tier 1 : Change Windows Icon

Author
Message
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 28th Sep 2017 16:18
I have been developing windows games for years using AppGameKit (1 and now 2). This has always been an issue and i don't understand why it's not been handled by now.

I need to change the app icon from the little "agk" picture to one of my own design.

i use agk2, tier 1.

I know about "resource editors" , but that is hacky , AND it is currently not working.

Maybe TGC wants end-users to see the AppGameKit icon, and say, "hey i want that". But what they are really saying is "wow, why didn't they give the game its own icon. That's really lazy and unpolished."

So come on TGC, let me change the icon.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 28th Sep 2017 17:26 Edited at: 29th Sep 2017 09:49
the compiler can do the replace of the icon if he copy the interpreter core exe at windows, my opinion. (feature request)
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.7.2) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 28th Sep 2017 20:36
Quote: "So come on TGC, let me change the icon."


+1

In the meantime, to change the icon programmatically for windows I have attached a plugin, its a simple 1 function plugin that sets the window and taskbar icon



Icon.Set(AGKWindowTitle, IconFile)
AGKWindowTitle = the title of the agk window
IconFile = the .ico file to load, must be in or subdirectory of media folder

Attachments

Login to view attachments
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 28th Sep 2017 22:08
@PartTimeCoder - Very nice!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th Sep 2017 23:22
i think there are third party products that will change icon in the .exe
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 29th Sep 2017 01:00
yes. i'm using Resource Hacker and it works like a charm (Open -> choose your exe file -> Action Menu -> Replace Icon).

But it should have been better to choose an icon in the project properties (there is certainly a command-line tool to change the icon and automate the process no ?)

Same thing for Mac (preventing to drag and drop new icon for each release compilation)
--------------------------------
Join us on dedicated AppGameKit WeeKChat :
https://week.chat/room/AppGameKit
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 30th Sep 2017 17:00
Thanks for chiming in everyone.

Yeah, like i said, i know about "resource hackers". i use IcoFX , and it does work.

But agk creates the exe when it compiles (as well as the bytecode) , so it should really be not much of a problem to allow us to set which icon we use.
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 1st Oct 2017 01:12 Edited at: 1st Oct 2017 02:10
Quote: "I have been developing windows games for years using AppGameKit (1 and now 2). This has always been an issue and i don't understand why it's not been handled by now.

I need to change the app icon from the little "agk" picture to one of my own design.

i use agk2, tier 1.

I know about "resource editors" , but that is hacky , AND it is currently not working.

Maybe TGC wants end-users to see the AppGameKit icon, and say, "hey i want that". But what they are really saying is "wow, why didn't they give the game its own icon. That's really lazy and unpolished."

So come on TGC, let me change the icon."

I could not agree more.

I was just thinking about this the other day, and had almost identical thoughts about it.

Quote: "In the meantime, to change the icon programmatically for windows I have attached a plugin, its a simple 1 function plugin that sets the window and taskbar icon"

Thanks PTC!!!

This will be very useful, and it is very generous of you.

I never liked the idea of 3rd party resource hack tools, but I am looking forward to using your plug-in.


EDIT
Okay, once again I feel like the village idiot...

This is my first attempt at using a Plugin

1) Made a 'Plugins' folder in the AppGameKit Project folder

2) Extracted the 'Icon' folder from the ZIP file

3) Copy/ pasted the 'Icon' folder to the 'Plugins' folder

4) Put my logo.ico file in the 'media' folder

5) put the following at the top of my main.agc file (code)



6) Hit Compile (compilation finished successfully)

7) Hit Run, and got the following compile fail error message...

Quote: "Compilation failed.
error: Failed to open file for reading /Plugins/Icon/Commands.txt"


8) discovered that the 'Icon' folder disappeared and now the 'Plugins' folder is empty????

Has anyone else tested the Plugin, or am I doing something wrong????

Thanks in advance

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 1st Oct 2017 15:50
Quote: "or am I doing something wrong????"


Lol, yes.., you put your plugins in the AppGameKit compilers dir: "C:\Program Files (x86)\The Game Creators\AGK2\Tier 1\Compiler\Plugins"

AGK will copy the plugin to your project when you use "#Import_Plugin Icon"
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 1st Oct 2017 21:20 Edited at: 1st Oct 2017 21:43
Thanks

That Plugin folder did not exist, so I created one and put the Icon folder in it, and still got the same error message.


Edit
It was actually using the HTML5 compiler, and that Tier 1 path did have a Plugins folder, and I put the Icon folder in there and then it compiled and ran the program.

"C:\Program Files (x86)\The Game Creators\AGK2\html5\Tier 1\Compiler\Plugins"

However, the Icon did not change. ;(

So, I went into my build options and took the html5 out of the path to the compiler, and tried again, but the the program did the red line under the #Import_Plugin Icon, and gave this error message...

main.agc:1: error: Unrecognised compiler directive, only compiler directives may begin with a hash

Like I said, that compiler path did not have a Plugins folder already, I had to create it.

lol... I think my whole installation may be wrong, so I may have to uninstall everything and reinstall the 2017_09_25 build

Thanks for the help!!!

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 1st Oct 2017 21:46
Plugins are not available for HTML5, What version of AppGameKit are you using? and on what platform?
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 1st Oct 2017 22:31 Edited at: 15th Oct 2017 20:06
AGK2 --- Windows 7
latest build 2017_09_25

Thanks a bunch PTC, and I am so glad I had to try this out because otherwise, I would not have discovered my incorrectly installed update, which may have wreaked havoc later on.

And remember kids... Learning is fun, even when you are learning what not to do from the village idiot.

Always uninstall your current build before installing a new update! (and don't forget to backup your files first)

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 2nd Oct 2017 18:49
yes you will also need to backup your plugins dir as a uninstall also removes them, I found out the hard way!
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 15th Oct 2017 16:09
Hey, PartTime!

I see your "library" plugin, but haven't tried yet.

I thought AppGameKit tier 1 now had a way of calling DLLs natively, but i can't find any mention of it.

So i am hoping that either someone knows about it and can direct me, or i can use your plugin, to interface with STEAM...
adambiser
AGK Developer
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 15th Nov 2017 15:42 Edited at: 15th Nov 2017 15:43
Sorry to resurrect an old topic, but if the project folder contains an icon folder called "icon.ico", the interpreter will automatically use that icon (at least on Windows) while running (not for the EXE file itself). No plugin necessary, unless you don't want to use that file name.
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 15th Nov 2017 20:30
good to know, thanks adambiser
PSY LABS Games
Coders don't die, they just gosub without return
ReversalGames
8
Years of Service
User Offline
Joined: 24th Mar 2016
Location:
Posted: 14th Dec 2017 13:49
Hi to all,

I just installed the latest build V2017.12.12
With this new release, Is there a built-in option to change the builed EXE icon ?

If i copy an ICO file to the Project Folder and rename it to "icon.ico" and build/run
only the taskbar icon (while running) get change and not the EXE itself like [adambiser] said.

I did try the other solution:

1) Made a 'Plugins' folder in the AppGameKit PROGRAM folder
(C:\Program Files (x86)\The Game Creators\AGK2\Tier 1\Compiler\Plugins)
2) Extracted the 'Icon' folder from the ZIP file
3) Put your logo.ico file in the 'media' folder of your program
4) Put the following at the top of my main.agc file (code)
#Import_Plugin Icon
Icon.Set("WindowTitle", "logo.ico")
5) Hit Compile (compilation finished successfully)

Program compiled OK and is running fine but the exe icon remain the same

I don't want to change the EXE file manually via ICOFX or other Tools because some
AntiVirus see that has tampering and flag it has a virus

Any update or suggestion would be more than welcome
Dark Raven
9
Years of Service
User Offline
Joined: 27th Jul 2014
Location: United States
Posted: 17th Dec 2017 20:24
Unfortunately the way tier one apps are created there is noway to directly change the exe icon. The player exe is precompiled and just copied over and renamed. That is why the AppGameKit logo shows in the exe file. The window and taskbar can be changed at code time like explained above but the exe icons are resource embedded in the exe file which is why a resource hacker is the only way to change this. The only way to have a custom icon for the exe file is to either:

1) recompile the interpreter source code from the tier 2 folder and change the icons in the visual studio project.
2) or use a program like enigma virtual box which packs your app stuff into an exe which you can specify an icon for the exe.

So until the tier 1 editor can build the player exe file and not just copy it over and compile your code to byte code these along with the resource hacking way is the only way to change the icon of the exe file.
LillyByte
6
Years of Service
User Offline
Joined: 30th Oct 2017
Location:
Posted: 19th Dec 2017 15:48
Quote: "2) or use a program like enigma virtual box which packs your app stuff into an exe which you can specify an icon for the exe."


Enigma Virtual Box looks kinda interesting! Thanks!
~~ LillyByte ~~
http://www.dymoria.com
adambiser
AGK Developer
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 19th Dec 2017 21:05
If using an installer like NSIS, another alternative is to create a shortcut to the EXE and assign its icon to icon.ico. It doesn't change the EXE, but might accomplish enough to be satisfactory for some projects.
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 20th Dec 2017 02:27
Quote: "Unfortunately the way tier one apps are created there is noway to directly change the exe icon. The player exe is precompiled and just copied over and renamed. That is why the AppGameKit logo shows in the exe file.
"


Eh? Did resource hacker stop working?

I know it would be nice to have the compiler substitute a new icon if available, but not hard to poke a new icon into the release version (if it still works that is)
Dark Raven
9
Years of Service
User Offline
Joined: 27th Jul 2014
Location: United States
Posted: 20th Dec 2017 06:18
Someone earlier said something about the resource hacker causing some anti virus programs to report false positives because of the post tampering of the exe file.
ReversalGames
8
Years of Service
User Offline
Joined: 24th Mar 2016
Location:
Posted: 21st Dec 2017 00:23
Quote: "So until the tier 1 editor can build the player exe file and not just copy it over and compile your code to byte code these along with the resource hacking way is the only way to change the icon of the exe file. "


Do you think this a realistic request to ask for in 2018 ?

I like the suggestion of "enigma virtual box".
Before i was using "InnoSetup".
Is there a big difference between the two or "InnoSetup" is still a good option ?

Quote: "Someone earlier said something about the resource hacker causing some anti virus programs to report false positives because of the post tampering of the exe file."


Unfortunatly, it is the case. Just enough to get the attention of the AV and get the file banned.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 21st Dec 2017 10:29
Quote: "Just enough to get the attention of the AV and get the file banned."

I'm still having trouble with AGKCompiler.exe getting deleted by the office AV solution.
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 21st Dec 2017 13:17
Quote: "I like the suggestion of "enigma virtual box".
Before i was using "InnoSetup".
Is there a big difference between the two or "InnoSetup" is still a good option ?"


Enigma is a "packer" which can pack (so hide) files in your executable and run all of that without unzipping or installing. As MoleBox or other software (but enigma has good options and is free and works with AppGameKit files/folders logic) .

InnoSetup is more an installer creator (maybe it has more options now).
ReversalGames
8
Years of Service
User Offline
Joined: 24th Mar 2016
Location:
Posted: 23rd Dec 2017 14:41
Thank you MikeMax, i will give it a try.

Login to post a reply

Server time is: 2024-04-25 11:04:20
Your offset time is: 2024-04-25 11:04:20