boycy
boycy

Reputation: 1493

How do I set different application icon for different configurations?

In the project properties dialog, on the 'Application' tab, the dropdown for choosing the configuration is disabled; how can I set the icon to be dependent on the build configuration?

Upvotes: 2

Views: 1100

Answers (3)

idbrii
idbrii

Reputation: 11966

I was able to do this in my game.rc file:

// Microsoft Visual C++ generated resource script.
//

...

/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

#if defined(RELEASECHANNEL_DEV)
IDI_ICON1               ICON                    "game_dev.ico"
#else
IDI_ICON1               ICON                    "game.ico"
#endif

I believe this file is initially generated for the project, but doesn't seem to be modified again. We use premake to create our VS project and use resincludedirs( { "../resources" } ) to include the directory containing game.rc and game.ico.

Upvotes: 0

Andez
Andez

Reputation: 5858

Personally, I would change the configuration but remember to change the Icon manually in the Project Properties before compiling for each configuration.

Upvotes: 0

Andez
Andez

Reputation: 5858

This might shed some light - but I think it's only for VS2010:

application-icon--how-to-select-different-icon-based-on-compiler-directives-32338

Upvotes: 1

Related Questions