PDA

View Full Version : How to change exe icon for a TB program permanantly ?



kcvinu
21-02-2017, 09:14
Hi all,
I want to change the exe icon of my TB program which i create from my TB code. Now, each time i create exe, i need to change the icon. Is there any option to set my icon as default icon ?

ErosOlmi
21-02-2017, 12:26
You can load icon at Bundling time going into "Script icon" tab inside Bundling Dialog.

Or you can definitely specify exe icon inside your main script using pre-parsing command: #BUNDLE Icon "BundleIconFileName"
See help at: http://www.thinbasic.com/public/products/thinBasic/help/html/index.html?bundle_icon.htm

kcvinu
21-02-2017, 14:02
Hi Eros,
Thanks for the reply. You answer will solve my problem partially. Is there any option to force ThinAir to remember my preferencec like these ? Any ini file option or something like that ?

ErosOlmi
21-02-2017, 14:56
Well,

Bundling options are by script.
I didn't thought about Bundling options as general options for all scripts not having specific local options expressed.
But can be an idea at least for some options like Exe Icon.

If you add #BUNDLE Icon "BundleIconFileName" in your script it will be detected forever when you bundle that script.

kcvinu
21-02-2017, 15:04
Yeah, that's the possible solution.

primo
21-02-2017, 16:34
Hi Eros
in windows xp , thinbasic v 1.9.16.17
when we load the icon, it does not show in the preview
https://s32.postimg.org/ijbejkv3l/thinbasic_1.png (https://postimg.org/image/ijbejkv3l/)

but in fact it is loaded
and when we go again to bundle , it say icon file was not found
but when we click : click here to bundle, it is bundled okay with the icon

https://s31.postimg.org/tpvh359dj/thinbasic_2.png (https://postimg.org/image/tpvh359dj/)

this is the icon file: http://wikisend.com/download/124994/tomato.ico

ErosOlmi
21-02-2017, 19:25
Thanks for reporting.

Even if I would like not to support XP anymore ... I think it is better to have it on board as much as possible :)
I will check what I can do.

Can you please send me an example of not working icon you are using?
Send mail to: support at thinbasic dot com
Or attach file to this thread.

Thanks a lot
Eros

primo
21-02-2017, 22:07
Hi Eros
i thought it does not work in windows 7+ also . but now i have switched to windows 7 64 bit installed on my same computer and using the same icon : the preveiw is okay:
https://s23.postimg.org/i5buw6d23/image.png

but in bundle tab it still say icon file not found:
https://s11.postimg.org/4fgf86wdv/image.png

the icon i have downloaded from here:
http://www.iconarchive.com/show/food-drink-icons-by-graphicloads.html

you don't need to support windows xp for these icons, usually i don't bundle the codes, i run it from inside the IDE for my own research. this is the reason i haven't noticed it before until kcvinu have posted a question.

ErosOlmi
22-02-2017, 08:10
Actually I'm not able to replicate the error in my Windows 10 computer.
In all my cases Icon file is found by Bundle, Icon Preview seems working.

I downloaded .ico file and placed into a sub directory of the script called .\Resources\
Than added #Bundle Icon command:

#Bundle Icon ".\Resources\Graphicloads-Food-Drink-Bottle-2.ico"
Executed Bundle dialog, all seems ok.

Also tried to load icon from different locations (both absolute and relative) and again it seems working fine.

9650

I will try to replicate at office where I have many different computer with different operating systems.

In the meantime it would help me to have the .sDep file of your script in order to have a look at it.
When you execute Bundle of a script called MyScript.tBasic, thinCore.dll (thinBasic Core Engine) creates a MyScript.sDep file.
That file contains all needed info by Bundle in order to create the executable.
Can you please send me (support at thinbasic dot com) or attach here?

Ciao
Eros

primo
22-02-2017, 11:23
the tests in windows 7/64:
i don't find the *.sdep file after executing the bundled Sirpinsky.exe i have searched all the c:\thinbasic folder even the possible hidden files
the only *.sdep files is
live_image_tbasic.sdep 2 files
thinVisualForm.tbasic.sdep

i attach Sirpinsky.exe , you can remove the file when done. you see it has icon, and when bundled (in windows 7/64) it has a preview okay . but clicking on Bundle tab again it say there is no icon file loaded while in reality it is loaded successfully, so it is may be only the event handling of clicking on bundle tab after loading and previewing the icon, it is may be windows 10 remember somehow the loading of the icon and then provide this info to the event handling of clicking on bundle tab.

ErosOlmi
22-02-2017, 18:33
Sorry but I'm not able to replicate under Windows 7.

What thinBasic version do you have?
You should have a .sDep file in the same directory of your main script when Bundling.

From the executable I cannot derive any info, I can just see that it as an icon but I cannot un-bundle it to see how it was created, sorry.
I'm considering to create a special Bundle version in order to Log some additional information.

primo
22-02-2017, 20:55
Eros
now it works
as i said before the bundling with icon works with me, and in win7 and winxp it is only said the icon file not found in the bundle tab

the tests in windows XP : (i don't use or like win7+ it cause me heart pain realy):
when i have added #BUNDLE Icon "graph.ico" as you said, and going to the bundle tool now it say icon file found look the attached picture
i have used small icon 32x32 24bpp. the icon preview is okay look the attached picture, so in windows xp it can't preview 256x256 big icon while in win7+ it can preview 256x256 icons
but in my opinion when we use the bundle tool in the thinair IDE , we should not need to write #BUNDLE Icon "graph.ico" for the bundle tool to know that the icon is loaded
i think it is solved. but you may need to correct the click event proc on Bundle tab to show the icon file is loaded without the need to write #BUNDLE Icon "graph.ico
thanks for all your efforts


attached the sDep file
my tb version is the latest 1.9.16.17

ErosOlmi
23-02-2017, 08:25
Yes, icons containing only 256x256 size are not supported by Windows XP.
Icons contains 256x256 size but also 32x32 and 48x48 size I think can be used.

#BUNDLE Icon "graph.ico" is not used by thinBundle to know if icon is loaded.
It is used to set the icon for your script once and for all so when you execute thinBundle it knows what icon you want for your bundled executable without the need to specify it every time you want to create your exe.

Other languages/tools/ide specify single application options into an application project file.
thinAir has no project file but some options can be indicated directly into your script. That's the case of #BUNDLE ... options: http://www.thinbasic.com/public/products/thinBasic/help/html/index.html?bundle_version.htm
Specify the #BUNDLE ... options you need into your script and when thinBundle it executed it will try to apply your options without the need to specify them every time.

#BUNDLE options are just ignored when script is executed, they are considered only by thinBundle.

.sDep files are special files created by thinCore.dll (thinBasic core engine) to pass script information discovered inside the script to other thinBasic tools like thinAir and thinBundle.

Anyway, I will try to create a more "verbose" thinBundle so it will be more easy to understand why something is happening.

Ciao
Eros