Possible to change the application file's icon? - icons

I'm using Inno Setup to create a Windows software installer, and would like to use a custom icon for the distributed exe file (which will be located in C > Program Files > MyProgram ).
So far, I've been able to get the custom icon to work (sort of) for the desktop shortcut, by using the following code, placed under the [Icon] section...
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\TheIcon.ico"; Tasks: desktopicon
When I say that it "sort of" worked... it did customize the desktop shortcut's icon, but the quality of the icon looks terrible compared to the quality of the original icon.
But the bigger issue is... I can't figure out how to customize the icon for the actual application (exe) file at all, or for the start menu shortcut.
I would have assumed that the following line would do the trick for the application file...
Name: "{pf}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\TheIcon.ico";
And I also assumed that the following code would do the trick for the start menu icon...
Name: "{commonstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\TheIcon.ico";
But no dice. It just uses the default icon.
Can anyone tell what I'm doing wrong? I would post the entire script here but it seems that the Stack Overflow code editor doesn't like a bunch of curly brackets over multiple lines (if someone knows a way around that I'll be happy to post the whole script).
And FYI... for this particular project, changing the exe icon prior to running it through Inno Setup doesn't appear to be an option (I tried changing it via Resource Hacker, and although it succeeded in changing the exe's icon, it corrupted the file in the process, to where it wouldn't even run :(
If it's not possible to customize the application file's icon using Inno Setup, then do I have any other options?

As you know the application icon is built into the .exe file. The Inno Setup cannot modify the .exe files. And there's no other way to override the application icon by an external one.
You have to edit the .exe file yourself, before building the installer.
I personally use the Resource Hacker and have no problems with it.
Make sure the license of the application you are modifying allows such customization.
The icons in Windows Start menu are indeed set using IconFilename. I also have no problems with that.
The problem might be that Windows caches the Start menu icons. So if you had that entry in Start menu before, reinstalling the application with new icons sometime won't make Windows reset the cache. It keeps displaying the old icons. Try to uninstall, restart, and reinstall.

Related

Qt Creator and QML Live Preview

The problem now is that I don't know how I can use qml live preview?
I saw a video:
https://vimeo.com/145921618
I saw this post about erase this function for Qt Creator.
How i can implementlive coding into my app?
Perhaps you mean Terrarium?
Terrarium is a cross platform QML Playground: the view renders lively
as you type in the editor, makes prototyping and experimenting with
QtQuick a lot more fun!
It monitors changes in its TextEdit, and triggers the view to reload
source from the local http server. If you're looking for a file system
watcher implementation, please refer to QML LiveReload.
Or LiveReload?
As is evident from the video, this is as simple as auto reloading a QML file each time a chance to the file has been saved.
You can easily do that yourself, set up a QFileSystemWatcher and every time the file is modified, load the file in a QML view. And there you have it.
Of course, this is only good for previewing standalone components which can work on their own. You could go further, set the file system watcher to monitor the entire QML project and reload the main QML file every time something changes. It is a two step process, you need to monitor the directory, which only reflects adding or removing of files, and you subsequently add or remove those files from watching for changes.
Just for the sake of it, I want to share another tool that I found online.
It is a web based QML editor that gives immediate preview while writing the code. It has its limits, but still it's pretty useful for live QML coding
https://qmlweb.github.io/
If someone is still interested, in my Qt 5.10 installation, there is a qmlscene.exe in bin folder (same location as qmake or assistant). Running on command line is fine, however it is not in Qt creator.
PS: I found this:
http://doc.qt.io/qt-5/qtquick-qmlscene.html

Why Files misteriously disappear from xcode with this strange symptom?

I use time machine and drop box to synchronize stuffs.
Recently I found that some files are gone.
However, the project compiles just fine as if the file is there. My friend cannot compile though.
This is very frustating. I got to find the missing files and then restore it from time machine and then readd that to xcode. I don't even know what files are missing.
I used dropbox and time machine. Looks like file disappear, the file names becomes "red" in xcode for a while and then poof it's gone. Xcode automatically remove the files from the project. The project still compiles fine which is frustating. If the project doesn't compile, I will know ah this file is missing.
Looks like somehow xcode still have the file but doesn't show it. Files is not on finder either.
What could possibly be the explanation and how to fix that.
I have clean projects to make sure that my computer do not use cached files.
It still compile fines in my computer
The file is still missing in project navigator
My friends' computer that uses the EXACT same files (connected to drop box) cannot compile
For example, xcdatamodeld files are crucial. In my computer it still run fine without that file even though that file is obviously needed. Xcode behaves as if the file is there all along.
My friends' try to compile the project and crash.
Also there is a PNG file. In my computer it runs fine with the icons showing up. In my friends computer the icons doesn't show up at all.
For anyone who still have the problem, in my case Xcode6. It turns out somehow the "Show only files with source control status" and "Show recent file button" is enable. It located in the bottom of left sidebar.
This somehow happen after I update os to Yosemite.
Cheers
Go to the project navigator (top left folder symbol). Files that are not found by XCode are displayed in red. But since your project compiles fine, there should not be any that are required. Now click one of the "missing" files to activate it. Open the utility area on the right side, and show file inspector. Under "location" you find the full path of this file. Probably, your XCode project uses just references to these "missing" files that are stored somewhere else, and not in your project folder.
I had the same problem ..then I added the files explicitly into our project…which resulted into Duplicate Symbols error …we solved that by following….
In Your Project go to targets-
At the bottom Bar of your Targets there are three options..
1.Add Target
2. Validate Settings
3. Build RUle..
Click on validate Settings….it will ask for you to remove the Duplicated files from the project do it…ur project would run fine

Update icon from older version with inno setup

I installed my icon with
Name: "{commondesktop}\TestApp {#VERSION}"; Filename: "{app}\TestApp.exe"; WorkingDir: "{app}"; IconFilename: "{app}\TestApp.ico";
and if I update my tool (checked in InitializeSetup()) the old icon is still available on desktop (old version number) and the new one also!
Is there a flag to remove the icon if the tool will be updated and not uninstalled?
thx
This is one of the reasons why you should generally not include the version number in your icon names.
You can, however, tell Inno to delete these in a later install like so:
[InstallDelete]
Type: files; Name: "{commondesktop}\TestApp 5.2.lnk"
Note that it is best practice to individually name all the previous versions that you have released, instead of using a wildcard. (This is because a wildcard might accidentally delete other icons that the user has created themselves, which they won't be happy about.)
Aparently, even if you delete and recreate shortcut link as in Miral's answer, Windows still takes exe icon from some cache.
There is another way. Ship separate .ico file within your installer, and then
use IconFilename parameter in [Icons] section to target that icon instead of the one in the exe.

Unity Launcher icon not being set by Qt application

I'm trying to get my Qt application to display an icon in the Unity Launcher but it's not working. In code, I'm simply using:
qApp->setWindowIcon(QIcon("path/to/icon.png"));
but it's not doing anything. I've also tried setting the icon directly on the main window but it doesn't help either.
Any idea what could be the issue?
PS: I've checked the icon path and it is correct.
Without knowing the details of unity, I'm pretty sure that you'll have to create and install a .desktop file with the icon in it. See for example here. Whatever you set at runtime, the launcher cannot know about before starting the application, so it will need the information from an external configuration.
To enable picture encoding in Windows(not in Ubuntu) I've put the QT\4.8.3\plugins\imageformats folder near my app.
I think You should try the same.

QT/C++ on MAC - Application Icon doesn't set

Weird problem I'm struggling with. On the same folder as my "*.pro" QT project file I have a Resources/myIcon.png.
I am trying to set that as the Icon for my built application, running on OSX. I read the documentation and it suggests to put a "ICON = " in the .pro file. I did that, but for some reason, the icon IS copied over the the resources folder inside my app's content, but the .pfile's icon field remains empty. Even when I change it manually to "resources/myIcon.png" it will not work.
What am I doing wrong?
Manually delete the generated app bundle. Run QMake followed by Rebuild All is not sufficient!
Don't set the full pathname within the application bundle for the icon file in the Info.plist. Just set the filename. Mac OS knows to look in AppName.app/Contents/Resources for it.
And yes, it must be an ICNS file as far as I'm aware. You can use the 'Icon Composer' utility that is part of the Mac OS development tools to create an .icns from a .png.
Are you referring to the icon which appears in the dock? I added a .ico to my application's resource file, then set it as my icon with the following call
QApplication::qApp()->setWindowIcon(QIcon(<resource path>));

Resources