added support for mismatching installer and uninstaller icons

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5307 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-10-03 17:37:56 +00:00
parent a9cf8ee77d
commit be36b69b03
5 changed files with 329 additions and 214 deletions

View file

@ -1602,11 +1602,11 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_ICON:
SCRIPT_MSG("Icon: \"%s\"\n",line.gettoken_str(1));
try {
init_res_editor();
replace_icon(res_editor, IDI_ICON2, line.gettoken_str(1));
free_loaded_icon(installer_icon);
installer_icon = load_icon_file(line.gettoken_str(1));
}
catch (exception& err) {
ERROR_MSG("Error while setting icon to \"%s\": %s\n", line.gettoken_str(1), err.what());
ERROR_MSG("Error while loading icon from \"%s\": %s\n", line.gettoken_str(1), err.what());
return PS_ERROR;
}
return PS_OK;
@ -3101,11 +3101,11 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_UNINSTICON:
SCRIPT_MSG("UninstallIcon: \"%s\"\n",line.gettoken_str(1));
try {
free(m_unicon_data);
m_unicon_data = generate_uninstall_icon_data(line.gettoken_str(1), m_unicon_size);
free_loaded_icon(uninstaller_icon);
uninstaller_icon = load_icon_file(line.gettoken_str(1));
}
catch (exception& err) {
ERROR_MSG("Error while setting icon to \"%s\": %s\n", line.gettoken_str(1), err.what());
ERROR_MSG("Error while loading icon from \"%s\": %s\n", line.gettoken_str(1), err.what());
return PS_ERROR;
}
return PS_OK;